Fawkes API
Fawkes Development Version
|
BlackBoard interface list content. More...
#include <>>
Public Member Functions | |
BlackBoardInterfaceListContent () | |
Constructor. | |
BlackBoardInterfaceListContent (unsigned int component_id, unsigned int msg_id, void *payload, size_t payload_size) | |
Message content constructor. | |
virtual | ~BlackBoardInterfaceListContent () |
Destructor. | |
void | append_interface (const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers) |
Append interface info. | |
void | append_interface (InterfaceInfo &info) |
Append interface info. | |
virtual void | serialize () |
Serialize message content. | |
void | reset_iterator () |
Reset iterator. | |
bool | has_next () |
Check if more list elements are available. | |
bb_iinfo_msg_t * | next (size_t *size) |
Get next plugin from list. | |
![]() | |
FawkesNetworkMessageContent () | |
Constructor. | |
virtual | ~FawkesNetworkMessageContent () |
Virtual empty destructor. | |
virtual void * | payload () |
Return pointer to payload. | |
virtual size_t | payload_size () |
Return payload size. |
Additional Inherited Members | |
![]() | |
void | copy_payload (size_t offset, const void *buf, size_t len) |
Copy payload into payload buffer to a specified offset. | |
![]() | |
void * | _payload |
Pointer to payload. | |
size_t | _payload_size |
Payloda size. |
BlackBoard interface list content.
A complex dynamic message with an arbitrary number of interfaces. Uses DynamicBuffer for the internal list of plugins and thus the buffer is limited to 4 GB in total.
Definition at line 35 of file ilist_content.h.
fawkes::BlackBoardInterfaceListContent::BlackBoardInterfaceListContent | ( | ) |
Constructor.
Definition at line 44 of file ilist_content.cpp.
References fawkes::bb_ilist_msg_t::interface_list.
fawkes::BlackBoardInterfaceListContent::BlackBoardInterfaceListContent | ( | unsigned int | component_id, |
unsigned int | msg_id, | ||
void * | payload, | ||
size_t | payload_size | ||
) |
Message content constructor.
This constructor is meant to be used with FawkesNetworkMessage::msgc().
component_id | component ID |
msg_id | message ID |
payload | message payload |
payload_size | total payload size |
Definition at line 57 of file ilist_content.cpp.
References fawkes::bb_ilist_msg_t::interface_list.
|
virtual |
Destructor.
Definition at line 73 of file ilist_content.cpp.
References fawkes::FawkesNetworkMessageContent::_payload, and fawkes::FawkesNetworkMessageContent::_payload_size.
void fawkes::BlackBoardInterfaceListContent::append_interface | ( | const char * | type, |
const char * | id, | ||
const unsigned char * | hash, | ||
unsigned int | serial, | ||
bool | has_writer, | ||
unsigned int | num_readers | ||
) |
Append interface info.
type | type of interface |
id | ID of interface instance |
hash | version hash of interface instance/type |
serial | instance serial |
has_writer | true if a writer exists, false otherwise |
num_readers | number of readers |
Definition at line 94 of file ilist_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::bb_iinfo_msg_t::has_writer, fawkes::bb_iinfo_msg_t::hash, fawkes::bb_iinfo_msg_t::id, fawkes::bb_iinfo_msg_t::num_readers, fawkes::bb_iinfo_msg_t::serial, and fawkes::bb_iinfo_msg_t::type.
Referenced by fawkes::BlackBoardNetworkHandler::loop().
void fawkes::BlackBoardInterfaceListContent::append_interface | ( | InterfaceInfo & | iinfo | ) |
Append interface info.
iinfo | interface info |
Definition at line 115 of file ilist_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::InterfaceInfo::has_writer(), fawkes::bb_iinfo_msg_t::has_writer, fawkes::InterfaceInfo::hash(), fawkes::bb_iinfo_msg_t::hash, fawkes::InterfaceInfo::id(), fawkes::bb_iinfo_msg_t::id, fawkes::InterfaceInfo::num_readers(), fawkes::bb_iinfo_msg_t::num_readers, fawkes::InterfaceInfo::serial(), fawkes::bb_iinfo_msg_t::serial, fawkes::InterfaceInfo::type(), and fawkes::bb_iinfo_msg_t::type.
bool fawkes::BlackBoardInterfaceListContent::has_next | ( | ) |
Check if more list elements are available.
For incoming messages only.
Definition at line 154 of file ilist_content.cpp.
References fawkes::DynamicBuffer::has_next().
Referenced by fawkes::RemoteBlackBoard::list(), and fawkes::RemoteBlackBoard::list_all().
bb_iinfo_msg_t * fawkes::BlackBoardInterfaceListContent::next | ( | size_t * | size | ) |
Get next plugin from list.
size | upon return contains the size of the returned data element. |
Definition at line 167 of file ilist_content.cpp.
References fawkes::DynamicBuffer::next().
Referenced by fawkes::RemoteBlackBoard::list(), and fawkes::RemoteBlackBoard::list_all().
void fawkes::BlackBoardInterfaceListContent::reset_iterator | ( | ) |
Reset iterator.
For incoming messages only.
Definition at line 143 of file ilist_content.cpp.
References fawkes::DynamicBuffer::reset_iterator().
|
virtual |
Serialize message content.
Generate a single contiguous buffer. Make _payload point to this buffer and _payload_size contain the size of the buffer.
Implements fawkes::FawkesNetworkMessageContent.
Definition at line 130 of file ilist_content.cpp.
References fawkes::FawkesNetworkMessageContent::_payload, fawkes::FawkesNetworkMessageContent::_payload_size, fawkes::DynamicBuffer::buffer(), fawkes::DynamicBuffer::buffer_size(), and fawkes::FawkesNetworkMessageContent::copy_payload().