Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
SharedMemoryImageBufferHeader () | |
Constructor. More... | |
SharedMemoryImageBufferHeader (const char *image_id, colorspace_t colorspace, unsigned int width, unsigned int height) | |
Constructor. More... | |
SharedMemoryImageBufferHeader (const SharedMemoryImageBufferHeader *h) | |
Copy constructor. More... | |
virtual | ~SharedMemoryImageBufferHeader () |
Destructor. More... | |
virtual fawkes::SharedMemoryHeader * | clone () const |
virtual bool | matches (void *memptr) |
virtual size_t | size () |
virtual void | print_info () |
Print some info. More... | |
virtual bool | create () |
Create if colorspace, width and height have been supplied. 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... | |
void | set_image_id (const char *image_id) |
Set image id. More... | |
void | set_frame_id (const char *frame_id) |
Set frame ID. More... | |
colorspace_t | colorspace () const |
Get colorspace. More... | |
unsigned int | width () const |
Get width. More... | |
unsigned int | height () const |
Get height. More... | |
const char * | image_id () const |
Get image number. More... | |
const char * | frame_id () const |
Get frame ID. More... | |
SharedMemoryImageBuffer_header_t * | raw_header () |
Get raw header. More... | |
![]() | |
virtual | ~SharedMemoryHeader () |
Shared memory image buffer header.
Definition at line 65 of file shm_image.h.
firevision::SharedMemoryImageBufferHeader::SharedMemoryImageBufferHeader | ( | ) |
firevision::SharedMemoryImageBufferHeader::SharedMemoryImageBufferHeader | ( | const char * | image_id, |
colorspace_t | colorspace, | ||
unsigned int | width, | ||
unsigned int | height | ||
) |
Constructor.
image_id | image id |
colorspace | colorspace |
width | width |
height | height |
Definition at line 565 of file shm_image.cpp.
References colorspace(), height(), image_id(), and width().
firevision::SharedMemoryImageBufferHeader::SharedMemoryImageBufferHeader | ( | const SharedMemoryImageBufferHeader * | h | ) |
Copy constructor.
h | shared memory image header to copy |
Definition at line 587 of file shm_image.cpp.
|
virtual |
Destructor.
Definition at line 612 of file shm_image.cpp.
|
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 631 of file shm_image.cpp.
References SharedMemoryImageBufferHeader().
colorspace_t firevision::SharedMemoryImageBufferHeader::colorspace | ( | ) | const |
Get colorspace.
Definition at line 801 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::colorspace.
Referenced by firevision::SharedMemoryImageBufferLister::print_info(), firevision::SharedMemoryImageBufferMetaDataCollector::print_info(), firevision::FuseServerClientThread::process_getimagelist_message(), and SharedMemoryImageBufferHeader().
|
virtual |
Create if colorspace, width and height have been supplied.
Definition at line 720 of file shm_image.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 637 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::colorspace, firevision::SharedMemoryImageBuffer_header_t::height, and firevision::SharedMemoryImageBuffer_header_t::width.
const char * firevision::SharedMemoryImageBufferHeader::frame_id | ( | ) | const |
Get frame ID.
Definition at line 846 of file shm_image.cpp.
Referenced by firevision::SharedMemoryImageBuffer::frame_id(), firevision::SharedMemoryImageBufferLister::print_info(), firevision::SharedMemoryImageBufferMetaDataCollector::print_info(), and set_frame_id().
unsigned int firevision::SharedMemoryImageBufferHeader::height | ( | ) | const |
Get height.
Definition at line 825 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::height.
Referenced by firevision::SharedMemoryImageBufferLister::print_info(), firevision::SharedMemoryImageBufferMetaDataCollector::print_info(), firevision::FuseServerClientThread::process_getimagelist_message(), and SharedMemoryImageBufferHeader().
const char * firevision::SharedMemoryImageBufferHeader::image_id | ( | ) | const |
Get image number.
Definition at line 837 of file shm_image.cpp.
Referenced by firevision::SharedMemoryImageBufferLister::print_info(), firevision::SharedMemoryImageBufferMetaDataCollector::print_info(), firevision::FuseServerClientThread::process_getimagelist_message(), set_image_id(), and SharedMemoryImageBufferHeader().
|
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 726 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::colorspace, firevision::SharedMemoryImageBuffer_header_t::frame_id, firevision::SharedMemoryImageBuffer_header_t::height, firevision::SharedMemoryImageBuffer_header_t::image_id, and firevision::SharedMemoryImageBuffer_header_t::width.
|
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 649 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::colorspace, firevision::SharedMemoryImageBuffer_header_t::frame_id, firevision::SharedMemoryImageBuffer_header_t::height, firevision::SharedMemoryImageBuffer_header_t::image_id, and firevision::SharedMemoryImageBuffer_header_t::width.
|
virtual |
Check for equality of headers.
First checks if passed SharedMemoryHeader is an instance of SharedMemoryImageBufferHeader. If not returns false, otherwise it compares image ID, colorspace, width, and height. If all match returns true, false if any of them differs.
s | shared memory header to compare to |
Implements fawkes::SharedMemoryHeader.
Definition at line 680 of file shm_image.cpp.
|
virtual |
Print some info.
Definition at line 694 of file shm_image.cpp.
SharedMemoryImageBuffer_header_t * firevision::SharedMemoryImageBufferHeader::raw_header | ( | ) |
Get raw header.
Definition at line 877 of file shm_image.cpp.
Referenced by firevision::SharedMemoryImageBuffer::set_image_id().
|
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 775 of file shm_image.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 743 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::colorspace, firevision::SharedMemoryImageBuffer_header_t::frame_id, firevision::SharedMemoryImageBuffer_header_t::height, firevision::SharedMemoryImageBuffer_header_t::image_id, and firevision::SharedMemoryImageBuffer_header_t::width.
void firevision::SharedMemoryImageBufferHeader::set_frame_id | ( | const char * | frame_id | ) |
Set frame ID.
frame_id | frame ID |
Definition at line 866 of file shm_image.cpp.
References frame_id().
Referenced by firevision::SharedMemoryImageBuffer::set_frame_id().
void firevision::SharedMemoryImageBufferHeader::set_image_id | ( | const char * | image_id | ) |
Set image id.
image_id | image ID |
Definition at line 855 of file shm_image.cpp.
References image_id().
Referenced by firevision::SharedMemoryImageBuffer::set_image_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 625 of file shm_image.cpp.
unsigned int firevision::SharedMemoryImageBufferHeader::width | ( | ) | const |
Get width.
Definition at line 813 of file shm_image.cpp.
References firevision::SharedMemoryImageBuffer_header_t::width.
Referenced by firevision::SharedMemoryImageBufferLister::print_info(), firevision::SharedMemoryImageBufferMetaDataCollector::print_info(), firevision::FuseServerClientThread::process_getimagelist_message(), and SharedMemoryImageBufferHeader().