feisty meow concerns codebase
2.140
|
an object that watches the contents of a configurator for changes. More...
#include <config_watcher.h>
Public Member Functions | |
config_watcher (configurator &to_watch) | |
watches the configurator for changes and tracks them. More... | |
virtual | ~config_watcher () |
DEFINE_CLASS_NAME ("config_watcher") | |
bool | rescan () |
updates the configurator snapshot and enables the comparison methods. More... | |
structures::string_set | new_sections () const |
structures::string_set | deleted_sections () const |
structures::string_set | changed_sections () const |
structures::string_set | new_items (const basis::astring §ion_name) |
structures::string_set | deleted_items (const basis::astring §ion_name) |
structures::string_set | changed_items (const basis::astring §ion_name) |
an object that watches the contents of a configurator for changes.
when given a configurator object to check, this will initially build an exact copy of the contents seen. when asked to look for changes to the configurator, the previous version is compared with the current state and any changed sections are reported.
Definition at line 34 of file config_watcher.h.
configuration::config_watcher::config_watcher | ( | configurator & | to_watch | ) |
watches the configurator for changes and tracks them.
"to_watch" must exist for lifetime of this class.
Definition at line 27 of file config_watcher.cpp.
References rescan().
|
virtual |
Definition at line 35 of file config_watcher.cpp.
References basis::WHACK().
string_set configuration::config_watcher::changed_items | ( | const basis::astring & | section_name | ) |
string_set configuration::config_watcher::changed_sections | ( | ) | const |
Definition at line 80 of file config_watcher.cpp.
References structures::set< contents >::elements(), configuration::table_configurator::get_section(), structures::set< contents >::intersection(), and configuration::configurator::section_set().
configuration::config_watcher::DEFINE_CLASS_NAME | ( | "config_watcher" | ) |
string_set configuration::config_watcher::deleted_items | ( | const basis::astring & | section_name | ) |
Definition at line 100 of file config_watcher.cpp.
References configuration::table_configurator::get_section(), and structures::symbol_table< contents >::names().
string_set configuration::config_watcher::deleted_sections | ( | ) | const |
Definition at line 71 of file config_watcher.cpp.
References configuration::configurator::section_set().
string_set configuration::config_watcher::new_items | ( | const basis::astring & | section_name | ) |
Definition at line 113 of file config_watcher.cpp.
References configuration::table_configurator::get_section(), and structures::symbol_table< contents >::names().
string_set configuration::config_watcher::new_sections | ( | ) | const |
Definition at line 62 of file config_watcher.cpp.
References configuration::configurator::section_set().
bool configuration::config_watcher::rescan | ( | ) |
updates the configurator snapshot and enables the comparison methods.
call this before testing the changed() method.
Definition at line 41 of file config_watcher.cpp.
References configuration::configurator::get_section(), basis::array< contents >::length(), configuration::table_configurator::put_section(), configuration::table_configurator::reset(), and configuration::configurator::section_set().
Referenced by config_watcher().