24 #ifndef __INTERFACE_MESSAGE_H_ 25 #define __INTERFACE_MESSAGE_H_ 27 #include <interface/field_iterator.h> 28 #include <interface/types.h> 29 #include <core/utils/refcount.h> 31 #define __INTERFACE_MESSAGE_TYPE_SIZE 32 40 class InterfaceFieldIterator;
54 unsigned int id()
const;
55 void set_id(
unsigned int message_id);
63 const char *
type()
const;
73 unsigned int hops()
const;
85 template <
class MessageType>
89 unsigned int __message_id;
92 Time *__time_enqueued;
94 unsigned int recipient_interface_mem_serial;
95 unsigned int sender_interface_instance_serial;
98 char *_sender_thread_name;
99 unsigned int _sender_id;
105 unsigned int __num_fields;
112 size_t length,
void *value,
const char *enumtype = 0);
126 template <
class MessageType>
130 return (dynamic_cast<MessageType *>(
this) != 0);
Interface field iterator.
void * data_ptr
Pointer to memory that contains local data.
virtual Message * clone() const
Clone this message.
bool enqueued() const
Check is message has been enqueued.
unsigned int hops() const
Get number of hops.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void mark_enqueued()
Mark message as being enqueued.
Interface field info list.
const char * type() const
Get message type.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
unsigned int recipient() const
Get recipient memory serial.
A class for handling time.
unsigned int datasize() const
Get size of data.
unsigned int id() const
Get message ID.
Base class for all Fawkes BlackBoard interfaces.
InterfaceFieldIterator fields_end()
Invalid iterator.
message_data_ts_t * data_ts
data timestamp aliasing pointer
unsigned int data_size
Size of memory needed to hold all data.
Message(const char *type)
Constructor.
unsigned int num_fields() const
Get the number of fields in the message.
virtual ~Message()
Destructor.
const char * sender_thread_name() const
Get sender of message.
void set_from_chunk(const void *chunk)
Set from raw data chunk.
unsigned int sender_id() const
Get ID of sender.
int64_t timestamp_usec
additional time microseconds
Reference counting base class.
Interface * interface() const
Get transmitting interface.
InterfaceFieldIterator fields()
Get iterator over all fields of this interface instance.
bool is_of_type()
Check if message has desired type.
const Time * time_enqueued() const
Get time when message was enqueued.
int64_t timestamp_sec
time in seconds since Unix epoch
const void * datachunk() const
Get pointer to data.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0)
Add an entry to the info list.
void set_hops(unsigned int hops)
Set number of hops.
interface_fieldtype_t
Interface field type.
Message & operator=(const Message &m)
Assign this message to given message.
void set_id(unsigned int message_id)
Set message ID.