Fawkes API  Fawkes Development Version
fawkes::NetworkConfiguration Class Reference

Remote configuration via Fawkes net. More...

#include <>>

Inheritance diagram for fawkes::NetworkConfiguration:

Classes

class  NetConfValueIterator
 Network configuration value iterator. More...
 

Public Member Functions

 NetworkConfiguration (FawkesNetworkClient *c, unsigned int mirror_timeout_sec=15)
 Constructor. More...
 
virtual ~NetworkConfiguration ()
 Destructor. More...
 
virtual void copy (Configuration *copyconf)
 Copy all values from the given configuration. More...
 
virtual void add_change_handler (ConfigurationChangeHandler *h)
 Add a configuration change handler. More...
 
virtual void rem_change_handler (ConfigurationChangeHandler *h)
 Remove a configuration change handler. More...
 
virtual void load (const char *file_path)
 Load configuration. More...
 
virtual bool exists (const char *path)
 Check if a given value exists. More...
 
virtual bool is_float (const char *path)
 Check if a value is of type float. More...
 
virtual bool is_uint (const char *path)
 Check if a value is of type unsigned int. More...
 
virtual bool is_int (const char *path)
 Check if a value is of type int. More...
 
virtual bool is_bool (const char *path)
 Check if a value is of type bool. More...
 
virtual bool is_string (const char *path)
 Check if a value is of type string. More...
 
virtual bool is_list (const char *path)
 Check if a value is a list. More...
 
virtual bool is_default (const char *path)
 Check if a value was read from the default config. More...
 
virtual float get_float (const char *path)
 Get value from configuration which is of type float. More...
 
virtual unsigned int get_uint (const char *path)
 Get value from configuration which is of type unsigned int. More...
 
virtual int get_int (const char *path)
 Get value from configuration which is of type int. More...
 
virtual bool get_bool (const char *path)
 Get value from configuration which is of type bool. More...
 
virtual std::string get_string (const char *path)
 Get value from configuration which is of type string. More...
 
virtual std::vector< float > get_floats (const char *path)
 Get list of values from configuration which is of type float. More...
 
virtual std::vector< unsigned int > get_uints (const char *path)
 Get list of values from configuration which is of type unsigned int. More...
 
virtual std::vector< int > get_ints (const char *path)
 Get list of values from configuration which is of type int. More...
 
virtual std::vector< bool > get_bools (const char *path)
 Get list of values from configuration which is of type bool. More...
 
virtual std::vector< std::string > get_strings (const char *path)
 Get list of values from configuration which is of type string. More...
 
virtual ValueIteratorget_value (const char *path)
 Get value from configuration. More...
 
virtual std::string get_comment (const char *path)
 Get comment of value at given path. More...
 
virtual std::string get_default_comment (const char *path)
 Get comment of value at given path. More...
 
virtual std::string get_type (const char *path)
 Get type of field. More...
 
virtual void set_float (const char *path, float f)
 Set new value in configuration of type float. More...
 
virtual void set_uint (const char *path, unsigned int uint)
 Set new value in configuration of type unsigned int. More...
 
virtual void set_int (const char *path, int i)
 Set new value in configuration of type int. More...
 
virtual void set_bool (const char *path, bool b)
 Set new value in configuration of type bool. More...
 
virtual void set_string (const char *path, std::string &s)
 Set new value in configuration of type string. More...
 
virtual void set_string (const char *path, const char *s)
 Set new value in configuration of type string. More...
 
virtual void set_floats (const char *path, std::vector< float > &f)
 Set new value in configuration of type float. More...
 
virtual void set_uints (const char *path, std::vector< unsigned int > &uint)
 Set new value in configuration of type unsigned int. More...
 
virtual void set_ints (const char *path, std::vector< int > &i)
 Set new value in configuration of type int. More...
 
virtual void set_bools (const char *path, std::vector< bool > &b)
 Set new value in configuration of type bool. More...
 
virtual void set_strings (const char *path, std::vector< std::string > &s)
 Set new value in configuration of type string. More...
 
virtual void set_strings (const char *path, std::vector< const char * > &s)
 Set new value in configuration of type string. More...
 
virtual void set_comment (const char *path, std::string &comment)
 Set new comment for existing value. More...
 
virtual void set_comment (const char *path, const char *comment)
 Set new comment for existing value. More...
 
virtual void erase (const char *path)
 Erase the given value from the configuration. More...
 
virtual void set_default_float (const char *path, float f)
 Set new default value in configuration of type float. More...
 
virtual void set_default_uint (const char *path, unsigned int uint)
 Set new default value in configuration of type unsigned int. More...
 
virtual void set_default_int (const char *path, int i)
 Set new default value in configuration of type int. More...
 
virtual void set_default_bool (const char *path, bool b)
 Set new default value in configuration of type bool. More...
 
virtual void set_default_string (const char *path, std::string &s)
 Set new default value in configuration of type string. More...
 
virtual void set_default_string (const char *path, const char *s)
 Set new default value in configuration of type string. More...
 
virtual void set_default_comment (const char *path, std::string &comment)
 Set new default comment for existing default configuration value. More...
 
virtual void set_default_comment (const char *path, const char *comment)
 Set new default comment for existing default configuration value. More...
 
virtual void erase_default (const char *path)
 Erase the given default value from the configuration. More...
 
virtual void deregistered (unsigned int id) throw ()
 We are no longer registered in Fawkes network client. More...
 
virtual void inbound_received (FawkesNetworkMessage *msg, unsigned int id) throw ()
 Called for incoming messages. More...
 
virtual void connection_died (unsigned int id) throw ()
 Client connection died. More...
 
virtual void connection_established (unsigned int id) throw ()
 Client has established a connection. More...
 
virtual void set_mirror_mode (bool mirror)
 Enable or disable mirror mode. More...
 
ValueIteratoriterator ()
 Iterator for all values. More...
 
ValueIteratoriterator_default ()
 Iterator for all default values. More...
 
ValueIteratoriterator_hostspecific ()
 Iterator for all host-specific values. More...
 
ValueIteratorsearch (const char *path)
 Iterator with search results. More...
 
void lock ()
 Lock the config. More...
 
bool try_lock ()
 Try to lock the config. More...
 
void unlock ()
 Unlock the config. More...
 
virtual void try_dump ()
 Try to dump configuration. More...
 
- Public Member Functions inherited from fawkes::Configuration
virtual ~Configuration ()
 Virtual empty destructor. More...
 
virtual float get_float_or_default (const char *path, const float &default_val)
 Get value from configuration which is of type float, or the given default if the path does not exist. More...
 
virtual unsigned int get_uint_or_default (const char *path, const unsigned int &default_val)
 Get value from configuration which is of type unsigned int, or the given default if the path does not exist. More...
 
virtual int get_int_or_default (const char *path, const int &default_val)
 Get value from configuration which is of type int, or the given default if the path does not exist. More...
 
virtual bool get_bool_or_default (const char *path, const bool &default_val)
 Get value from configuration which is of type bool, or the given default if the path does not exist. More...
 
virtual std::string get_string_or_default (const char *path, const std::string &default_val)
 Get value from configuration which is of type string, or the given default if the path does not exist. More...
 
virtual std::vector< float > get_floats_or_defaults (const char *path, const std::vector< float > &default_val)
 Get list of values from configuration which is of type float, or the given default if the path does not exist. More...
 
virtual std::vector< unsigned int > get_uints_or_defaults (const char *path, const std::vector< unsigned int > &default_val)
 Get list of values from configuration which is of type unsigned int, or the given default if the path does not exist. More...
 
virtual std::vector< int > get_ints_or_defaults (const char *path, const std::vector< int > &default_val)
 Get list of values from configuration which is of type int, or the given default if the path does not exist. More...
 
virtual std::vector< bool > get_bools_or_defaults (const char *path, const std::vector< bool > &default_val)
 Get list of values from configuration which is of type bool, or the given default if the path does not exist. More...
 
virtual std::vector< std::string > get_strings_or_defaults (const char *path, const std::vector< std::string > &default_val)
 Get list of values from configuration which is of type string, or the given default if the path does not exist. More...
 
- Public Member Functions inherited from fawkes::FawkesNetworkClientHandler
virtual ~FawkesNetworkClientHandler ()
 Empty virtual destructor. More...
 

Additional Inherited Members

- Protected Types inherited from fawkes::Configuration
typedef std::list< ConfigurationChangeHandler * > ChangeHandlerList
 List that contains pointers to ConfigurationChangeHandler. More...
 
typedef std::multimap< const char *, ConfigurationChangeHandler *, StringLessChangeHandlerMultimap
 Multimap string to config change handlers. More...
 
typedef std::pair< ChangeHandlerMultimap::iterator, ChangeHandlerMultimap::iterator > ChangeHandlerMultimapRange
 Config change handler multimap range. More...
 
- Protected Member Functions inherited from fawkes::Configuration
ChangeHandlerListfind_handlers (const char *path)
 Find handlers for given path. More...
 
void notify_handlers (const char *path, bool comment_changed=false)
 Notify handlers for given path. More...
 
- Protected Attributes inherited from fawkes::Configuration
ChangeHandlerMultimap _change_handlers
 Registered change handlers. More...
 
ChangeHandlerMultimapRange _ch_range
 Change handler range. More...
 

Detailed Description

Remote configuration via Fawkes net.

This implementation of the Configuration interface allows for remote access to a Fawkes process implemented using the ConfigurationManager.

The network configuration can operator in two modes. In mirror and in non-mirror mode. The non-mirror mode is recommended if only a few operations have to be carried out like getting only a very few values or setting a single value. The mirror mode is for longer usage periods and on-the-fly updates. In mirror mode the complete configuration is copied once from the Fawkes process and then all updates are incorporated into the local database. You can register change handlers to be notified as soon as someone modifies a value.

Definition at line 49 of file netconf.h.

Constructor & Destructor Documentation

◆ NetworkConfiguration()

fawkes::NetworkConfiguration::NetworkConfiguration ( FawkesNetworkClient c,
unsigned int  mirror_timeout_sec = 15 
)

Constructor.

Parameters
cFawkes network client (thread).
mirror_timeout_sectimeout in seconds for initiating mirroring

Definition at line 75 of file netconf.cpp.

References fawkes::Exception::append(), fawkes::FawkesNetworkClient::connected(), and fawkes::FawkesNetworkClient::register_handler().

◆ ~NetworkConfiguration()

fawkes::NetworkConfiguration::~NetworkConfiguration ( )
virtual

Member Function Documentation

◆ add_change_handler()

void fawkes::NetworkConfiguration::add_change_handler ( ConfigurationChangeHandler h)
virtual

Add a configuration change handler.

The added handler is called whenever a value changes and the handler desires to get notified for the given component.

Parameters
hconfiguration change handler

Reimplemented from fawkes::Configuration.

Definition at line 1247 of file netconf.cpp.

References fawkes::Configuration::add_change_handler().

◆ connection_died()

void fawkes::NetworkConfiguration::connection_died ( unsigned int  id)
throw (
)
virtual

Client connection died.

This method is used to inform handlers that the connection has died for any reason. No more data can be send and no more messages should be enqueued because it is unclear when they would be sent.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 1231 of file netconf.cpp.

◆ connection_established()

void fawkes::NetworkConfiguration::connection_established ( unsigned int  id)
throw (
)
virtual

Client has established a connection.

Whenever the client establishes a connection this is signaled to handlers with this method. You can register to a client at any time, you may even enqueue messages to a client while the connection is dead. If the client at some point gets connected again, the messages will then be send out in one go. You should use this in your application though to only send data if the connection is alive and you should let the user know about the connection status.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 1240 of file netconf.cpp.

◆ copy()

◆ deregistered()

void fawkes::NetworkConfiguration::deregistered ( unsigned int  id)
throw (
)
virtual

We are no longer registered in Fawkes network client.

Ignored.

Parameters
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 921 of file netconf.cpp.

◆ erase()

void fawkes::NetworkConfiguration::erase ( const char *  path)
virtual

Erase the given value from the configuration.

It is not an error if the value does not exists before deletion.

Parameters
pathpath to value

Implements fawkes::Configuration.

Definition at line 905 of file netconf.cpp.

◆ erase_default()

void fawkes::NetworkConfiguration::erase_default ( const char *  path)
virtual

Erase the given default value from the configuration.

It is not an error if the value does not exists before deletion.

Parameters
pathpath to value

Implements fawkes::Configuration.

Definition at line 911 of file netconf.cpp.

◆ exists()

bool fawkes::NetworkConfiguration::exists ( const char *  path)
virtual

Check if a given value exists.

Parameters
pathpath to value
Returns
true if the value exists, false otherwise

Implements fawkes::Configuration.

Definition at line 143 of file netconf.cpp.

References get_value(), and fawkes::Configuration::ValueIterator::valid().

◆ get_bool()

bool fawkes::NetworkConfiguration::get_bool ( const char *  path)
virtual

◆ get_bools()

std::vector< bool > fawkes::NetworkConfiguration::get_bools ( const char *  path)
virtual

Get list of values from configuration which is of type bool.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 537 of file netconf.cpp.

◆ get_comment()

std::string fawkes::NetworkConfiguration::get_comment ( const char *  path)
virtual

Get comment of value at given path.

The value at the given path must exist in the host-specific configuration.

Parameters
pathpath to value
Returns
comment
Exceptions
ConfigEntryNotFoundExceptionshall be thrown if value does not exist
ConfigurationExceptionshall be thrown on any other error

Implements fawkes::Configuration.

Definition at line 549 of file netconf.cpp.

References fawkes::Exception::append(), fawkes::MemoryConfiguration::get_comment(), fawkes::Mutex::lock(), fawkes::FawkesNetworkMessage::msgge(), fawkes::config_comment_msg_t::s, fawkes::Mutex::unlock(), and fawkes::RefCount::unref().

◆ get_default_comment()

std::string fawkes::NetworkConfiguration::get_default_comment ( const char *  path)
virtual

Get comment of value at given path.

The value at the given path must exist in the default configuration.

Parameters
pathpath to value
Returns
comment
Exceptions
ConfigEntryNotFoundExceptionshall be thrown if value does not exist
ConfigurationExceptionshall be thrown on any other error

Implements fawkes::Configuration.

Definition at line 598 of file netconf.cpp.

References fawkes::Exception::append(), fawkes::MemoryConfiguration::get_default_comment(), fawkes::Mutex::lock(), fawkes::FawkesNetworkMessage::msgge(), fawkes::config_comment_msg_t::s, fawkes::Mutex::unlock(), and fawkes::RefCount::unref().

◆ get_float()

◆ get_floats()

std::vector< float > fawkes::NetworkConfiguration::get_floats ( const char *  path)
virtual

Get list of values from configuration which is of type float.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 519 of file netconf.cpp.

◆ get_int()

int fawkes::NetworkConfiguration::get_int ( const char *  path)
virtual

◆ get_ints()

std::vector< int > fawkes::NetworkConfiguration::get_ints ( const char *  path)
virtual

Get list of values from configuration which is of type int.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 531 of file netconf.cpp.

◆ get_string()

std::string fawkes::NetworkConfiguration::get_string ( const char *  path)
virtual

◆ get_strings()

std::vector< std::string > fawkes::NetworkConfiguration::get_strings ( const char *  path)
virtual

Get list of values from configuration which is of type string.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 543 of file netconf.cpp.

◆ get_type()

std::string fawkes::NetworkConfiguration::get_type ( const char *  path)
virtual

Get type of field.

Parameters
pathpath
Returns
string of type

Implements fawkes::Configuration.

Definition at line 165 of file netconf.cpp.

References fawkes::MemoryConfiguration::get_type(), get_value(), fawkes::Mutex::lock(), fawkes::Configuration::ValueIterator::type(), and fawkes::Mutex::unlock().

Referenced by is_bool(), is_float(), is_int(), is_string(), and is_uint().

◆ get_uint()

unsigned int fawkes::NetworkConfiguration::get_uint ( const char *  path)
virtual

◆ get_uints()

std::vector< unsigned int > fawkes::NetworkConfiguration::get_uints ( const char *  path)
virtual

Get list of values from configuration which is of type unsigned int.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 525 of file netconf.cpp.

◆ get_value()

Configuration::ValueIterator * fawkes::NetworkConfiguration::get_value ( const char *  path)
virtual

Get value from configuration.

Parameters
pathpath to value
Returns
value iterator for just this one value, maybe invalid if value does not exists.

Implements fawkes::Configuration.

Definition at line 648 of file netconf.cpp.

References fawkes::Exception::append(), fawkes::config_getval_msg_t::cp, fawkes::FawkesNetworkClient::enqueue_and_wait(), fawkes::MemoryConfiguration::get_value(), fawkes::Mutex::lock(), fawkes::config_descriptor_t::path, fawkes::Mutex::unlock(), and fawkes::RefCount::unref().

Referenced by exists(), get_type(), and is_default().

◆ inbound_received()

void fawkes::NetworkConfiguration::inbound_received ( FawkesNetworkMessage m,
unsigned int  id 
)
throw (
)
virtual

Called for incoming messages.

This is called when an incoming message has been received. If this method was called one or more times then the a previously carried out wait(cid) call will continue.

Parameters
mMessage to handle
idthe id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 926 of file netconf.cpp.

References fawkes::config_value_erased_msg_t::cp, fawkes::config_comment_msg_t::cp, fawkes::config_list_entity_header_t::cp, fawkes::ConfigListContent::has_next(), fawkes::config_descriptor_t::is_default, fawkes::LibLogger::log_warn(), fawkes::ConfigListContent::next(), fawkes::config_descriptor_t::num_values, fawkes::config_descriptor_t::path, fawkes::config_comment_msg_t::s, fawkes::config_string_value_t::s_length, and fawkes::config_list_entity_header_t::type.

◆ is_bool()

bool fawkes::NetworkConfiguration::is_bool ( const char *  path)
virtual

Check if a value is of type bool.

Parameters
pathpath to value
Returns
true if the value exists and is of type bool

Implements fawkes::Configuration.

Definition at line 200 of file netconf.cpp.

References get_type().

◆ is_default()

bool fawkes::NetworkConfiguration::is_default ( const char *  path)
virtual

Check if a value was read from the default config.

Parameters
pathpath to value
Returns
true if the value exists and is only stored in the default config

Implements fawkes::Configuration.

Definition at line 152 of file netconf.cpp.

References get_value(), and fawkes::Configuration::ValueIterator::is_default().

◆ is_float()

bool fawkes::NetworkConfiguration::is_float ( const char *  path)
virtual

Check if a value is of type float.

Parameters
pathpath to value
Returns
true if the value exists and is of type float

Implements fawkes::Configuration.

Definition at line 182 of file netconf.cpp.

References get_type().

◆ is_int()

bool fawkes::NetworkConfiguration::is_int ( const char *  path)
virtual

Check if a value is of type int.

Parameters
pathpath to value
Returns
true if the value exists and is of type int

Implements fawkes::Configuration.

Definition at line 194 of file netconf.cpp.

References get_type().

◆ is_list()

bool fawkes::NetworkConfiguration::is_list ( const char *  path)
virtual

Check if a value is a list.

Parameters
pathpath to value
Returns
true if the value exists and is a list

Implements fawkes::Configuration.

Definition at line 212 of file netconf.cpp.

◆ is_string()

bool fawkes::NetworkConfiguration::is_string ( const char *  path)
virtual

Check if a value is of type string.

Parameters
pathpath to value
Returns
true if the value exists and is of type string

Implements fawkes::Configuration.

Definition at line 206 of file netconf.cpp.

References get_type().

◆ is_uint()

bool fawkes::NetworkConfiguration::is_uint ( const char *  path)
virtual

Check if a value is of type unsigned int.

Parameters
pathpath to value
Returns
true if the value exists and is of type unsigned int

Implements fawkes::Configuration.

Definition at line 188 of file netconf.cpp.

References get_type().

◆ iterator()

Configuration::ValueIterator * fawkes::NetworkConfiguration::iterator ( )
virtual

Iterator for all values.

Returns an iterator that can be used to iterate over all values in the current configuration, it will value the overlay. If a default and a host-specific value exists you will only see the host-specific value.

Returns
iterator over all values

Implements fawkes::Configuration.

Definition at line 1340 of file netconf.cpp.

References fawkes::MemoryConfiguration::iterator().

◆ iterator_default()

Configuration::ValueIterator * fawkes::NetworkConfiguration::iterator_default ( )

Iterator for all default values.

Returns an iterator that can be used to iterate over all default values in the current default configuration. Note that this might return less paths than available, because the values for which no default entry exists are not returned.

Returns
iterator over all default values

Definition at line 1357 of file netconf.cpp.

References fawkes::MemoryConfiguration::iterator_default().

◆ iterator_hostspecific()

Configuration::ValueIterator * fawkes::NetworkConfiguration::iterator_hostspecific ( )

Iterator for all host-specific values.

Returns an iterator that can be used to iterate over all host-specific values in the current configuration. Note that this might return less paths than available, because the default values for which no host-specific entry exists are not returned.

Returns
iterator over all host-specific values

Definition at line 1374 of file netconf.cpp.

References fawkes::MemoryConfiguration::iterator_hostspecific().

◆ load()

void fawkes::NetworkConfiguration::load ( const char *  file_path)
virtual

Load configuration.

Loads configuration data, or opens a file, depending on the implementation. After this call access to all other methods shall be possible.

Parameters
file_pathpath of the configuration file.

Implements fawkes::Configuration.

Definition at line 108 of file netconf.cpp.

◆ lock()

void fawkes::NetworkConfiguration::lock ( )
virtual

Lock the config.

No further changes or queries can be executed on the configuration and will block until the config is unlocked.

Implements fawkes::Configuration.

Definition at line 1317 of file netconf.cpp.

References fawkes::Mutex::lock().

◆ rem_change_handler()

void fawkes::NetworkConfiguration::rem_change_handler ( ConfigurationChangeHandler h)
virtual

Remove a configuration change handler.

The handler is removed from the change handler list and no longer called on config changes.

Parameters
hconfiguration change handler

Reimplemented from fawkes::Configuration.

Definition at line 1257 of file netconf.cpp.

References fawkes::Configuration::rem_change_handler().

◆ search()

Configuration::ValueIterator * fawkes::NetworkConfiguration::search ( const char *  path)
virtual

Iterator with search results.

Returns an iterator that can be used to iterate over the search results. All values whose path start with the given strings are returned. A call like

config->search("");
virtual ValueIterator * search(const char *path)=0
Iterator with search results.

is effectively the same as a call to iterator().

Parameters
pathstart of path
Returns
iterator to search results

Implements fawkes::Configuration.

Definition at line 1384 of file netconf.cpp.

References fawkes::MemoryConfiguration::search().

◆ set_bool()

void fawkes::NetworkConfiguration::set_bool ( const char *  path,
bool  b 
)
virtual

Set new value in configuration of type bool.

Parameters
pathpath to value
bnew bool value

Implements fawkes::Configuration.

Definition at line 767 of file netconf.cpp.

Referenced by copy().

◆ set_bools()

void fawkes::NetworkConfiguration::set_bools ( const char *  path,
std::vector< bool > &  b 
)
virtual

Set new value in configuration of type bool.

Parameters
pathpath to value
bnew bool values

Implements fawkes::Configuration.

Definition at line 840 of file netconf.cpp.

◆ set_comment() [1/2]

void fawkes::NetworkConfiguration::set_comment ( const char *  path,
const char *  comment 
)
virtual

Set new comment for existing value.

Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 858 of file netconf.cpp.

◆ set_comment() [2/2]

void fawkes::NetworkConfiguration::set_comment ( const char *  path,
std::string &  comment 
)
virtual

Set new comment for existing value.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 868 of file netconf.cpp.

◆ set_default_bool()

void fawkes::NetworkConfiguration::set_default_bool ( const char *  path,
bool  b 
)
virtual

Set new default value in configuration of type bool.

Parameters
pathpath to value
bnew bool value

Implements fawkes::Configuration.

Definition at line 774 of file netconf.cpp.

◆ set_default_comment() [1/2]

void fawkes::NetworkConfiguration::set_default_comment ( const char *  path,
const char *  comment 
)
virtual

Set new default comment for existing default configuration value.

Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 863 of file netconf.cpp.

◆ set_default_comment() [2/2]

void fawkes::NetworkConfiguration::set_default_comment ( const char *  path,
std::string &  comment 
)
virtual

Set new default comment for existing default configuration value.

Parameters
pathpath to value
commentnew comment string

Implements fawkes::Configuration.

Definition at line 873 of file netconf.cpp.

◆ set_default_float()

void fawkes::NetworkConfiguration::set_default_float ( const char *  path,
float  f 
)
virtual

Set new default value in configuration of type float.

Parameters
pathpath to value
fnew float value

Implements fawkes::Configuration.

Definition at line 737 of file netconf.cpp.

◆ set_default_int()

void fawkes::NetworkConfiguration::set_default_int ( const char *  path,
int  i 
)
virtual

Set new default value in configuration of type int.

Parameters
pathpath to value
inew int value

Implements fawkes::Configuration.

Definition at line 761 of file netconf.cpp.

◆ set_default_string() [1/2]

void fawkes::NetworkConfiguration::set_default_string ( const char *  path,
const char *  s 
)
virtual

Set new default value in configuration of type string.

Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 796 of file netconf.cpp.

References fawkes::config_string_value_t::s_length.

◆ set_default_string() [2/2]

void fawkes::NetworkConfiguration::set_default_string ( const char *  path,
std::string &  s 
)
virtual

Set new default value in configuration of type string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 816 of file netconf.cpp.

◆ set_default_uint()

void fawkes::NetworkConfiguration::set_default_uint ( const char *  path,
unsigned int  uint 
)
virtual

Set new default value in configuration of type unsigned int.

Parameters
pathpath to value
uintnew unsigned int value

Implements fawkes::Configuration.

Definition at line 749 of file netconf.cpp.

◆ set_float()

void fawkes::NetworkConfiguration::set_float ( const char *  path,
float  f 
)
virtual

Set new value in configuration of type float.

Parameters
pathpath to value
fnew float value

Implements fawkes::Configuration.

Definition at line 731 of file netconf.cpp.

Referenced by PitchCalibration::calibrate(), RollCalibration::calibrate(), TimeOffsetCalibration::calibrate(), YawCalibration::calibrate(), and copy().

◆ set_floats()

void fawkes::NetworkConfiguration::set_floats ( const char *  path,
std::vector< float > &  f 
)
virtual

Set new value in configuration of type float.

Parameters
pathpath to value
fnew float values

Implements fawkes::Configuration.

Definition at line 822 of file netconf.cpp.

◆ set_int()

void fawkes::NetworkConfiguration::set_int ( const char *  path,
int  i 
)
virtual

Set new value in configuration of type int.

Parameters
pathpath to value
inew int value

Implements fawkes::Configuration.

Definition at line 755 of file netconf.cpp.

Referenced by copy().

◆ set_ints()

void fawkes::NetworkConfiguration::set_ints ( const char *  path,
std::vector< int > &  i 
)
virtual

Set new value in configuration of type int.

Parameters
pathpath to value
inew int values

Implements fawkes::Configuration.

Definition at line 834 of file netconf.cpp.

◆ set_mirror_mode()

void fawkes::NetworkConfiguration::set_mirror_mode ( bool  mirror)
virtual

Enable or disable mirror mode.

Parameters
mirrortrue to enable mirror mode, false to disable

Definition at line 1269 of file netconf.cpp.

References fawkes::FawkesNetworkClient::enqueue(), fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::InterruptibleBarrier::wait().

Referenced by ~NetworkConfiguration().

◆ set_string() [1/2]

void fawkes::NetworkConfiguration::set_string ( const char *  path,
const char *  s 
)
virtual

Set new value in configuration of type string.

Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 781 of file netconf.cpp.

References fawkes::config_string_value_t::s_length.

◆ set_string() [2/2]

void fawkes::NetworkConfiguration::set_string ( const char *  path,
std::string &  s 
)
virtual

Set new value in configuration of type string.

Parameters
pathpath to value
snew string value

Implements fawkes::Configuration.

Definition at line 810 of file netconf.cpp.

Referenced by copy().

◆ set_strings() [1/2]

void fawkes::NetworkConfiguration::set_strings ( const char *  path,
std::vector< const char * > &  s 
)
virtual

Set new value in configuration of type string.

Works like the aforementioned method. Just takes an good ol' char array instead of a std::string.

Parameters
pathpath to value
snew string values

Implements fawkes::Configuration.

Definition at line 852 of file netconf.cpp.

◆ set_strings() [2/2]

void fawkes::NetworkConfiguration::set_strings ( const char *  path,
std::vector< std::string > &  s 
)
virtual

Set new value in configuration of type string.

Parameters
pathpath to value
snew string values

Implements fawkes::Configuration.

Definition at line 846 of file netconf.cpp.

◆ set_uint()

void fawkes::NetworkConfiguration::set_uint ( const char *  path,
unsigned int  uint 
)
virtual

Set new value in configuration of type unsigned int.

Parameters
pathpath to value
uintnew unsigned int value

Implements fawkes::Configuration.

Definition at line 743 of file netconf.cpp.

Referenced by copy().

◆ set_uints()

void fawkes::NetworkConfiguration::set_uints ( const char *  path,
std::vector< unsigned int > &  uint 
)
virtual

Set new value in configuration of type unsigned int.

Parameters
pathpath to value
uintnew unsigned int values

Implements fawkes::Configuration.

Definition at line 828 of file netconf.cpp.

◆ try_dump()

void fawkes::NetworkConfiguration::try_dump ( )
virtual

Try to dump configuration.

For configuration methods that transform configuration files in a binary format this can be used to write out the text representation on shutdown of Fawkes.

Exceptions
Exceptionthrown if dumping fails

Implements fawkes::Configuration.

Definition at line 1335 of file netconf.cpp.

◆ try_lock()

bool fawkes::NetworkConfiguration::try_lock ( )
virtual

Try to lock the config.

See also
Configuration::lock()
Returns
true, if the lock has been aquired, false otherwise

Implements fawkes::Configuration.

Definition at line 1323 of file netconf.cpp.

References fawkes::Mutex::try_lock().

◆ unlock()

void fawkes::NetworkConfiguration::unlock ( )
virtual

Unlock the config.

Modifications and queries are possible again.

Implements fawkes::Configuration.

Definition at line 1329 of file netconf.cpp.

References fawkes::Mutex::unlock().


The documentation for this class was generated from the following files: