fesa-core
4.0.0
|
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>
Public Member Functions | |
SettingsPersistencyTrigger (PersistencyManager &persistencyManager, std::time_t delay, const boost::shared_ptr< Diagnostics > &diagnostics) | |
Constructor. More... | |
void | registerPersistencyUnit (const std::string &className, const PersistencyUnit *persistencyUnit) |
Register a new persistency unit. This is done at initialization time for every FESA class. More... | |
void | 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. More... | |
![]() | |
Thread () | |
Constructor. More... | |
virtual | ~Thread () |
Destructor. | |
void | setDetachState (int32_t state) |
Modify the detach state of the thread. More... | |
void | start (bool blockingMode, const std::string &threadName, bool permanent=true) |
virtual void | stop () |
Stop the thread. | |
int | join (void **status) |
bool | isRunning () const |
Check if the thread is running. More... | |
pthread_t | getID () const |
Get the process ID. More... | |
int32_t | getPriority () const |
Get the priority of the thread. More... | |
cpu_set_t | getAffinity () const |
Get the affinity of the thread. | |
void | setPriority (int32_t priority) |
Set the priority of the thread. More... | |
void | setAffinity (cpu_set_t affinity) |
Set the affinity of the thread. More... | |
Additional Inherited Members | |
![]() | |
static void | AdjustProcessScheduling () |
The process priority can only be adjusted in the main thread. It needs to be adjusted to the maximal thread priority since it sets the limit of the thread priorities of this process. More... | |
static std::string | getThreadName (pthread_t threadId) |
Get the name of the thread by its id. More... | |
static std::string | getCurrentThreadName () |
static void | registerThreadIdName (pthread_t threadId, const std::string &threadName) |
Associate a thread id with a name. More... | |
static void | registerThreadId (pthread_t threadId, Thread *thread) |
Associate a thread id with a name. More... | |
static Thread * | current () |
Returns the Thread object associated with the current thread. | |
static Thread * | getById (pthread_t id) |
Returns the Thread object associated with the given id. Throws FesaException if the id is unknown. More... | |
static const std::set< const Thread * > | getThreads () |
![]() | |
bool | isRunning_ |
true if the thread is running | |
bool | hasFinished_ |
true if the thread has finished. | |
bool | permanent_ |
pthread_t | tid_ |
Id of this thread. | |
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.
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 | ||
) |
Register a new persistency unit. This is done at initialization time for every FESA class.
persistencyUnit | A persistency unit |
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.
className | The name of the FESA class whose data are to be stored |