|
libpsynth 0.2.1
|
A configuration node. More...
#include <config.hpp>


Public Member Functions | |
| const std::type_info & | type () const |
| Returns the type of the node. | |
| bool | empty () const |
| Returns wether the node is empty or not. | |
| void | nudge () |
| Nudges the node. | |
| template<class T > | |
| void | set (const T &val) |
| Sets the value of the node. | |
| template<class T > | |
| void | set (const T &val, bool overwrite) |
| Sets the value of the node unless overwrite = false and the node is already set. | |
| template<class T > | |
| void | def (const T &val) |
| Sets the value of the node if no previous value has been give to the node. | |
| template<class T > | |
| void | get (T &data) const |
| Gets the value of the node. | |
| template<class T > | |
| T | get () const |
| Gets the value of the node. | |
| void | save () |
| Permanently stores this node hierarchy using the attached backend. | |
| void | load () |
| Loads this node hierarchy from the permanent media. | |
| void | def_load () |
| Loads this node hierarchy from the permanent media but leaving already set values with their old value. | |
| void | set_backend (conf_backend_ptr backend) |
| Attaches a backend to the node. | |
| void | unset_backend () |
| Dataches the currently attached backend to the node. | |
A configuration node.
It stores a value of any type in conf_type. It has some childs identifyed by its name crating a whole hierarchy that allows a better organization of the values and the information.
Rethink the backend system.
Template threading model.
| void psynth::base::conf_node::def | ( | const T & | val | ) |
Sets the value of the node if no previous value has been give to the node.
The node type is set to T, unless T is not a valid type in which case nothing happends.
| val | The new value of the node. |
| void psynth::base::conf_node::def_load | ( | ) |
Loads this node hierarchy from the permanent media but leaving already set values with their old value.
| bool psynth::base::conf_node::empty | ( | ) | const [inline] |
Returns wether the node is empty or not.
| T psynth::base::conf_node::get | ( | ) | const |
Gets the value of the node.
Make sure that T matches the node type.
| void psynth::base::conf_node::get | ( | T & | data | ) | const |
Gets the value of the node.
Make sure that T matches the node type.
| data | Somewhere to store the node value. |
| void psynth::base::conf_node::load | ( | ) |
Loads this node hierarchy from the permanent media.
| void psynth::base::conf_node::nudge | ( | ) | [inline] |
Nudges the node.
It just raises a nudge event.
| void psynth::base::conf_node::save | ( | ) |
Permanently stores this node hierarchy using the attached backend.
| void psynth::base::conf_node::set | ( | const T & | val | ) | [inline] |
Sets the value of the node.
The node type is set to T, unless T is not a valid type in which case nothing happends.
| val | The new value of the node. |
| void psynth::base::conf_node::set | ( | const T & | val, |
| bool | overwrite | ||
| ) |
Sets the value of the node unless overwrite = false and the node is already set.
| val | The new value of the node. |
| void psynth::base::conf_node::set_backend | ( | conf_backend_ptr | backend | ) |
Attaches a backend to the node.
If another backend has already been attached it is datached.
| backend | The backend to attach. |
| const std::type_info& psynth::base::conf_node::type | ( | ) | const [inline] |
Returns the type of the node.
| void psynth::base::conf_node::unset_backend | ( | ) |
Dataches the currently attached backend to the node.
1.7.4