Fawkes API
Fawkes Development Version
|
Config list content. More...
#include <>>
Public Member Functions | |
ConfigListContent () | |
Constructor. More... | |
ConfigListContent (unsigned int component_id, unsigned int msg_id, void *payload, size_t payload_size) | |
Message content constructor. More... | |
virtual | ~ConfigListContent () |
Destructor. More... | |
void | append_float (const char *path, float f, bool def_val=false) |
Append float value. More... | |
void | append_int (const char *path, int i, bool def_val=false) |
Append integer value. More... | |
void | append_uint (const char *path, unsigned int u, bool def_val=false) |
Append unsigned integer value. More... | |
void | append_bool (const char *path, bool b, bool def_val=false) |
Append boolean value. More... | |
void | append_string (const char *path, const char *s, bool def_val=false) |
Append string value. More... | |
void | append_comment (const char *path, const char *s, bool def_val=false) |
Append comment. More... | |
void | append (Configuration::ValueIterator *i) |
Append from iterator. More... | |
virtual void | serialize () |
Serialize message content. More... | |
void | reset_iterator () |
Reset iterator. More... | |
bool | has_next () |
Check if more list elements are available. More... | |
config_list_entity_header_t * | next (size_t *size) |
Get next plugin from list. More... | |
![]() | |
FawkesNetworkMessageContent () | |
Constructor. More... | |
virtual | ~FawkesNetworkMessageContent () |
Virtual empty destructor. More... | |
virtual void * | payload () |
Return pointer to payload. More... | |
virtual size_t | payload_size () |
Return payload size. More... | |
Additional Inherited Members | |
![]() | |
void | copy_payload (size_t offset, const void *buf, size_t len) |
Copy payload into payload buffer to a specified offset. More... | |
![]() | |
void * | _payload |
Pointer to payload. More... | |
size_t | _payload_size |
Payloda size. More... | |
Config list content.
A complex dynamic message with an arbitrary number of config entities. Uses DynamicBuffer for the internal list of plugins and thus the buffer is limited to 4 GB in total.
Definition at line 35 of file net_list_content.h.
fawkes::ConfigListContent::ConfigListContent | ( | ) |
Constructor.
Definition at line 44 of file net_list_content.cpp.
References fawkes::config_list_msg_t::config_list.
fawkes::ConfigListContent::ConfigListContent | ( | unsigned int | component_id, |
unsigned int | msg_id, | ||
void * | payload, | ||
size_t | payload_size | ||
) |
Message content constructor.
This constructor is meant to be used with FawkesNetworkMessage::msgc().
component_id | component ID |
msg_id | message ID |
payload | message payload |
payload_size | total payload size |
Definition at line 57 of file net_list_content.cpp.
References fawkes::config_list_msg_t::config_list.
|
virtual |
Destructor.
Definition at line 72 of file net_list_content.cpp.
References fawkes::FawkesNetworkMessageContent::_payload, and fawkes::FawkesNetworkMessageContent::_payload_size.
void fawkes::ConfigListContent::append | ( | Configuration::ValueIterator * | i | ) |
Append from iterator.
Appends the value the iterator points to.
i | iterator |
Definition at line 88 of file net_list_content.cpp.
References append_bool(), append_comment(), append_float(), append_int(), append_string(), append_uint(), fawkes::Configuration::ValueIterator::get_bool(), fawkes::Configuration::ValueIterator::get_comment(), fawkes::Configuration::ValueIterator::get_float(), fawkes::Configuration::ValueIterator::get_int(), fawkes::Configuration::ValueIterator::get_string(), fawkes::Configuration::ValueIterator::get_uint(), fawkes::Configuration::ValueIterator::is_bool(), fawkes::Configuration::ValueIterator::is_default(), fawkes::Configuration::ValueIterator::is_float(), fawkes::Configuration::ValueIterator::is_int(), fawkes::Configuration::ValueIterator::is_string(), fawkes::Configuration::ValueIterator::is_uint(), and fawkes::Configuration::ValueIterator::path().
Referenced by fawkes::ConfigNetworkHandler::loop().
void fawkes::ConfigListContent::append_bool | ( | const char * | path, |
bool | b, | ||
bool | def_val = false |
||
) |
Append boolean value.
path | of value |
b | boolean value |
def_val | true if this is a default value, false otherwise |
Definition at line 170 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_bool_entity_t::b, fawkes::config_list_entity_header_t::cp, fawkes::config_list_bool_entity_t::header, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, and fawkes::config_list_entity_header_t::type.
Referenced by append().
void fawkes::ConfigListContent::append_comment | ( | const char * | path, |
const char * | s, | ||
bool | def_val = false |
||
) |
Append comment.
path | of value |
s | comment |
def_val | true if this is a default value, false otherwise |
Definition at line 209 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_entity_header_t::cp, fawkes::config_list_comment_entity_t::header, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, fawkes::config_list_comment_entity_t::s, fawkes::config_list_comment_entity_t::s_length, and fawkes::config_list_entity_header_t::type.
Referenced by append().
void fawkes::ConfigListContent::append_float | ( | const char * | path, |
float | f, | ||
bool | def_val = false |
||
) |
Append float value.
path | of value |
f | float value |
def_val | true if this is a default value, false otherwise |
Definition at line 116 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_entity_header_t::cp, fawkes::config_list_float_entity_t::f, fawkes::config_list_float_entity_t::header, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, and fawkes::config_list_entity_header_t::type.
Referenced by append().
void fawkes::ConfigListContent::append_int | ( | const char * | path, |
int | i, | ||
bool | def_val = false |
||
) |
Append integer value.
path | of value |
i | integer value |
def_val | true if this is a default value, false otherwise |
Definition at line 134 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_entity_header_t::cp, fawkes::config_list_int_entity_t::header, fawkes::config_list_int_entity_t::i, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, and fawkes::config_list_entity_header_t::type.
Referenced by append().
void fawkes::ConfigListContent::append_string | ( | const char * | path, |
const char * | s, | ||
bool | def_val = false |
||
) |
Append string value.
path | of value |
s | string value |
def_val | true if this is a default value, false otherwise |
Definition at line 188 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_entity_header_t::cp, fawkes::config_list_string_entity_t::header, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, fawkes::config_list_string_entity_t::s, fawkes::config_list_string_entity_t::s_length, and fawkes::config_list_entity_header_t::type.
Referenced by append().
void fawkes::ConfigListContent::append_uint | ( | const char * | path, |
unsigned int | u, | ||
bool | def_val = false |
||
) |
Append unsigned integer value.
path | of value |
u | unsigned integer value |
def_val | true if this is a default value, false otherwise |
Definition at line 152 of file net_list_content.cpp.
References fawkes::DynamicBuffer::append(), fawkes::config_list_entity_header_t::cp, fawkes::config_list_uint_entity_t::header, fawkes::config_descriptor_t::is_default, fawkes::config_descriptor_t::path, fawkes::config_list_entity_header_t::type, and fawkes::config_list_uint_entity_t::u.
Referenced by append().
bool fawkes::ConfigListContent::has_next | ( | ) |
Check if more list elements are available.
For incoming messages only.
Definition at line 249 of file net_list_content.cpp.
References fawkes::DynamicBuffer::has_next().
Referenced by fawkes::NetworkConfiguration::inbound_received().
config_list_entity_header_t * fawkes::ConfigListContent::next | ( | size_t * | size | ) |
Get next plugin from list.
size | upon return contains the size of the returned data element. |
Definition at line 262 of file net_list_content.cpp.
References fawkes::DynamicBuffer::next().
Referenced by fawkes::NetworkConfiguration::inbound_received().
void fawkes::ConfigListContent::reset_iterator | ( | ) |
Reset iterator.
For incoming messages only.
Definition at line 238 of file net_list_content.cpp.
References fawkes::DynamicBuffer::reset_iterator().
|
virtual |
Serialize message content.
Generate a single contiguous buffer. Make _payload point to this buffer and _payload_size contain the size of the buffer.
Implements fawkes::FawkesNetworkMessageContent.
Definition at line 225 of file net_list_content.cpp.
References fawkes::FawkesNetworkMessageContent::_payload, fawkes::FawkesNetworkMessageContent::_payload_size, fawkes::DynamicBuffer::buffer(), fawkes::DynamicBuffer::buffer_size(), and fawkes::FawkesNetworkMessageContent::copy_payload().