Fawkes API  Fawkes Development Version
fawkes::BlackBoardInterfaceListContent Class Reference

BlackBoard interface list content. More...

#include <>>

Inheritance diagram for fawkes::BlackBoardInterfaceListContent:

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_tnext (size_t *size)
 Get next plugin from list. More...
 
- Public Member Functions inherited from fawkes::FawkesNetworkMessageContent
 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

- Protected Member Functions inherited from fawkes::FawkesNetworkMessageContent
void copy_payload (size_t offset, const void *buf, size_t len)
 Copy payload into payload buffer to a specified offset. More...
 
- Protected Attributes inherited from fawkes::FawkesNetworkMessageContent
void * _payload
 Pointer to payload. More...
 
size_t _payload_size
 Payloda size. More...
 

Detailed Description

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.

Author
Tim Niemueller

Definition at line 35 of file ilist_content.h.

Constructor & Destructor Documentation

◆ BlackBoardInterfaceListContent() [1/2]

fawkes::BlackBoardInterfaceListContent::BlackBoardInterfaceListContent ( )

Constructor.

Definition at line 46 of file ilist_content.cpp.

References fawkes::bb_ilist_msg_t::interface_list.

◆ BlackBoardInterfaceListContent() [2/2]

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().

Parameters
component_idcomponent ID
msg_idmessage ID
payloadmessage payload
payload_sizetotal payload size

Definition at line 59 of file ilist_content.cpp.

References fawkes::bb_ilist_msg_t::interface_list.

◆ ~BlackBoardInterfaceListContent()

fawkes::BlackBoardInterfaceListContent::~BlackBoardInterfaceListContent ( )
virtual

Member Function Documentation

◆ append_interface() [1/2]

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.

Parameters
typetype of interface
idID of interface instance
hashversion hash of interface instance/type
serialinstance serial
has_writertrue if a writer exists, false otherwise
num_readersnumber of readers
timestampinterface 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().

◆ append_interface() [2/2]

◆ has_next()

bool fawkes::BlackBoardInterfaceListContent::has_next ( )

Check if more list elements are available.

For incoming messages only.

Returns
true if there are more elements available, false otherwise.

Definition at line 172 of file ilist_content.cpp.

References fawkes::DynamicBuffer::has_next().

Referenced by fawkes::RemoteBlackBoard::list(), and fawkes::RemoteBlackBoard::list_all().

◆ next()

bb_iinfo_msg_t * fawkes::BlackBoardInterfaceListContent::next ( size_t *  size)

Get next plugin from list.

Parameters
sizeupon return contains the size of the returned data element.
Returns
next config entitiy from the list. The value is only of the type of the header. Check the message type and the size and cast the message to the correct entity.

Definition at line 185 of file ilist_content.cpp.

References fawkes::DynamicBuffer::next().

Referenced by fawkes::RemoteBlackBoard::list(), and fawkes::RemoteBlackBoard::list_all().

◆ reset_iterator()

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().

◆ serialize()

void fawkes::BlackBoardInterfaceListContent::serialize ( )
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().


The documentation for this class was generated from the following files: