24 #ifndef __CONFIG_MEMORY_H_ 25 #define __CONFIG_MEMORY_H_ 27 #include <config/config.h> 28 #include <config/yaml.h> 35 class YamlConfigurationNode;
46 virtual void load(
const char *file_path);
48 virtual bool exists(
const char *path);
49 virtual bool is_float(
const char *path);
50 virtual bool is_uint(
const char *path);
51 virtual bool is_int(
const char *path);
52 virtual bool is_bool(
const char *path);
54 virtual bool is_list(
const char *path);
58 virtual std::string
get_type(
const char *path);
59 virtual float get_float(
const char *path);
60 virtual unsigned int get_uint(
const char *path);
61 virtual int get_int(
const char *path);
62 virtual bool get_bool(
const char *path);
63 virtual std::string
get_string(
const char *path);
64 virtual std::vector<float>
get_floats(
const char *path);
65 virtual std::vector<unsigned int>
get_uints(
const char *path);
66 virtual std::vector<int>
get_ints(
const char *path);
67 virtual std::vector<bool>
get_bools(
const char *path);
68 virtual std::vector<std::string>
get_strings(
const char *path);
73 virtual void set_float(
const char *path,
float f);
74 virtual void set_uint(
const char *path,
unsigned int uint);
75 virtual void set_int(
const char *path,
int i);
76 virtual void set_bool(
const char *path,
bool b);
77 virtual void set_string(
const char *path, std::string &s);
78 virtual void set_string(
const char *path,
const char *s);
79 virtual void set_floats(
const char *path, std::vector<float> &f);
80 virtual void set_uints(
const char *path, std::vector<unsigned int> &uint);
81 virtual void set_ints(
const char *path, std::vector<int> &i);
82 virtual void set_bools(
const char *path, std::vector<bool> &b);
83 virtual void set_strings(
const char *path, std::vector<std::string> &s);
84 virtual void set_strings(
const char *path, std::vector<const char *> &s);
85 virtual void set_comment(
const char *path, std::string &comment);
86 virtual void set_comment(
const char *path,
const char *comment);
88 virtual void erase(
const char *path);
113 YamlConfigurationNode * query(
const char *path)
const;
115 YamlConfigurationNode *root_;
virtual std::vector< bool > get_bools(const char *path)
Get list of values from configuration which is of type bool.
ValueIterator * iterator()
Iterator for all values.
virtual std::vector< float > get_floats(const char *path)
Get list of values from configuration which is of type float.
virtual void copy(Configuration *copyconf)
Copies all values from the given configuration.
virtual bool is_float(const char *path)
Check if a value is of type float.
void lock()
Lock the config.
virtual void set_bool(const char *path, bool b)
Set new value in configuration of type bool.
virtual void set_default_uint(const char *path, unsigned int uint)
Set new default value in configuration of type unsigned int.
virtual void try_dump()
Try to dump configuration.
virtual void set_default_string(const char *path, std::string &s)
Set new default value in configuration of type string.
virtual void set_uint(const char *path, unsigned int uint)
Set new value in configuration of type unsigned int.
Fawkes library namespace.
virtual bool is_string(const char *path)
Check if a value is of type string.
bool try_lock()
Try to lock the config.
virtual bool is_bool(const char *path)
Check if a value is of type bool.
virtual void set_ints(const char *path, std::vector< int > &i)
Set new value in configuration of type int.
virtual std::vector< unsigned int > get_uints(const char *path)
Get list of values from configuration which is of type unsigned int.
virtual unsigned int get_uint(const char *path)
Get value from configuration which is of type unsigned int.
MemoryConfiguration()
Constructor.
virtual void set_bools(const char *path, std::vector< bool > &b)
Set new value in configuration of type bool.
virtual int get_int(const char *path)
Get value from configuration which is of type int.
virtual float get_float(const char *path)
Get value from configuration which is of type float.
virtual void set_string(const char *path, std::string &s)
Set new value in configuration of type string.
virtual bool is_int(const char *path)
Check if a value is of type int.
virtual bool is_default(const char *path)
Check if a value was read from the default config.
virtual std::vector< int > get_ints(const char *path)
Get list of values from configuration which is of type int.
virtual void set_default_int(const char *path, int i)
Set new default value in configuration of type int.
virtual bool exists(const char *path)
Check if a given value exists.
virtual void set_comment(const char *path, std::string &comment)
Set new comment for existing value.
virtual std::vector< std::string > get_strings(const char *path)
Get list of values from configuration which is of type string.
virtual std::string get_comment(const char *path)
Get comment of value at given path.
virtual void set_floats(const char *path, std::vector< float > &f)
Set new value in configuration of type float.
virtual void set_strings(const char *path, std::vector< std::string > &s)
Set new value in configuration of type string.
virtual std::string get_type(const char *path)
Get type of value at given path.
virtual void set_uints(const char *path, std::vector< unsigned int > &uint)
Set new value in configuration of type unsigned int.
ValueIterator * search(const char *path)
Iterator with search results.
void unlock()
Unlock the config.
virtual std::string get_string(const char *path)
Get value from configuration which is of type string.
In-memory configuration store.
Iterator interface to iterate over config values.
ValueIterator * iterator_hostspecific()
Get iterator over host-specific values.
virtual std::string get_default_comment(const char *path)
Get comment of value at given path.
virtual void set_default_comment(const char *path, const char *comment)
Set new default comment for existing default configuration value.
virtual ValueIterator * get_value(const char *path)
Get value from configuration.
virtual void set_float(const char *path, float f)
Set new value in configuration of type float.
virtual void load(const char *file_path)
Load configuration.
virtual ~MemoryConfiguration()
Destructor.
Mutex mutual exclusion lock.
ValueIterator * iterator_default()
Get iterator over default values.
virtual void erase_default(const char *path)
Erase the given default value from the configuration.
virtual bool is_list(const char *path)
Check if a value is a list.
Interface for configuration handling.
virtual void set_default_bool(const char *path, bool b)
Set new default value in configuration of type bool.
virtual void erase(const char *path)
Erase the given value from the configuration.
virtual void set_int(const char *path, int i)
Set new value in configuration of type int.
virtual bool is_uint(const char *path)
Check if a value is of type unsigned int.
virtual bool get_bool(const char *path)
Get value from configuration which is of type bool.
virtual void set_default_float(const char *path, float f)
Set new default value in configuration of type float.