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> 29 #include <utils/time/time.h> 32 #include <arpa/inet.h> 64 if ( component_id != FAWKES_CID_BLACKBOARD ) {
68 void *ilist_payload = (
void *)((
size_t)payload +
sizeof(msg));
70 payload_size -
sizeof(msg));
77 delete interface_list;
98 const unsigned char *hash,
100 bool has_writer,
unsigned int num_readers,
104 memset(&info, 0,
sizeof(info));
105 strncpy(info.
type, type, __INTERFACE_TYPE_SIZE);
106 strncpy(info.
id,
id, __INTERFACE_ID_SIZE);
107 memcpy(info.
hash, hash, __INTERFACE_HASH_SIZE);
108 info.
serial = htonl(serial);
115 interface_list->
append(&info,
sizeof(info));
128 memset(&info, 0,
sizeof(info));
129 strncpy(info.
type, iinfo.
type(), __INTERFACE_TYPE_SIZE);
130 strncpy(info.
id, iinfo.
id(), __INTERFACE_ID_SIZE);
131 memcpy(info.
hash, iinfo.
hash(), __INTERFACE_HASH_SIZE);
143 interface_list->
append(&info,
sizeof(info));
187 void *tmp = interface_list->
next(size);
void * _payload
Pointer to payload.
uint32_t serial
instance serial to uniquely identify this instance (big endian)
const char * type() const
Get interface type.
bool has_next()
Check if more list elements are available.
size_t _payload_size
Payloda size.
int64_t timestamp_sec
data or write timestamp, sec part
Fawkes library namespace.
const char * id() const
Get interface ID.
int64_t timestamp_usec
data or write timestamp, usec part
void * buffer()
Get pointer to buffer.
bb_iinfo_msg_t * next(size_t *size)
Get next plugin from list.
A class for handling time.
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.
const unsigned char * hash() const
Get interface version hash.
const Time * timestamp() const
Get interface timestamp.
char id[__INTERFACE_ID_SIZE]
interface instance ID
bool has_writer() const
Check if there is a writer.
uint32_t writer_readers
combined writer reader information.
char type[__INTERFACE_TYPE_SIZE]
interface type name
unsigned char hash[__INTERFACE_HASH_SIZE]
interface version hash
unsigned int serial() const
Get interface instance serial.
virtual void * payload()
Return pointer to payload.
unsigned int num_readers() const
Get number of readers.
dynamic_list_t interface_list
dynamic buffer list with interface info
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.
long get_sec() const
Get seconds.
void copy_payload(size_t offset, const void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
Dynamically growing buffer.
long get_usec() const
Get microseconds.
virtual size_t payload_size()
Return payload size.
void reset_iterator()
Reset iterator.
virtual ~BlackBoardInterfaceListContent()
Destructor.
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.