SharedMemoryLookupTable Class Reference
Shared memory lookup table. More...
#include <fvutils/ipc/shm_lut.h>

Public Member Functions | |
| SharedMemoryLookupTable (const char *lut_id, unsigned int width, unsigned int height, unsigned int depth=1, unsigned int bytes_per_cell=1) | |
| Write Constructor. | |
| SharedMemoryLookupTable (const char *lut_id, bool is_read_only=true) | |
| Read constructor. | |
| ~SharedMemoryLookupTable () | |
| Destructor. | |
| const char * | lut_id () const |
| Get LUT ID. | |
| bool | set_lut_id (const char *lut_id) |
| Set LUT ID. | |
| unsigned char * | buffer () const |
| Get LUT buffer. | |
| unsigned int | width () const |
| Get LUT width. | |
| unsigned int | height () const |
| Get LUT height. | |
| unsigned int | depth () const |
| Get LUT depth. | |
| unsigned int | bytes_per_cell () const |
| Get bytes per cell. | |
Static Public Member Functions | |
| static void | list () |
| List shared memory LUT segments. | |
| static void | cleanup (bool use_lister=true) |
| Erase all shared memory segments that contain FireVision LUTs. | |
| static bool | exists (const char *lut_id) |
| Check LUT availability. | |
| static void | wipe (const char *lut_id) |
| Erase a specific shared memory segment that contains a LUT. | |
Detailed Description
Shared memory lookup table.Definition at line 108 of file shm_lut.h.
Constructor & Destructor Documentation
| SharedMemoryLookupTable::SharedMemoryLookupTable | ( | const char * | lut_id, | |
| unsigned int | width, | |||
| unsigned int | height, | |||
| unsigned int | depth = 1, |
|||
| unsigned int | bytes_per_cell = 1 | |||
| ) |
Write Constructor.
Create a new shared memory segment. Will open a shared memory segment that exactly fits the given information. Will throw an error if image with num image_num exists it will throw an exception an exception. I will create a new segment if no matching segment was found. The segment is accessed in read-write mode.
- Parameters:
-
lut_id LUT ID width LUT width height LUT height depth LUT depth bytes_per_cell LUT bytes per cell
Definition at line 53 of file shm_lut.cpp.
| SharedMemoryLookupTable::SharedMemoryLookupTable | ( | const char * | lut_id, | |
| bool | is_read_only = true | |||
| ) |
Read constructor.
This constructor is used to search for an existing shared memory segment. It will throw an error if it cannot find a segment with the specified data. The segment is opened read-only by default, but this can be overridden with the is_read_only argument if needed.
- Parameters:
-
lut_id LUT ID is_read_only true to open read-only
Definition at line 72 of file shm_lut.cpp.
| SharedMemoryLookupTable::~SharedMemoryLookupTable | ( | ) |
Member Function Documentation
| unsigned char * SharedMemoryLookupTable::buffer | ( | ) | const |
Get LUT buffer.
- Returns:
- LUT buffer
Definition at line 143 of file shm_lut.cpp.
References fawkes::SharedMemory::_memptr.
Referenced by FuseLutContent::FuseLutContent().
| unsigned int SharedMemoryLookupTable::bytes_per_cell | ( | ) | const |
Get bytes per cell.
- Returns:
- bytes per cell
Definition at line 183 of file shm_lut.cpp.
References SharedMemoryLookupTable_header_t::bytes_per_cell.
Referenced by FuseLutContent::FuseLutContent().
| void SharedMemoryLookupTable::cleanup | ( | bool | use_lister = true |
) | [static] |
Erase all shared memory segments that contain FireVision LUTs.
- Parameters:
-
use_lister if true a lister is used to print the shared memory segments to stdout while cleaning up.
Definition at line 208 of file shm_lut.cpp.
References fawkes::SharedMemory::erase_orphaned().
Referenced by FvBaseThread::init().
| unsigned int SharedMemoryLookupTable::depth | ( | ) | const |
Get LUT depth.
- Returns:
- LUT depth
Definition at line 173 of file shm_lut.cpp.
References SharedMemoryLookupTable_header_t::depth.
Referenced by FuseLutContent::FuseLutContent().
| bool SharedMemoryLookupTable::exists | ( | const char * | lut_id | ) | [static] |
Check LUT availability.
- Parameters:
-
lut_id image number to check
- Returns:
- true if shared memory segment with requested LUT exists
Definition at line 229 of file shm_lut.cpp.
| unsigned int SharedMemoryLookupTable::height | ( | ) | const |
Get LUT height.
- Returns:
- LUT height
Definition at line 163 of file shm_lut.cpp.
References SharedMemoryLookupTable_header_t::height.
Referenced by FuseLutContent::FuseLutContent().
| void SharedMemoryLookupTable::list | ( | ) | [static] |
| const char * SharedMemoryLookupTable::lut_id | ( | ) | const |
Get LUT ID.
- Returns:
- LUT ID
Definition at line 117 of file shm_lut.cpp.
Referenced by FuseLutContent::FuseLutContent().
| bool SharedMemoryLookupTable::set_lut_id | ( | const char * | lut_id | ) |
Set LUT ID.
- Parameters:
-
lut_id LUT ID
- Returns:
- true on success
Definition at line 128 of file shm_lut.cpp.
References fawkes::SharedMemory::_memptr, fawkes::SharedMemory::attach(), fawkes::SharedMemory::free(), and SharedMemoryLookupTableHeader::set_lut_id().
| unsigned int SharedMemoryLookupTable::width | ( | ) | const |
Get LUT width.
- Returns:
- LUT width
Definition at line 153 of file shm_lut.cpp.
References SharedMemoryLookupTable_header_t::width.
Referenced by FuseLutContent::FuseLutContent().
| void SharedMemoryLookupTable::wipe | ( | const char * | lut_id | ) | [static] |
Erase a specific shared memory segment that contains a LUT.
- Parameters:
-
lut_id LUT ID
Definition at line 242 of file shm_lut.cpp.
References fawkes::SharedMemory::erase().
The documentation for this class was generated from the following files:
- src/firevision/fvutils/ipc/shm_lut.h
- src/firevision/fvutils/ipc/shm_lut.cpp

