Fawkes API Fawkes Development Version
fawkes::MemoryConfiguration Class Reference

In-memory configuration store. More...

#include <>>

Inheritance diagram for fawkes::MemoryConfiguration:

Public Member Functions

 MemoryConfiguration ()
 Constructor. More...
 
virtual ~MemoryConfiguration ()
 Destructor. More...
 
virtual void copy (Configuration *copyconf)
 Copies all values from the given configuration. 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 std::string get_type (const char *path)
 Get type of value at given path. 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 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, const char *comment)
 Set new default comment for existing default configuration value. More...
 
virtual void set_default_comment (const char *path, std::string &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...
 
ValueIteratoriterator ()
 Iterator for all values. More...
 
ValueIteratoriterator_default ()
 Get iterator over default values. More...
 
ValueIteratoriterator_hostspecific ()
 Get iterator over 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 void copy (Configuration *copyconf)=0
 Copies 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)=0
 Load configuration. More...
 
virtual bool exists (const char *path)=0
 Check if a given value exists. More...
 
virtual bool is_float (const char *path)=0
 Check if a value is of type float. More...
 
virtual bool is_uint (const char *path)=0
 Check if a value is of type unsigned int. More...
 
virtual bool is_int (const char *path)=0
 Check if a value is of type int. More...
 
virtual bool is_bool (const char *path)=0
 Check if a value is of type bool. More...
 
virtual bool is_string (const char *path)=0
 Check if a value is of type string. More...
 
virtual bool is_list (const char *path)=0
 Check if a value is a list. More...
 
virtual bool is_default (const char *path)=0
 Check if a value was read from the default config. More...
 
virtual float get_float (const char *path)=0
 Get value from configuration which is of type float. More...
 
virtual unsigned int get_uint (const char *path)=0
 Get value from configuration which is of type unsigned int. More...
 
virtual int get_int (const char *path)=0
 Get value from configuration which is of type int. More...
 
virtual bool get_bool (const char *path)=0
 Get value from configuration which is of type bool. More...
 
virtual std::string get_string (const char *path)=0
 Get value from configuration which is of type string. 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 (const char *path)=0
 Get list of values from configuration which is of type float. More...
 
virtual std::vector< unsigned int > get_uints (const char *path)=0
 Get list of values from configuration which is of type unsigned int. More...
 
virtual std::vector< int > get_ints (const char *path)=0
 Get list of values from configuration which is of type int. More...
 
virtual std::vector< bool > get_bools (const char *path)=0
 Get list of values from configuration which is of type bool. More...
 
virtual std::vector< std::string > get_strings (const char *path)=0
 Get list of values from configuration which is of type string. 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...
 
virtual ValueIteratorget_value (const char *path)=0
 Get value from configuration. More...
 
virtual std::string get_type (const char *path)=0
 Get type of value at given path. More...
 
virtual std::string get_comment (const char *path)=0
 Get comment of value at given path. More...
 
virtual std::string get_default_comment (const char *path)=0
 Get comment of value at given path. More...
 
virtual void set_float (const char *path, float f)=0
 Set new value in configuration of type float. More...
 
virtual void set_uint (const char *path, unsigned int uint)=0
 Set new value in configuration of type unsigned int. More...
 
virtual void set_int (const char *path, int i)=0
 Set new value in configuration of type int. More...
 
virtual void set_bool (const char *path, bool b)=0
 Set new value in configuration of type bool. More...
 
virtual void set_string (const char *path, std::string &s)=0
 Set new value in configuration of type string. More...
 
virtual void set_string (const char *path, const char *s)=0
 Set new value in configuration of type string. More...
 
virtual void set_floats (const char *path, std::vector< float > &f)=0
 Set new value in configuration of type float. More...
 
virtual void set_uints (const char *path, std::vector< unsigned int > &uint)=0
 Set new value in configuration of type unsigned int. More...
 
virtual void set_ints (const char *path, std::vector< int > &i)=0
 Set new value in configuration of type int. More...
 
virtual void set_bools (const char *path, std::vector< bool > &b)=0
 Set new value in configuration of type bool. More...
 
virtual void set_strings (const char *path, std::vector< std::string > &s)=0
 Set new value in configuration of type string. More...
 
virtual void set_strings (const char *path, std::vector< const char * > &s)=0
 Set new value in configuration of type string. More...
 
virtual void set_comment (const char *path, const char *comment)=0
 Set new comment for existing value. More...
 
virtual void set_comment (const char *path, std::string &comment)=0
 Set new comment for existing value. More...
 
virtual void erase (const char *path)=0
 Erase the given value from the configuration. More...
 
virtual void set_default_float (const char *path, float f)=0
 Set new default value in configuration of type float. More...
 
virtual void set_default_uint (const char *path, unsigned int uint)=0
 Set new default value in configuration of type unsigned int. More...
 
virtual void set_default_int (const char *path, int i)=0
 Set new default value in configuration of type int. More...
 
virtual void set_default_bool (const char *path, bool b)=0
 Set new default value in configuration of type bool. More...
 
virtual void set_default_string (const char *path, std::string &s)=0
 Set new default value in configuration of type string. More...
 
virtual void set_default_string (const char *path, const char *s)=0
 Set new default value in configuration of type string. More...
 
virtual void set_default_comment (const char *path, const char *comment)=0
 Set new default comment for existing default configuration value. More...
 
virtual void set_default_comment (const char *path, std::string &comment)=0
 Set new default comment for existing default configuration value. More...
 
virtual void erase_default (const char *path)=0
 Erase the given default value from the configuration. More...
 
virtual ValueIteratoriterator ()=0
 Iterator for all values. More...
 
virtual ValueIteratorsearch (const char *path)=0
 Iterator with search results. More...
 
virtual void lock ()=0
 Lock the config. More...
 
virtual bool try_lock ()=0
 Try to lock the config. More...
 
virtual void unlock ()=0
 Unlock the config. More...
 
virtual void try_dump ()=0
 Try to dump configuration. 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

In-memory configuration store.

Author
Tim Niemueller

Definition at line 38 of file memory.h.

Constructor & Destructor Documentation

◆ MemoryConfiguration()

fawkes::MemoryConfiguration::MemoryConfiguration ( )

Constructor.

Definition at line 41 of file memory.cpp.

◆ ~MemoryConfiguration()

fawkes::MemoryConfiguration::~MemoryConfiguration ( )
virtual

Destructor.

Definition at line 48 of file memory.cpp.

Member Function Documentation

◆ copy()

void fawkes::MemoryConfiguration::copy ( Configuration copyconf)
virtual

Copies all values from the given configuration.

All values from the given configuration are copied. Old values are not erased so that the copied values will overwrite existing values, new values are created, but values existent in current config but not in the copied config will remain unchanged.

Parameters
copyconfconfiguration to copy

Implements fawkes::Configuration.

Definition at line 59 of file memory.cpp.

◆ erase()

void fawkes::MemoryConfiguration::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 376 of file memory.cpp.

◆ erase_default()

void fawkes::MemoryConfiguration::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 433 of file memory.cpp.

◆ exists()

bool fawkes::MemoryConfiguration::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 65 of file memory.cpp.

◆ get_bool()

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

Get value from configuration which is of type bool.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 147 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_bool().

◆ get_bools()

std::vector< bool > fawkes::MemoryConfiguration::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 177 of file memory.cpp.

◆ get_comment()

std::string fawkes::MemoryConfiguration::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 87 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_comment().

◆ get_default_comment()

std::string fawkes::MemoryConfiguration::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 245 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_default_comment().

◆ get_float()

float fawkes::MemoryConfiguration::get_float ( const char *  path)
virtual

Get value from configuration which is of type float.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 129 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_float().

◆ get_floats()

std::vector< float > fawkes::MemoryConfiguration::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 159 of file memory.cpp.

◆ get_int()

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

Get value from configuration which is of type int.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 141 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_int().

◆ get_ints()

std::vector< int > fawkes::MemoryConfiguration::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 171 of file memory.cpp.

◆ get_string()

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

Get value from configuration which is of type string.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 153 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_string().

◆ get_strings()

std::vector< std::string > fawkes::MemoryConfiguration::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 183 of file memory.cpp.

◆ get_type()

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

Get type of value at given path.

Parameters
pathpath to value
Returns
string representation of type, one of float, unsigned int, int, bool, or string
Exceptions
ConfigurationExceptionshall be thrown if value does not exist or on any other error.

Implements fawkes::Configuration.

Definition at line 76 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_type().

◆ get_uint()

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

Get value from configuration which is of type unsigned int.

Parameters
pathpath to value
Returns
value

Implements fawkes::Configuration.

Definition at line 135 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_uint().

◆ get_uints()

std::vector< unsigned int > fawkes::MemoryConfiguration::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 165 of file memory.cpp.

◆ get_value()

Configuration::ValueIterator * fawkes::MemoryConfiguration::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 267 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::get_value().

◆ is_bool()

bool fawkes::MemoryConfiguration::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 223 of file memory.cpp.

◆ is_default()

bool fawkes::MemoryConfiguration::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 251 of file memory.cpp.

◆ is_float()

bool fawkes::MemoryConfiguration::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 205 of file memory.cpp.

◆ is_int()

bool fawkes::MemoryConfiguration::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 217 of file memory.cpp.

◆ is_list()

bool fawkes::MemoryConfiguration::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 235 of file memory.cpp.

◆ is_string()

bool fawkes::MemoryConfiguration::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 229 of file memory.cpp.

◆ is_uint()

bool fawkes::MemoryConfiguration::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 211 of file memory.cpp.

◆ iterator()

Configuration::ValueIterator * fawkes::MemoryConfiguration::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 473 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::iterator(), iterator_default(), and iterator_hostspecific().

◆ iterator_default()

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

Get iterator over default values.

Returns
iterator that only mentions default values

Definition at line 484 of file memory.cpp.

References iterator().

Referenced by fawkes::NetworkConfiguration::iterator_default().

◆ iterator_hostspecific()

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

Get iterator over host-specific values.

Returns
iterator that only mentions host-specific (non-default) values

Definition at line 506 of file memory.cpp.

References iterator().

Referenced by fawkes::NetworkConfiguration::iterator_hostspecific().

◆ load()

void fawkes::MemoryConfiguration::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 54 of file memory.cpp.

◆ lock()

void fawkes::MemoryConfiguration::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 443 of file memory.cpp.

References fawkes::Mutex::lock().

◆ search()

Configuration::ValueIterator * fawkes::MemoryConfiguration::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 525 of file memory.cpp.

Referenced by fawkes::NetworkConfiguration::search().

◆ set_bool()

void fawkes::MemoryConfiguration::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 304 of file memory.cpp.

◆ set_bools()

void fawkes::MemoryConfiguration::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 345 of file memory.cpp.

◆ set_comment() [1/2]

void fawkes::MemoryConfiguration::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 366 of file memory.cpp.

◆ set_comment() [2/2]

void fawkes::MemoryConfiguration::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 371 of file memory.cpp.

◆ set_default_bool()

void fawkes::MemoryConfiguration::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 403 of file memory.cpp.

◆ set_default_comment() [1/2]

void fawkes::MemoryConfiguration::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 423 of file memory.cpp.

◆ set_default_comment() [2/2]

void fawkes::MemoryConfiguration::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 428 of file memory.cpp.

◆ set_default_float()

void fawkes::MemoryConfiguration::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 382 of file memory.cpp.

◆ set_default_int()

void fawkes::MemoryConfiguration::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 396 of file memory.cpp.

◆ set_default_string() [1/2]

void fawkes::MemoryConfiguration::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 410 of file memory.cpp.

◆ set_default_string() [2/2]

void fawkes::MemoryConfiguration::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 417 of file memory.cpp.

References set_default_string().

Referenced by set_default_string().

◆ set_default_uint()

void fawkes::MemoryConfiguration::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 389 of file memory.cpp.

◆ set_float()

void fawkes::MemoryConfiguration::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 283 of file memory.cpp.

◆ set_floats()

void fawkes::MemoryConfiguration::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 324 of file memory.cpp.

◆ set_int()

void fawkes::MemoryConfiguration::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 297 of file memory.cpp.

◆ set_ints()

void fawkes::MemoryConfiguration::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 338 of file memory.cpp.

◆ set_string() [1/2]

void fawkes::MemoryConfiguration::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 311 of file memory.cpp.

◆ set_string() [2/2]

void fawkes::MemoryConfiguration::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 318 of file memory.cpp.

References set_string().

Referenced by set_string().

◆ set_strings() [1/2]

void fawkes::MemoryConfiguration::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 359 of file memory.cpp.

◆ set_strings() [2/2]

void fawkes::MemoryConfiguration::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 352 of file memory.cpp.

◆ set_uint()

void fawkes::MemoryConfiguration::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 290 of file memory.cpp.

◆ set_uints()

void fawkes::MemoryConfiguration::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 331 of file memory.cpp.

◆ try_dump()

void fawkes::MemoryConfiguration::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 468 of file memory.cpp.

◆ try_lock()

bool fawkes::MemoryConfiguration::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 453 of file memory.cpp.

References fawkes::Mutex::try_lock().

◆ unlock()

void fawkes::MemoryConfiguration::unlock ( )
virtual

Unlock the config.

Modifications and queries are possible again.

Implements fawkes::Configuration.

Definition at line 462 of file memory.cpp.

References fawkes::Mutex::unlock().


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