fawkes::BlackBoardInterfaceListContent Class Reference

BlackBoard interface list content. More...

#include <blackboard/net/ilist_content.h>

Inheritance diagram for fawkes::BlackBoardInterfaceListContent:

[legend]
List of all members.

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_tnext (size_t *size)
 Get next plugin from list.

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

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

Parameters:
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.

fawkes::BlackBoardInterfaceListContent::~BlackBoardInterfaceListContent (  )  [virtual]

Destructor.

Definition at line 73 of file ilist_content.cpp.

References fawkes::FawkesNetworkMessageContent::_payload, and fawkes::FawkesNetworkMessageContent::_payload_size.


Member Function Documentation

void fawkes::BlackBoardInterfaceListContent::append_interface ( InterfaceInfo iinfo  ) 

Append interface info.

Parameters:
iinfo interface info

Definition at line 115 of file ilist_content.cpp.

References fawkes::DynamicBuffer::append(), fawkes::InterfaceInfo::has_writer(), fawkes::InterfaceInfo::hash(), fawkes::InterfaceInfo::id(), fawkes::InterfaceInfo::num_readers(), fawkes::InterfaceInfo::serial(), and fawkes::InterfaceInfo::type().

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.

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

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 154 of file ilist_content.cpp.

References fawkes::DynamicBuffer::has_next().

Referenced by fawkes::RemoteBlackBoard::list_all().

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

Get next plugin from list.

Parameters:
size upon 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 167 of file ilist_content.cpp.

References fawkes::DynamicBuffer::next().

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

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


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:32:46 2011 for Fawkes API by  doxygen 1.4.7