24 #include <interfaces/PclDatabaseRetrieveInterface.h> 26 #include <core/exceptions/software.h> 46 PclDatabaseRetrieveInterface::PclDatabaseRetrieveInterface() : Interface()
48 data_size =
sizeof(PclDatabaseRetrieveInterface_data_t);
50 data = (PclDatabaseRetrieveInterface_data_t *)
data_ptr;
57 unsigned char tmp_hash[] = {0x9d, 0xf8, 0x9d, 0x53, 0xd7, 0x74, 0xc1, 0x96, 0x38, 0x39, 0xd3, 0xee, 0x76, 0x54, 0x88, 0x75};
62 PclDatabaseRetrieveInterface::~PclDatabaseRetrieveInterface()
100 data->msgid = new_msgid;
137 data->final = new_final;
172 strncpy(data->error, new_error,
sizeof(data->error));
180 if ( strncmp(
"RetrieveMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
184 "message type for this interface type.", type);
200 memcpy(data, oi->data,
sizeof(PclDatabaseRetrieveInterface_data_t));
226 data_size =
sizeof(RetrieveMessage_data_t);
229 data = (RetrieveMessage_data_t *)
data_ptr;
231 data->timestamp = ini_timestamp;
232 strncpy(data->database, ini_database, 64);
233 strncpy(data->collection, ini_collection, 128);
234 strncpy(data->target_frame, ini_target_frame, 64);
235 data->original_timestamp = ini_original_timestamp;
245 data_size =
sizeof(RetrieveMessage_data_t);
248 data = (RetrieveMessage_data_t *)
data_ptr;
271 data = (RetrieveMessage_data_t *)
data_ptr;
285 return data->timestamp;
307 data->timestamp = new_timestamp;
320 return data->database;
343 strncpy(data->database, new_database,
sizeof(data->database));
356 return data->collection;
379 strncpy(data->collection, new_collection,
sizeof(data->collection));
395 return data->target_frame;
421 strncpy(data->target_frame, new_target_frame,
sizeof(data->target_frame));
434 return data->original_timestamp;
457 data->original_timestamp = new_original_timestamp;
void * data_ptr
Pointer to memory that contains local data.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
RetrieveMessage Fawkes BlackBoard Interface Message.
void set_final(const bool new_final)
Set final value.
void set_error(const char *new_error)
Set error value.
void set_target_frame(const char *new_target_frame)
Set target_frame value.
void set_hash(unsigned char *ihash)
Set hash.
PclDatabaseRetrieveInterface Fawkes BlackBoard Interface.
Fawkes library namespace.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
unsigned int data_size
Minimal data size to hold data storage.
RetrieveMessage()
Constructor.
char * error() const
Get error value.
void set_timestamp(const int64_t new_timestamp)
Set timestamp value.
Base class for all Fawkes BlackBoard interfaces.
size_t maxlenof_original_timestamp() const
Get maximum length of original_timestamp value.
uint32_t msgid() const
Get msgid value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
char * target_frame() const
Get target_frame value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the field info list.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
bool is_original_timestamp() const
Get original_timestamp value.
size_t maxlenof_final() const
Get maximum length of final value.
unsigned int data_size
Size of memory needed to hold all data.
void add_messageinfo(const char *name)
Add an entry to the message info list.
virtual Message * create_message(const char *type) const
Create message based on type name.
bool data_changed
Indicator if data has changed.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
const char * type() const
Get type of interface.
void * data_ptr
Pointer to local memory storage.
virtual void copy_values(const Interface *other)
Copy values from other interface.
char * database() const
Get database value.
void set_collection(const char *new_collection)
Set collection value.
virtual Message * clone() const
Clone this message.
char * collection() const
Get collection value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
bool is_final() const
Get final value.
size_t maxlenof_target_frame() const
Get maximum length of target_frame value.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
size_t maxlenof_error() const
Get maximum length of error value.
~RetrieveMessage()
Destructor.
void set_database(const char *new_database)
Set database value.
size_t maxlenof_database() const
Get maximum length of database value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
void set_original_timestamp(const bool new_original_timestamp)
Set original_timestamp value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
int64_t timestamp() const
Get timestamp value.
size_t maxlenof_timestamp() const
Get maximum length of timestamp value.
32 bit unsigned integer field
size_t maxlenof_collection() const
Get maximum length of collection value.