24 #include <arpa/inet.h> 25 #include <blackboard/net/ilist_content.h> 26 #include <core/exceptions/software.h> 27 #include <netcomm/fawkes/component_ids.h> 28 #include <netcomm/utils/dynamic_buffer.h> 29 #include <utils/time/time.h> 63 if (component_id != FAWKES_CID_BLACKBOARD) {
67 void * ilist_payload = (
void *)((
size_t)
payload +
sizeof(msg));
75 delete interface_list;
95 const unsigned char *hash,
98 unsigned int num_readers,
102 memset(&info, 0,
sizeof(info));
103 strncpy(info.
type, type, INTERFACE_TYPE_SIZE_ - 1);
104 strncpy(info.
id,
id, INTERFACE_ID_SIZE_ - 1);
105 memcpy(info.
hash, hash, INTERFACE_HASH_SIZE_);
106 info.
serial = htonl(serial);
113 interface_list->
append(&info,
sizeof(info));
125 memset(&info, 0,
sizeof(info));
126 strncpy(info.
type, iinfo.
type(), INTERFACE_TYPE_SIZE_ - 1);
127 strncpy(info.
id, iinfo.
id(), INTERFACE_ID_SIZE_ - 1);
128 memcpy(info.
hash, iinfo.
hash(), INTERFACE_HASH_SIZE_);
140 interface_list->
append(&info,
sizeof(info));
180 void *tmp = interface_list->
next(size);
void * _payload
Pointer to payload.
uint32_t serial
instance serial to uniquely identify this instance (big endian)
bool has_next()
Check if more list elements are available.
size_t _payload_size
Payloda size.
const char * type() const
Get interface type.
char type[INTERFACE_TYPE_SIZE_]
interface type name
int64_t timestamp_sec
data or write timestamp, sec part
Fawkes library namespace.
unsigned int num_readers() const
Get number of readers.
int64_t timestamp_usec
data or write timestamp, usec part
void * buffer()
Get pointer to buffer.
const unsigned char * hash() const
Get interface version hash.
bb_iinfo_msg_t * next(size_t *size)
Get next plugin from list.
bool has_writer() const
Check if there is a writer.
A class for handling time.
void reset_iterator()
Reset iterator.
unsigned int serial() const
Get interface instance serial.
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.
uint32_t writer_readers
combined writer reader information.
const char * id() const
Get interface ID.
virtual void * payload()
Return pointer to payload.
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.
char id[INTERFACE_ID_SIZE_]
interface instance ID
Dynamically growing buffer.
long get_usec() const
Get microseconds.
virtual size_t payload_size()
Return payload size.
unsigned char hash[INTERFACE_HASH_SIZE_]
interface version hash
void reset_iterator()
Reset iterator.
virtual ~BlackBoardInterfaceListContent()
Destructor.
void append(const void *data, size_t data_size)
Append data.
const Time * timestamp() const
Get interface timestamp.
void * next(size_t *size)
Get next buffer.
virtual void serialize()
Serialize message content.
BlackBoardInterfaceListContent()
Constructor.