Fawkes API  Fawkes Development Version
fawkes::ConfigurationChangeHandler Class Referenceabstract

Interface for configuration change handling. More...

#include <>>

Inheritance diagram for fawkes::ConfigurationChangeHandler:

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

Detailed Description

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.

Author
Tim Niemueller

Definition at line 31 of file change_handler.h.

Constructor & Destructor Documentation

◆ ConfigurationChangeHandler()

fawkes::ConfigurationChangeHandler::ConfigurationChangeHandler ( const char *  path_prefix)

Constructor.

Parameters
path_prefixPath prefix to monitor. Use the empty string ("") to monitor all changes.

Definition at line 65 of file change_handler.cpp.

◆ ~ConfigurationChangeHandler()

fawkes::ConfigurationChangeHandler::~ConfigurationChangeHandler ( )
virtual

Destructor.

Definition at line 73 of file change_handler.cpp.

Member Function Documentation

◆ config_comment_changed()

void fawkes::ConfigurationChangeHandler::config_comment_changed ( const Configuration::ValueIterator v)
pure virtual

Called whenever a comment of a watched value has changed.

Parameters
vvalue iterator for the specific value

Implemented in ConfigChangeWatcherTool, fawkes::PluginManager, and fawkes::ConfigNetworkHandler.

◆ config_monitor_prefix()

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.

Returns
monitored path prefix

Definition at line 86 of file change_handler.cpp.

Referenced by fawkes::Configuration::add_change_handler(), and fawkes::Configuration::rem_change_handler().

◆ config_tag_changed()

void fawkes::ConfigurationChangeHandler::config_tag_changed ( const char *  new_tag)
pure virtual

Called whenever the tag has changed.

This function can be used to detect when data from another tag has been loaded.

Parameters
new_tagnew tag

Implemented in fawkes::PluginManager, fawkes::ConfigNetworkHandler, and ConfigChangeWatcherTool.

◆ config_value_changed()

void fawkes::ConfigurationChangeHandler::config_value_changed ( const Configuration::ValueIterator v)
pure virtual

Called whenever a watched value has changed.

Parameters
vvalue iterator for the specific value

Implemented in fawkes::PluginManager, ConfigChangeWatcherTool, and fawkes::ConfigNetworkHandler.

◆ config_value_erased()

void fawkes::ConfigurationChangeHandler::config_value_erased ( const char *  path)
pure virtual

Called whenever a value has been erased from the config.

Parameters
pathpath of value

Implemented in ConfigChangeWatcherTool, fawkes::PluginManager, and fawkes::ConfigNetworkHandler.


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