Fawkes API
Fawkes Development Version
|
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);
bool has_writer() const
Check if there is a writer.
char type[INTERFACE_TYPE_SIZE_]
interface type name
void append(const void *data, size_t data_size)
Append data.
virtual void serialize()
Serialize message content.
int64_t timestamp_sec
data or write timestamp, sec part
long get_sec() const
Get seconds.
int64_t timestamp_usec
data or write timestamp, usec part
unsigned int serial() const
Get interface instance serial.
void reset_iterator()
Reset iterator.
bool has_next()
Check if another element is available.
Dynamically growing buffer.
virtual void * payload()
Return pointer to payload.
Message for interface info.
size_t _payload_size
Payloda size.
void * buffer()
Get pointer to buffer.
const unsigned char * hash() const
Get interface version hash.
size_t buffer_size()
Get buffer size.
void copy_payload(size_t offset, const void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
const char * id() const
Get interface ID.
unsigned int num_readers() const
Get number of readers.
uint32_t writer_readers
combined writer reader information.
BlackBoardInterfaceListContent()
Constructor.
bb_iinfo_msg_t * next(size_t *size)
Get next plugin from list.
char id[INTERFACE_ID_SIZE_]
interface instance ID
Fawkes library namespace.
Message to transport a list of interfaces.
void * _payload
Pointer to payload.
unsigned char hash[INTERFACE_HASH_SIZE_]
interface version hash
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.
bool has_next()
Check if more list elements are available.
A class for handling time.
void reset_iterator()
Reset iterator.
const Time * timestamp() const
Get interface timestamp.
virtual ~BlackBoardInterfaceListContent()
Destructor.
uint32_t serial
instance serial to uniquely identify this instance (big endian)
dynamic_list_t interface_list
dynamic buffer list with interface info
long get_usec() const
Get microseconds.
virtual size_t payload_size()
Return payload size.
const char * type() const
Get interface type.
void * next(size_t *size)
Get next buffer.