Fawkes API  Fawkes Development Version
ConfigChangeWatcherTool Class Reference

Tool to watch and output config changes. More...

Inheritance diagram for ConfigChangeWatcherTool:

Public Member Functions

 ConfigChangeWatcherTool (Configuration *config, FawkesNetworkClient *c)
 Constructor. More...
 
virtual void handle_signal (int signal)
 Signal hanlding method. More...
 
virtual void config_tag_changed (const char *new_tag)
 Called whenever the tag has changed. More...
 
virtual void config_value_changed (const Configuration::ValueIterator *v)
 Called whenever a watched value has changed. More...
 
virtual void config_comment_changed (const Configuration::ValueIterator *v)
 Called whenever a comment of a watched value has changed. More...
 
virtual void config_value_erased (const char *path)
 Called whenever a value has been erased from the config. More...
 
void run ()
 Run. More...
 
- Public Member Functions inherited from fawkes::ConfigurationChangeHandler
 ConfigurationChangeHandler (const char *path_prefix)
 Constructor. More...
 
virtual ~ConfigurationChangeHandler ()
 Destructor. More...
 
const char * config_monitor_prefix ()
 Which path prefix shall be monitored. More...
 
- Public Member Functions inherited from fawkes::SignalHandler
virtual ~SignalHandler ()
 Virtual destructor. More...
 

Detailed Description

Tool to watch and output config changes.

Definition at line 38 of file main.cpp.

Constructor & Destructor Documentation

◆ ConfigChangeWatcherTool()

ConfigChangeWatcherTool::ConfigChangeWatcherTool ( Configuration config,
FawkesNetworkClient c 
)
inline

Constructor.

Parameters
configConfiguration to watch
cnetwork client, thread is cancelled on signal

Definition at line 47 of file main.cpp.

References fawkes::Configuration::add_change_handler().

Member Function Documentation

◆ config_comment_changed()

virtual void ConfigChangeWatcherTool::config_comment_changed ( const Configuration::ValueIterator v)
inlinevirtual

Called whenever a comment of a watched value has changed.

Parameters
vvalue iterator for the specific value

Implements fawkes::ConfigurationChangeHandler.

Definition at line 73 of file main.cpp.

References fawkes::Configuration::ValueIterator::get_comment(), fawkes::Configuration::ValueIterator::is_default(), and fawkes::Configuration::ValueIterator::path().

◆ config_tag_changed()

virtual void ConfigChangeWatcherTool::config_tag_changed ( const char *  new_tag)
inlinevirtual

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

Implements fawkes::ConfigurationChangeHandler.

Definition at line 62 of file main.cpp.

◆ config_value_changed()

virtual void ConfigChangeWatcherTool::config_value_changed ( const Configuration::ValueIterator v)
inlinevirtual

Called whenever a watched value has changed.

Parameters
vvalue iterator for the specific value

Implements fawkes::ConfigurationChangeHandler.

Definition at line 67 of file main.cpp.

References fawkes::Configuration::ValueIterator::get_as_string(), fawkes::Configuration::ValueIterator::is_default(), fawkes::Configuration::ValueIterator::path(), and fawkes::Configuration::ValueIterator::type().

◆ config_value_erased()

virtual void ConfigChangeWatcherTool::config_value_erased ( const char *  path)
inlinevirtual

Called whenever a value has been erased from the config.

Parameters
pathpath of value

Implements fawkes::ConfigurationChangeHandler.

Definition at line 79 of file main.cpp.

◆ handle_signal()

virtual void ConfigChangeWatcherTool::handle_signal ( int  signum)
inlinevirtual

Signal hanlding method.

Implement this method with the action you want to perform on the registered signals.

Parameters
signumsignal number of triggered signal
Author
Tim Niemueller

Implements fawkes::SignalHandler.

Definition at line 56 of file main.cpp.

References fawkes::Configuration::rem_change_handler().

◆ run()

void ConfigChangeWatcherTool::run ( )
inline

Run.

This joins the network thread.

Definition at line 89 of file main.cpp.

References fawkes::FawkesNetworkClient::connect(), fawkes::FawkesNetworkClient::disconnect(), fawkes::NetworkConfiguration::erase(), fawkes::NetworkConfiguration::erase_default(), fawkes::Configuration::ValueIterator::get_bool(), fawkes::Configuration::ValueIterator::get_bools(), fawkes::Configuration::ValueIterator::get_comment(), fawkes::Configuration::ValueIterator::get_float(), fawkes::Configuration::ValueIterator::get_floats(), fawkes::Configuration::ValueIterator::get_int(), fawkes::Configuration::ValueIterator::get_ints(), fawkes::Configuration::ValueIterator::get_string(), fawkes::Configuration::ValueIterator::get_strings(), fawkes::Configuration::ValueIterator::get_uint(), fawkes::Configuration::ValueIterator::get_uints(), fawkes::NetworkConfiguration::get_value(), fawkes::ArgumentParser::has_arg(), fawkes::Configuration::ValueIterator::is_bool(), fawkes::Configuration::ValueIterator::is_default(), fawkes::Configuration::ValueIterator::is_float(), fawkes::Configuration::ValueIterator::is_int(), fawkes::Configuration::ValueIterator::is_list(), fawkes::Configuration::ValueIterator::is_string(), fawkes::Configuration::ValueIterator::is_uint(), fawkes::ArgumentParser::items(), fawkes::NetworkConfiguration::iterator(), fawkes::NetworkConfiguration::iterator_default(), fawkes::NetworkConfiguration::iterator_hostspecific(), fawkes::NetworkConfiguration::lock(), fawkes::Configuration::ValueIterator::next(), fawkes::ArgumentParser::parse_hostport(), fawkes::Configuration::ValueIterator::path(), fawkes::Exception::print_trace(), fawkes::ArgumentParser::program_name(), run(), fawkes::NetworkConfiguration::set_bool(), fawkes::NetworkConfiguration::set_comment(), fawkes::NetworkConfiguration::set_default_bool(), fawkes::NetworkConfiguration::set_default_comment(), fawkes::NetworkConfiguration::set_default_float(), fawkes::NetworkConfiguration::set_default_int(), fawkes::NetworkConfiguration::set_default_string(), fawkes::NetworkConfiguration::set_default_uint(), fawkes::NetworkConfiguration::set_float(), fawkes::NetworkConfiguration::set_int(), fawkes::NetworkConfiguration::set_mirror_mode(), fawkes::NetworkConfiguration::set_string(), fawkes::NetworkConfiguration::set_uint(), fawkes::Configuration::ValueIterator::type(), fawkes::NetworkConfiguration::unlock(), and fawkes::Configuration::ValueIterator::valid().

Referenced by run().


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