40 std::cout <<
"The value " << key <<
" changed to ";
41 std::cout << icl_core::config::getDefault<icl_core::String>(key,
" error when trying to get new value!") <<
std::endl;
45 int main(
int argc,
char *argv[])
57 bool success = icl_core::config::get<icl_core::String>(
"/example/config/node", value);
58 std::cout <<
"/example/config/node(" << success <<
"): " << value <<
std::endl;
60 std::cout << std::endl <<
"-- Direct access by name with default value --" <<
std::endl;
62 std::cout <<
"/example/config/node: " << another_value <<
std::endl;
64 std::cout << std::endl <<
"-- Regex access --" <<
std::endl;
66 while (find_it.
next()) {
70 std::cout << std::endl <<
"-- Observing configuration changes --" <<
std::endl;
static ConfigManager & instance()
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
Interface for observing configuration changes.
void registerObserver(ConfigObserver *observer, const String &key="")
Base header file for the configuration framework.
int main(int argc, char *argv[])
ThreadStream & endl(ThreadStream &stream)
ConfigIterator find(const ::icl_core::String &query)
void addParameter(const ConfigParameter ¶meter)
virtual void valueChanged(const icl_core::String &key)
String matchGroup(size_t index) const
ConvertToRef< T >::ToConstRef value() const
bool setValue(const icl_core::String &key, typename icl_core::ConvertToRef< T >::ToConstRef value)
Add a key/value pair or change a value. In contrast to Insert, this method notifies observers...