Fawkes API Fawkes Development Version
|
Interface for configuration change handling. More...
#include <>>
Public Member Functions | |
ConfigurationChangeHandler (const char *path_prefix) | |
Constructor. More... | |
virtual | ~ConfigurationChangeHandler () |
Destructor. More... | |
virtual void | config_tag_changed (const char *new_tag)=0 |
Called whenever the tag has changed. More... | |
virtual void | config_value_changed (const Configuration::ValueIterator *v)=0 |
Called whenever a watched value has changed. More... | |
virtual void | config_comment_changed (const Configuration::ValueIterator *v)=0 |
Called whenever a comment of a watched value has changed. More... | |
virtual void | config_value_erased (const char *path)=0 |
Called whenever a value has been erased from the config. More... | |
const char * | config_monitor_prefix () |
Which path prefix shall be monitored. More... | |
Interface for configuration change handling.
One of the major flaws in the old software was that for each configuration change the software had to be restarted. To avoid this change handlers are introduced. Change handlers are called if a value for the given component changes so that appropriate adjustement of the behavior or a proper re-initialisation of a specific component can be conducted.
Definition at line 31 of file change_handler.h.
fawkes::ConfigurationChangeHandler::ConfigurationChangeHandler | ( | const char * | path_prefix | ) |
Constructor.
path_prefix | Path prefix to monitor. Use the empty string ("") to monitor all changes. |
Definition at line 64 of file change_handler.cpp.
|
virtual |
Destructor.
Definition at line 70 of file change_handler.cpp.
|
pure virtual |
Called whenever a comment of a watched value has changed.
v | value iterator for the specific value |
Implemented in fawkes::ConfigNetworkHandler, fawkes::PluginManager, ConfigChangeWatcherTool, and LaserLinesThread.
const char * fawkes::ConfigurationChangeHandler::config_monitor_prefix | ( | ) |
Which path prefix shall be monitored.
Implement this method to return the name of the component whose values you want to monitor. If NULL or the empty string is returned all components will be monitored.
Definition at line 82 of file change_handler.cpp.
Referenced by fawkes::Configuration::add_change_handler(), and fawkes::Configuration::rem_change_handler().
|
pure virtual |
Called whenever the tag has changed.
This function can be used to detect when data from another tag has been loaded.
new_tag | new tag |
Implemented in LaserLinesThread, fawkes::ConfigNetworkHandler, fawkes::PluginManager, and ConfigChangeWatcherTool.
|
pure virtual |
Called whenever a watched value has changed.
v | value iterator for the specific value |
Implemented in fawkes::ConfigNetworkHandler, fawkes::PluginManager, ConfigChangeWatcherTool, and LaserLinesThread.
|
pure virtual |
Called whenever a value has been erased from the config.
path | path of value |
Implemented in fawkes::ConfigNetworkHandler, fawkes::PluginManager, LaserLinesThread, and ConfigChangeWatcherTool.