feisty meow concerns codebase  2.140
config_watcher.h
Go to the documentation of this file.
1 #ifndef CONFIG_WATCHER_CLASS
2 #define CONFIG_WATCHER_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : config_watcher *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2008-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include "configurator.h"
19 #include "table_configurator.h"
20 
21 #include <basis/contracts.h>
22 #include <structures/set.h>
23 
24 namespace configuration {
25 
27 
35 {
36 public:
37  config_watcher(configurator &to_watch);
39 
41  virtual ~config_watcher();
42 
43  DEFINE_CLASS_NAME("config_watcher");
44 
45  bool rescan();
47 
49  // these lists describe how sections have changed, if at all.
53 
54  // methods for comparing changes within sections in the config.
55  structures::string_set new_items(const basis::astring &section_name);
58 
59 private:
60  configurator &_watching;
61  table_configurator *_current_config;
62  table_configurator *_previous_config;
63 };
64 
65 } //namespace.
66 
67 #endif
68 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
an object that watches the contents of a configurator for changes.
structures::string_set changed_sections() const
structures::string_set new_sections() const
config_watcher(configurator &to_watch)
watches the configurator for changes and tracks them.
bool rescan()
updates the configurator snapshot and enables the comparison methods.
structures::string_set deleted_items(const basis::astring &section_name)
structures::string_set new_items(const basis::astring &section_name)
DEFINE_CLASS_NAME("config_watcher")
structures::string_set deleted_sections() const
structures::string_set changed_items(const basis::astring &section_name)
Provides a base class for configuration repositories.
Definition: configurator.h:34
Supports the configurator interface using a collection of string tables.
A simple object that wraps a templated set of strings.
Definition: set.h:168