Fawkes API
Fawkes Development Version
|
#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 |
virtual bool | matches (void *memptr) |
virtual size_t | size () |
virtual bool | create () |
Check if buffer should be created. More... | |
virtual void | initialize (void *memptr) |
virtual void | set (void *memptr) |
virtual void | reset () |
virtual size_t | data_size () |
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 () |
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | ) |
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 260 of file shm_lut.cpp.
References bytes_per_cell(), height(), lut_id(), and 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 280 of file shm_lut.cpp.
References bytes_per_cell(), depth(), height(), lut_id(), and width().
firevision::SharedMemoryLookupTableHeader::SharedMemoryLookupTableHeader | ( | const SharedMemoryLookupTableHeader * | h | ) |
|
virtual |
Destructor.
Definition at line 314 of file shm_lut.cpp.
unsigned int firevision::SharedMemoryLookupTableHeader::bytes_per_cell | ( | ) | const |
Get bytes per cell.
Definition at line 475 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::bytes_per_cell.
Referenced by firevision::FuseServerClientThread::process_getlutlist_message(), and SharedMemoryLookupTableHeader().
|
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 324 of file shm_lut.cpp.
References SharedMemoryLookupTableHeader().
|
virtual |
Check if buffer should be created.
Definition at line 386 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 336 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::bytes_per_cell, firevision::SharedMemoryLookupTable_header_t::depth, firevision::SharedMemoryLookupTable_header_t::height, and firevision::SharedMemoryLookupTable_header_t::width.
unsigned int firevision::SharedMemoryLookupTableHeader::depth | ( | ) | const |
Get LUT depth.
Definition at line 464 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::depth.
Referenced by firevision::FuseServerClientThread::process_getlutlist_message(), and SharedMemoryLookupTableHeader().
unsigned int firevision::SharedMemoryLookupTableHeader::height | ( | ) | const |
Get LUT height.
Definition at line 453 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::height.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), firevision::FuseServerClientThread::process_getlutlist_message(), and SharedMemoryLookupTableHeader().
|
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 392 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.
const char * firevision::SharedMemoryLookupTableHeader::lut_id | ( | ) | const |
Get LUT ID.
Definition at line 486 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::lut_id.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), firevision::FuseServerClientThread::process_getlutlist_message(), set_lut_id(), and SharedMemoryLookupTableHeader().
|
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 346 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 426 of file shm_lut.cpp.
|
virtual |
Print Info.
Definition at line 368 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.
SharedMemoryLookupTable_header_t * firevision::SharedMemoryLookupTableHeader::raw_header | ( | ) |
|
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 411 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 405 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 497 of file shm_lut.cpp.
References lut_id().
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 330 of file shm_lut.cpp.
unsigned int firevision::SharedMemoryLookupTableHeader::width | ( | ) | const |
Get LUT width.
Definition at line 442 of file shm_lut.cpp.
References firevision::SharedMemoryLookupTable_header_t::width.
Referenced by firevision::SharedMemoryLookupTableLister::print_info(), firevision::FuseServerClientThread::process_getlutlist_message(), and SharedMemoryLookupTableHeader().