Thread aspect to access configuration data. More...
#include <>>
Public Member Functions | |
virtual | ~ConfigurableAspect () |
Virtual empty Destructor. | |
void | init_ConfigurableAspect (Configuration *config) |
Set the configuration It is guaranteed that this is called for a configurable thread before Thread::start() is called (when running regularly inside Fawkes). | |
Protected Attributes | |
Configuration * | config |
This is the Configuration member used to access the configuration. |
Thread aspect to access configuration data.
Give this aspect to your thread to gain access to the configuration. This aspects defines a thread as being configurable. It is guaranteed that if used properly from within plugins that setConfiguration() is called before the thread is started and that you can access the configuration via the config member.
It is higly recommended to also implement ConfigurationChangeHandler to get notified about configuration changes as soon as they happen. All threads which are configurable shall react immediately to config changes and use the new configuration. Therefore all inner structures shall be updated as necessary and member reinitialized if needed. Only this way no restart or at least plugin load/unload cycle is needed anymore to change the configuration. This should tremendously help to decrease debugging, testing and parameter tuning time!
Definition at line 31 of file configurable.h.
fawkes::ConfigurableAspect::~ConfigurableAspect | ( | ) | [virtual] |
Virtual empty Destructor.
Definition at line 57 of file configurable.cpp.
void fawkes::ConfigurableAspect::init_ConfigurableAspect | ( | Configuration * | config | ) |
Set the configuration It is guaranteed that this is called for a configurable thread before Thread::start() is called (when running regularly inside Fawkes).
config | Configuration instance to use. |
Definition at line 68 of file configurable.cpp.
Referenced by fawkes::AspectIniFin::init().
Configuration * fawkes::ConfigurableAspect::config [protected] |
This is the Configuration member used to access the configuration.
The configuration will remain valid for the whole lifetime of the thread.
Definition at line 39 of file configurable.h.