24 #include <blackboard/net/ilist_content.h>
26 #include <netcomm/utils/dynamic_buffer.h>
27 #include <netcomm/fawkes/component_ids.h>
28 #include <core/exceptions/software.h>
62 if ( component_id != FAWKES_CID_BLACKBOARD ) {
66 void *ilist_payload = (
void *)((
size_t)payload +
sizeof(msg));
68 payload_size -
sizeof(msg));
75 delete interface_list;
95 const unsigned char *hash,
97 bool has_writer,
unsigned int num_readers)
100 memset(&info, 0,
sizeof(info));
101 strncpy(info.
type, type, __INTERFACE_TYPE_SIZE);
102 strncpy(info.
id,
id, __INTERFACE_ID_SIZE);
103 memcpy(info.
hash, hash, __INTERFACE_HASH_SIZE);
104 interface_list->
append(&info,
sizeof(info));
118 memset(&info, 0,
sizeof(info));
119 strncpy(info.
type, iinfo.
type(), __INTERFACE_TYPE_SIZE);
120 strncpy(info.
id, iinfo.
id(), __INTERFACE_ID_SIZE);
121 memcpy(info.
hash, iinfo.
hash(), __INTERFACE_HASH_SIZE);
125 interface_list->
append(&info,
sizeof(info));
169 void *tmp = interface_list->
next(size);
void * _payload
Pointer to payload.
uint32_t serial
instance serial to unique identify this instance
bool has_next()
Check if more list elements are available.
size_t _payload_size
Payloda size.
const char * id() const
Get interface ID.
const char * type() const
Get interface type.
uint32_t num_readers
number of currently existing readers
Fawkes library namespace.
uint32_t has_writer
1 if the interface currently has a writer, 0 otherwise
void * buffer()
Get pointer to buffer.
bool has_writer() const
Check if there is a writer.
bb_iinfo_msg_t * next(size_t *size)
Get next plugin from list.
void reset_iterator()
Reset iterator.
Message to transport a list of interfaces.
Message for interface info.
bool has_next()
Check if another element is available.
size_t buffer_size()
Get buffer size.
char id[__INTERFACE_ID_SIZE]
interface instance ID
unsigned int serial() const
Get interface instance serial.
char type[__INTERFACE_TYPE_SIZE]
interface type name
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.
unsigned char hash[__INTERFACE_HASH_SIZE]
interface version hash
dynamic_list_t interface_list
dynamic buffer list with interface info
void copy_payload(size_t offset, const void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
Dynamically growing buffer.
void reset_iterator()
Reset iterator.
virtual ~BlackBoardInterfaceListContent()
Destructor.
unsigned int num_readers() const
Get number of readers.
const unsigned char * hash() const
Get interface version hash.
void append(const void *data, size_t data_size)
Append data.
void * next(size_t *size)
Get next buffer.
virtual void serialize()
Serialize message content.
BlackBoardInterfaceListContent()
Constructor.