Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
FuseMessageContent () | |
Constructor. More... | |
virtual | ~FuseMessageContent () |
Virtual empty destructor. More... | |
virtual void | serialize ()=0 |
virtual void * | payload () const |
Return pointer to payload. More... | |
virtual size_t | payload_size () const |
Return payload size. More... | |
void | free_payload () |
Free message payload. More... | |
Protected Member Functions | |
void | copy_payload (size_t offset, void *buf, size_t len) |
Copy payload into payload buffer to a specified offset. More... | |
Protected Attributes | |
void * | _payload |
Pointer to payload. More... | |
size_t | _payload_size |
Payloda size. More... | |
FUSE message content. Interface for complex FUSE network messages. Use this type if you want either a nicer interface to your network message or if you need a more complex kind of message type, for example by using DynamicBuffer.
Implement all accessor methods that you need and add any data you want. In the end you have to implement serialize() to create a single contiguous buffer that contains all the data that has to be sent. Make _payload point to this buffer and _payload_size contain the size of the buffer.
Definition at line 37 of file fuse_message_content.h.
firevision::FuseMessageContent::FuseMessageContent | ( | ) |
Constructor.
Definition at line 61 of file fuse_message_content.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 68 of file fuse_message_content.cpp.
References _payload, and _payload_size.
|
protected |
Copy payload into payload buffer to a specified offset.
This assumes that you have made sure that the buffer is big enough!
offset | offset in _payload where to copy the data to |
buf | buffer to copy from |
len | number of bytes to copy from buf |
Definition at line 107 of file fuse_message_content.cpp.
References _payload, and _payload_size.
void firevision::FuseMessageContent::free_payload | ( | ) |
Free message payload.
Definition at line 115 of file fuse_message_content.cpp.
|
virtual |
Return pointer to payload.
NullPointerException | thrown if _payload does not point to a valid buffer or if _payload_size is zero. |
Definition at line 78 of file fuse_message_content.cpp.
Referenced by firevision::FuseNetworkMessage::set().
|
virtual |
Return payload size.
NullPointerException | thrown if _payload does not point to a valid buffer or if _payload_size is zero. |
Definition at line 92 of file fuse_message_content.cpp.
Referenced by firevision::FuseNetworkMessage::set().
|
pure virtual |
Serialize message content. Generate a single contiguous buffer. Make _payload point to this buffer and _payload_size contain the size of the buffer.
Implemented in firevision::FuseImageContent, firevision::FuseLutContent, firevision::FuseLutListContent, and firevision::FuseImageListContent.
Referenced by firevision::FuseNetworkMessage::set().
|
protected |
Pointer to payload.
Definition at line 60 of file fuse_message_content.h.
Referenced by copy_payload(), firevision::FuseImageContent::FuseImageContent(), firevision::FuseLutContent::FuseLutContent(), and ~FuseMessageContent().
|
protected |
Payloda size.
Definition at line 62 of file fuse_message_content.h.
Referenced by copy_payload(), firevision::FuseImageContent::FuseImageContent(), firevision::FuseLutContent::FuseLutContent(), and ~FuseMessageContent().