24 #ifndef __INTERFACES_SWITCHINTERFACE_H_ 25 #define __INTERFACES_SWITCHINTERFACE_H_ 27 #include <interface/interface.h> 28 #include <interface/message.h> 29 #include <interface/field_iterator.h> 43 typedef struct __attribute__((packed)) {
44 int64_t timestamp_sec;
45 int64_t timestamp_usec;
74 } SwitchInterface_data_t;
76 SwitchInterface_data_t *data;
84 typedef struct __attribute__((packed)) {
85 int64_t timestamp_sec;
86 int64_t timestamp_usec;
97 SetMessage_data_t *data;
100 SetMessage(
const bool ini_enabled,
const float ini_value);
112 virtual Message * clone()
const;
119 typedef struct __attribute__((packed)) {
120 int64_t timestamp_sec;
121 int64_t timestamp_usec;
122 } EnableSwitchMessage_data_t;
124 EnableSwitchMessage_data_t *data;
132 virtual Message * clone()
const;
139 typedef struct __attribute__((packed)) {
140 int64_t timestamp_sec;
141 int64_t timestamp_usec;
142 } DisableSwitchMessage_data_t;
144 DisableSwitchMessage_data_t *data;
152 virtual Message * clone()
const;
159 typedef struct __attribute__((packed)) {
160 int64_t timestamp_sec;
161 int64_t timestamp_usec;
169 } EnableDurationMessage_data_t;
171 EnableDurationMessage_data_t *data;
180 float duration()
const;
181 void set_duration(
const float new_duration);
182 size_t maxlenof_duration()
const;
186 virtual Message * clone()
const;
217 virtual const char *
enum_tostring(
const char *enumtype,
int val)
const;
Base class for all messages passed through interfaces in Fawkes BlackBoard.
SetMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_long_activations() const
Get maximum length of long_activations value.
Fawkes library namespace.
size_t maxlenof_history() const
Get maximum length of history value.
uint32_t short_activations() const
Get short_activations value.
uint32_t activation_count() const
Get activation_count value.
void set_history(const float new_history)
Set history value.
uint32_t long_activations() const
Get long_activations value.
Base class for all Fawkes BlackBoard interfaces.
void set_short_activations(const uint32_t new_short_activations)
Set short_activations value.
float value() const
Get value value.
virtual Message * create_message(const char *type) const
Create message based on type name.
SwitchInterface Fawkes BlackBoard Interface.
const char * type() const
Get type of interface.
void set_activation_count(const uint32_t new_activation_count)
Set activation_count value.
void set_enabled(const bool new_enabled)
Set enabled value.
DisableSwitchMessage Fawkes BlackBoard Interface Message.
float history() const
Get history value.
bool is_enabled() const
Get enabled value.
size_t maxlenof_value() const
Get maximum length of value value.
void set_long_activations(const uint32_t new_long_activations)
Set long_activations value.
size_t maxlenof_activation_count() const
Get maximum length of activation_count value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
EnableSwitchMessage Fawkes BlackBoard Interface Message.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
void set_value(const float new_value)
Set value value.
EnableDurationMessage Fawkes BlackBoard Interface Message.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_short_activations() const
Get maximum length of short_activations value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.