The producer of persistency triggers initiated by settings. Its task is (1) to initiate the storing of the persistent data of a FESA class into the persistency file after a setting, and (2) to protect against frequent writing into the persistency file when many settings are done one after the other (a burst). The producer gets triggerd by PersistencyManager::triggerWithDelay(), makes sure the burst is finished, and tells the consumer in PersistencyManager that it can store the data.
More...
#include <SettingsPersistencyTrigger.h>
The producer of persistency triggers initiated by settings. Its task is (1) to initiate the storing of the persistent data of a FESA class into the persistency file after a setting, and (2) to protect against frequent writing into the persistency file when many settings are done one after the other (a burst). The producer gets triggerd by PersistencyManager::triggerWithDelay(), makes sure the burst is finished, and tells the consumer in PersistencyManager that it can store the data.
fesa::SettingsPersistencyTrigger::SettingsPersistencyTrigger |
( |
PersistencyManager & |
persistencyManager, |
|
|
std::time_t |
delay, |
|
|
const boost::shared_ptr< Diagnostics > & |
diagnostics |
|
) |
| |
Constructor.
- Parameters
-
persistencyManager | The consumer of the triggers. To consume a trigger means to start storing the persistent data into the persistency file |
delay | The time interval within which there should be no new setting in order for a trigger to be produced, s. The delay is specified in fesa.cfg |
diagnostics | The diagnostics object for logging |
void fesa::SettingsPersistencyTrigger::registerPersistencyUnit |
( |
const std::string & |
className, |
|
|
const PersistencyUnit * |
persistencyUnit |
|
) |
| |
Registers a new persistency unit and checks that it can be persisted.
- Parameters
-
persistencyUnit | A persistency unit |
- Returns
- true if the persistency unit can be persisted or doesn't need to be persisted; false if it must be persisted but cannot.
void fesa::SettingsPersistencyTrigger::trigger |
( |
const std::string & |
className | ) |
|
Trigger the procedure to store the persistent data into the persistency file. This function is called by PersistencyManager::triggerWithDelay(). The data storing procedure will start only if there are no settings for the given time interval.
- Parameters
-
className | The name of the FESA class whose data are to be stored |
The documentation for this class was generated from the following files:
- SettingsPersistencyTrigger.h
- SettingsPersistencyTrigger.cpp