24 #include <config/net_list_content.h> 26 #include <netcomm/utils/dynamic_buffer.h> 27 #include <netcomm/fawkes/component_ids.h> 28 #include <core/exceptions/software.h> 61 if ( component_id != FAWKES_CID_CONFIGMANAGER ) {
65 void *config_list_payload = (
void *)((
size_t)payload +
sizeof(msg));
67 payload_size -
sizeof(msg));
92 }
else if ( i->
is_int() ) {
119 memset(&cle, 0,
sizeof(cle));
120 strncpy(cle.
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
124 config_list->
append(&cle,
sizeof(cle));
137 memset(&cle, 0,
sizeof(cle));
138 strncpy(cle.
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
142 config_list->
append(&cle,
sizeof(cle));
155 memset(&cle, 0,
sizeof(cle));
156 strncpy(cle.
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
160 config_list->
append(&cle,
sizeof(cle));
173 memset(&cle, 0,
sizeof(cle));
174 strncpy(cle.
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
178 config_list->
append(&cle,
sizeof(cle));
190 size_t s_length = strlen(s);
193 strncpy(cle->
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
198 config_list->
append(cle, sl);
211 size_t s_length = strlen(s);
214 strncpy(cle->
header.
cp.
path, path, CONFIG_MSG_PATH_LENGTH);
219 config_list->
append(cle, sl);
264 void *tmp = config_list->
next(size);
void * _payload
Pointer to payload.
virtual bool is_float() const =0
Check if current value is a float.
uint32_t is_default
1 if value is a default value, 0 otherwise, only for get response
size_t _payload_size
Payloda size.
void append(Configuration::ValueIterator *i)
Append from iterator.
Config list float entity.
virtual ~ConfigListContent()
Destructor.
virtual bool is_bool() const =0
Check if current value is a bool.
void append_float(const char *path, float f, bool def_val=false)
Append float value.
Fawkes library namespace.
config_list_entity_header_t * next(size_t *size)
Get next plugin from list.
void * buffer()
Get pointer to buffer.
char path[CONFIG_MSG_PATH_LENGTH]
path to config value.
virtual std::string get_string() const =0
Get string value.
config_list_entity_header_t header
config entity header
virtual bool is_string() const =0
Check if current value is a string.
config_list_entity_header_t header
config entity header
virtual bool is_uint() const =0
Check if current value is a unsigned int.
virtual float get_float() const =0
Get float value.
virtual const char * path() const =0
Path of value.
void append_bool(const char *path, bool b, bool def_val=false)
Append boolean value.
dynamic_list_t config_list
DynamicBuffer for list.
bool has_next()
Check if another element is available.
size_t buffer_size()
Get buffer size.
Config list unsigned int entity.
config_list_entity_header_t header
config entity header
virtual void serialize()
Serialize message content.
ConfigListContent()
Constructor.
bool has_next()
Check if more list elements are available.
virtual unsigned int get_uint() const =0
Get unsigned int value.
void append_uint(const char *path, unsigned int u, bool def_val=false)
Append unsigned integer value.
virtual bool is_int() const =0
Check if current value is a int.
virtual std::string get_comment() const =0
Get comment of value.
config_list_entity_header_t header
config entity header
virtual void * payload()
Return pointer to payload.
virtual bool get_bool() const =0
Get bool value.
void append_comment(const char *path, const char *s, bool def_val=false)
Append comment.
uint16_t s_length
length of following string value
void copy_payload(size_t offset, const void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
Dynamically growing buffer.
virtual size_t payload_size()
Return payload size.
void append_int(const char *path, int i, bool def_val=false)
Append integer value.
Iterator interface to iterate over config values.
void reset_iterator()
Reset iterator.
int32_t b
0 is false, everything else is true
void append(const void *data, size_t data_size)
Append data.
char s[2]
string value, 0-terminated
void append_string(const char *path, const char *s, bool def_val=false)
Append string value.
virtual bool is_default() const =0
Check if current value was read from the default config.
Config list string entity.
config_list_entity_header_t header
config entity header
void * next(size_t *size)
Get next buffer.
void reset_iterator()
Reset iterator.
virtual int get_int() const =0
Get int value.