Fawkes API
Fawkes Development Version
|
Shared memory lookup table header. More...
#include <>>
Public Member Functions | |
SharedMemoryLookupTableHeader () | |
Constructor. More... | |
SharedMemoryLookupTableHeader (const char *lut_id, unsigned int width, unsigned int height, unsigned int bytes_per_cell) | |
Constructor. More... | |
SharedMemoryLookupTableHeader (const char *lut_id, unsigned int width, unsigned int height, unsigned int depth, unsigned int bytes_per_cell) | |
Constructor. More... | |
SharedMemoryLookupTableHeader (const SharedMemoryLookupTableHeader *h) | |
Copy constructor. More... | |
virtual | ~SharedMemoryLookupTableHeader () |
Destructor. More... | |
virtual fawkes::SharedMemoryHeader * | clone () const |
Clone this shared memory header. More... | |
virtual bool | matches (void *memptr) |
Method to check if the given memptr matches this header. More... | |
virtual size_t | size () |
Size of the header. More... | |
virtual bool | create () |
Check if buffer should be created. More... | |
virtual void | initialize (void *memptr) |
Initialize the header. More... | |
virtual void | set (void *memptr) |
Set information from memptr. More... | |
virtual void | reset () |
Reset information previously set with set(). More... | |
virtual size_t | data_size () |
Return the size of the data. More... | |
virtual bool | operator== (const fawkes::SharedMemoryHeader &s) const |
Check for equality of headers. More... | |
virtual void | print_info () |
Print Info. More... | |
const char * | lut_id () const |
Get LUT ID. More... | |
void | set_lut_id (const char *lut_id) |
Set LUT ID. More... | |
unsigned int | width () const |
Get LUT width. More... | |
unsigned int | height () const |
Get LUT height. More... | |
unsigned int | depth () const |
Get LUT depth. More... | |
unsigned int | bytes_per_cell () const |
Get bytes per cell. More... | |
SharedMemoryLookupTable_header_t * | raw_header () |
Get raw header. More... | |
![]() | |
virtual | ~SharedMemoryHeader () |
Virtual destructor. More... | |
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | ) |
Constructor.
Definition at line 261 of file shm_lut.cpp.
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | const char * | lut_id, |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | bytes_per_cell | ||
) |
Constructor.
lut_id | LUT ID |
width | LUT width |
height | LUT height |
bytes_per_cell | bytes per cell |
Definition at line 278 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable::bytes_per_cell(), firevision::SharedMemoryLookupTable::height(), and firevision::SharedMemoryLookupTable::width().
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | const char * | lut_id, |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | depth, | ||
unsigned int | bytes_per_cell | ||
) |
Constructor.
lut_id | LUT ID |
width | LUT width |
height | LUT height |
depth | LUT depth |
bytes_per_cell | bytes per cell |
Definition at line 299 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable::bytes_per_cell(), firevision::SharedMemoryLookupTable::depth(), firevision::SharedMemoryLookupTable::height(), and firevision::SharedMemoryLookupTable::width().
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | const SharedMemoryLookupTableHeader * | h | ) |
|
virtual |
unsigned int firevision::SharedMemoryLookupTableHeader::bytes_per_cell | ( | ) | const |
Get bytes per cell.
Definition at line 520 of file shm_lut.cpp.
Referenced by firevision::FuseServerClientThread::process_getlutlist_message().
|
virtual |
Clone this shared memory header.
This method shall return a copied instance of this SharedMemoryHeader derivate. It should act the same way as the current instance.
Implements fawkes::SharedMemoryHeader.
Definition at line 346 of file shm_lut.cpp.
|
virtual |
Check if buffer should be created.
Definition at line 421 of file shm_lut.cpp.
|
virtual |
Return the size of the data.
The size of the data that will be stored in the shared memory segment. This method has to return the same value everytime and may only depend on the other data set in the header and written to the shared memory segment.
Implements fawkes::SharedMemoryHeader.
Definition at line 360 of file shm_lut.cpp.
unsigned int firevision::SharedMemoryLookupTableHeader::depth | ( | ) | const |
Get LUT depth.
Definition at line 509 of file shm_lut.cpp.
Referenced by firevision::FuseServerClientThread::process_getlutlist_message().
unsigned int firevision::SharedMemoryLookupTableHeader::height | ( | ) | const |
Get LUT height.
Definition at line 498 of file shm_lut.cpp.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), and firevision::FuseServerClientThread::process_getlutlist_message().
|
virtual |
Initialize the header.
This should initialize the header data in the given memptr from the data of this SharedMemoryHeader derivate instance. It has to write out all state information that is needed to identify the shared memory segment later on.
memptr | the memptr where the header data shall be written to. |
Implements fawkes::SharedMemoryHeader.
Definition at line 431 of file shm_lut.cpp.
const char * firevision::SharedMemoryLookupTableHeader::lut_id | ( | ) | const |
Get LUT ID.
Definition at line 531 of file shm_lut.cpp.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), and firevision::FuseServerClientThread::process_getlutlist_message().
|
virtual |
Method to check if the given memptr matches this header.
This method is called when searching for a shared memory segment to open, list or erase it. Implement this to distuinguish several shared memory segments that share the same magic token.
memptr | The memory chunk in the shared memory segment where to start checking. |
Implements fawkes::SharedMemoryHeader.
Definition at line 371 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::bytes_per_cell, firevision::SharedMemoryLookupTable_header_t::depth, firevision::SharedMemoryLookupTable_header_t::height, firevision::SharedMemoryLookupTable_header_t::lut_id, and firevision::SharedMemoryLookupTable_header_t::width.
|
virtual |
Check for equality of headers.
First checks if passed SharedMemoryHeader is an instance of SharedMemoryLookupTableHeader. If not returns false, otherwise it compares LUT ID, width, height, depth and bytes per cell. If all match returns true, false if any of them differs.
s | shared memory header to compare to |
Implements fawkes::SharedMemoryHeader.
Definition at line 468 of file shm_lut.cpp.
|
virtual |
Print Info.
Definition at line 402 of file shm_lut.cpp.
SharedMemoryLookupTable_header_t * firevision::SharedMemoryLookupTableHeader::raw_header | ( | ) |
Get raw header.
Definition at line 553 of file shm_lut.cpp.
Referenced by firevision::SharedMemoryLookupTable::SharedMemoryLookupTable().
|
virtual |
Reset information previously set with set().
This shall restore the state the header had before set() was called. This is used for instance in the SharedMemoryLister after info about one segment has been printed.
Implements fawkes::SharedMemoryHeader.
Definition at line 452 of file shm_lut.cpp.
|
virtual |
Set information from memptr.
Set the information stored in this SharedMemoryHeader derivate instance from the data stored in the given memptr.
memptr | The memptr where to copy data from. |
Implements fawkes::SharedMemoryHeader.
Definition at line 445 of file shm_lut.cpp.
void firevision::SharedMemoryLookupTableHeader::set_lut_id | ( | const char * | lut_id | ) |
Set LUT ID.
lut_id | LUT ID |
Definition at line 542 of file shm_lut.cpp.
References fawkes::SharedMemory::free().
Referenced by firevision::SharedMemoryLookupTable::set_lut_id().
|
virtual |
Size of the header.
The size that is needed in the shared memory memptr to accomodate the header data. This size has to fit all the data that will be stored in the header. It must return the same size every time.
Implements fawkes::SharedMemoryHeader.
Definition at line 353 of file shm_lut.cpp.
unsigned int firevision::SharedMemoryLookupTableHeader::width | ( | ) | const |
Get LUT width.
Definition at line 487 of file shm_lut.cpp.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), and firevision::FuseServerClientThread::process_getlutlist_message().