config_watcher Class Reference

an object that watches the contents of a configurator for changes. More...

#include <config_watcher.h>

Collaboration diagram for config_watcher:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 config_watcher (configurator &to_watch)
 watches the configurator for changes and tracks them.
virtual ~config_watcher ()
 IMPLEMENT_CLASS_NAME ("config_watcher")
bool rescan ()
 updates the configurator snapshot and enables the comparison methods.
string_set new_sections () const
string_set deleted_sections () const
string_set changed_sections () const
string_set new_items (const istring &section_name)
string_set deleted_items (const istring &section_name)
string_set changed_items (const istring &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 35 of file config_watcher.h.


Constructor & Destructor Documentation

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 22 of file config_watcher.cpp.

References rescan().

config_watcher::~config_watcher (  )  [virtual]

Definition at line 30 of file config_watcher.cpp.

References WHACK().


Member Function Documentation

config_watcher::IMPLEMENT_CLASS_NAME ( "config_watcher"   ) 

bool config_watcher::rescan (  ) 

updates the configurator snapshot and enables the comparison methods.

call this before testing the changed() method.

Definition at line 36 of file config_watcher.cpp.

References configurator::get_section(), array< contents >::length(), table_configurator::put_section(), table_configurator::reset(), and configurator::section_set().

Referenced by config_watcher().

string_set config_watcher::new_sections (  )  const

Definition at line 57 of file config_watcher.cpp.

References configurator::section_set().

string_set config_watcher::deleted_sections (  )  const

Definition at line 66 of file config_watcher.cpp.

References configurator::section_set().

string_set config_watcher::changed_sections (  )  const

Definition at line 75 of file config_watcher.cpp.

References basis::set< contents >::elements(), table_configurator::get_section(), basis::set< contents >::intersection(), and configurator::section_set().

string_set config_watcher::new_items ( const istring section_name  ) 

Definition at line 108 of file config_watcher.cpp.

References table_configurator::get_section(), and symbol_table< contents >::names().

string_set config_watcher::deleted_items ( const istring section_name  ) 

Definition at line 95 of file config_watcher.cpp.

References table_configurator::get_section(), and symbol_table< contents >::names().

string_set config_watcher::changed_items ( const istring section_name  ) 

Definition at line 121 of file config_watcher.cpp.

References basis::set< contents >::elements(), table_configurator::get(), table_configurator::get_section(), basis::set< contents >::intersection(), and symbol_table< contents >::names().


The documentation for this class was generated from the following files:
Generated on Fri Oct 10 04:30:06 2008 for HOOPLE Libraries by  doxygen 1.5.1