Fawkes API
Fawkes Development Version
|
BlackBoard interface list content. More...
#include <>>
Public Member Functions | |
BlackBoardInterfaceListContent () | |
Constructor. More... | |
BlackBoardInterfaceListContent (unsigned int component_id, unsigned int msg_id, void *payload, size_t payload_size) | |
Message content constructor. More... | |
virtual | ~BlackBoardInterfaceListContent () |
Destructor. More... | |
void | append_interface (const char *type, const char *id, const unsigned char *hash, unsigned int serial, bool has_writer, unsigned int num_readers, const fawkes::Time &time) |
Append interface info. More... | |
void | append_interface (InterfaceInfo &info) |
Append interface info. More... | |
virtual void | serialize () |
Serialize message content. More... | |
void | reset_iterator () |
Reset iterator. More... | |
bool | has_next () |
Check if more list elements are available. More... | |
bb_iinfo_msg_t * | next (size_t *size) |
Get next plugin from list. More... | |
![]() | |
FawkesNetworkMessageContent () | |
Constructor. More... | |
virtual | ~FawkesNetworkMessageContent () |
Virtual empty destructor. More... | |
virtual void * | payload () |
Return pointer to payload. More... | |
virtual size_t | payload_size () |
Return payload size. More... | |
Additional Inherited Members | |
![]() | |
void | copy_payload (size_t offset, const void *buf, size_t len) |
Copy payload into payload buffer to a specified offset. More... | |
![]() | |
void * | _payload |
Pointer to payload. More... | |
size_t | _payload_size |
Payloda size. More... | |
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 46 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 59 of file ilist_content.cpp.
References fawkes::bb_ilist_msg_t::interface_list.
|
virtual |
Destructor.
Definition at line 75 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, | ||
const fawkes::Time & | timestamp | ||
) |
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 |
timestamp | interface timestamp (time of last write or data timestamp) |
Definition at line 97 of file ilist_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::Time::get_sec(), fawkes::Time::get_usec(), fawkes::bb_iinfo_msg_t::hash, fawkes::bb_iinfo_msg_t::id, fawkes::bb_iinfo_msg_t::serial, fawkes::bb_iinfo_msg_t::timestamp_sec, fawkes::bb_iinfo_msg_t::timestamp_usec, fawkes::bb_iinfo_msg_t::type, and fawkes::bb_iinfo_msg_t::writer_readers.
Referenced by fawkes::BlackBoardNetworkHandler::loop().
void fawkes::BlackBoardInterfaceListContent::append_interface | ( | InterfaceInfo & | iinfo | ) |
Append interface info.
iinfo | interface info |
Definition at line 125 of file ilist_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::Time::get_sec(), fawkes::Time::get_usec(), fawkes::InterfaceInfo::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::InterfaceInfo::serial(), fawkes::bb_iinfo_msg_t::serial, fawkes::InterfaceInfo::timestamp(), fawkes::bb_iinfo_msg_t::timestamp_sec, fawkes::bb_iinfo_msg_t::timestamp_usec, fawkes::InterfaceInfo::type(), fawkes::bb_iinfo_msg_t::type, and fawkes::bb_iinfo_msg_t::writer_readers.
bool fawkes::BlackBoardInterfaceListContent::has_next | ( | ) |
Check if more list elements are available.
For incoming messages only.
Definition at line 172 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 185 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 161 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 148 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().