fawkes::ConfigurationChangeHandler Class Reference

Interface for configuration change handling. More...

#include <config/change_handler.h>

Inheritance diagram for fawkes::ConfigurationChangeHandler:

[legend]
List of all members.

Public Member Functions

 ConfigurationChangeHandler (const char *path_prefix="")
 Constructor.
virtual ~ConfigurationChangeHandler ()
 Destructor.
virtual void config_tag_changed (const char *new_tag)=0
 Called whenever the tag has changed.
virtual void config_value_changed (const char *path, bool is_default, int value)=0
 Called whenever an int value has changed.
virtual void config_value_changed (const char *path, bool is_default, unsigned int value)=0
 Called whenever an unsigned int value has changed.
virtual void config_value_changed (const char *path, bool is_default, float value)=0
 Called whenever an float value has changed.
virtual void config_value_changed (const char *path, bool is_default, bool value)=0
 Called whenever an boolean value has changed.
virtual void config_value_changed (const char *path, bool is_default, const char *value)=0
 Called whenever a string value has changed.
virtual void config_comment_changed (const char *path, bool is_default, const char *comment)=0
 Called whenever a comment has changed.
virtual void config_value_erased (const char *path, bool is_default)=0
 Called whenever a value has been erased from the config.
const char * config_monitor_prefix ()
 Which path prefix shall be monitored.

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 29 of file change_handler.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
path_prefix Path prefix to monitor. Use the empty string ("") to monitor all changes.

Definition at line 94 of file change_handler.cpp.

fawkes::ConfigurationChangeHandler::~ConfigurationChangeHandler (  )  [virtual]

Destructor.

Definition at line 102 of file change_handler.cpp.


Member Function Documentation

void fawkes::ConfigurationChangeHandler::config_comment_changed ( const char *  path,
bool  is_default,
const char *  comment 
) [pure virtual]

Called whenever a comment has changed.

Parameters:
path path of value
is_default true if modified comment is of a default value, false otherwise
comment new comment

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

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 115 of file change_handler.cpp.

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

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_tag new tag

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

void fawkes::ConfigurationChangeHandler::config_value_changed ( const char *  path,
bool  is_default,
const char *  value 
) [pure virtual]

Called whenever a string value has changed.

Parameters:
path path of value
is_default true if modified value is a default value, false otherwise
value new value

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

void fawkes::ConfigurationChangeHandler::config_value_changed ( const char *  path,
bool  is_default,
bool  value 
) [pure virtual]

Called whenever an boolean value has changed.

Parameters:
path path of value
is_default true if modified value is a default value, false otherwise
value new value

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

void fawkes::ConfigurationChangeHandler::config_value_changed ( const char *  path,
bool  is_default,
float  value 
) [pure virtual]

Called whenever an float value has changed.

Parameters:
path path of value
is_default true if modified value is a default value, false otherwise
value new value

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

void fawkes::ConfigurationChangeHandler::config_value_changed ( const char *  path,
bool  is_default,
unsigned int  value 
) [pure virtual]

Called whenever an unsigned int value has changed.

Parameters:
path path of value
is_default true if modified value is a default value, false otherwise
value new value

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

void fawkes::ConfigurationChangeHandler::config_value_changed ( const char *  path,
bool  is_default,
int  value 
) [pure virtual]

Called whenever an int value has changed.

Parameters:
path path of value
is_default true if modified value is a default value, false otherwise
value new value

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

void fawkes::ConfigurationChangeHandler::config_value_erased ( const char *  path,
bool  is_default 
) [pure virtual]

Called whenever a value has been erased from the config.

Parameters:
path path of value
is_default true if erased value was a default value, false otherwise

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


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:31:38 2011 for Fawkes API by  doxygen 1.4.7