feisty meow concerns codebase  2.140
configuration::config_watcher Class Reference

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 &section_name)
 
structures::string_set deleted_items (const basis::astring &section_name)
 
structures::string_set changed_items (const basis::astring &section_name)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ config_watcher()

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().

◆ ~config_watcher()

configuration::config_watcher::~config_watcher ( )
virtual

Definition at line 35 of file config_watcher.cpp.

References basis::WHACK().

Member Function Documentation

◆ changed_items()

◆ changed_sections()

◆ DEFINE_CLASS_NAME()

configuration::config_watcher::DEFINE_CLASS_NAME ( "config_watcher"  )

◆ deleted_items()

string_set configuration::config_watcher::deleted_items ( const basis::astring section_name)

◆ deleted_sections()

string_set configuration::config_watcher::deleted_sections ( ) const

Definition at line 71 of file config_watcher.cpp.

References configuration::configurator::section_set().

◆ new_items()

string_set configuration::config_watcher::new_items ( const basis::astring section_name)

◆ new_sections()

string_set configuration::config_watcher::new_sections ( ) const

Definition at line 62 of file config_watcher.cpp.

References configuration::configurator::section_set().

◆ rescan()

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().


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