fesa::PersistencyManager Class Reference

this class is responsible for managing the persistency mechanism of the classes. More...

#include <PersistencyManager.h>

Inheritance diagram for fesa::PersistencyManager:
fesa::Thread

List of all members.

Public Member Functions

void registerPersistencyUnit (PersistencyUnit *pPersistencyUnit)
 this method adds a new persistence unit to the manager
void start ()
 starts the persistency process
void trigger (const std::string &className)
 this method triggers the store procedure that saves the persistent fields of the class passed as a parameter into the persistency file

Static Public Member Functions

static PersistencyManagergetInstance ()
 returns the unique object instance of this class in the system

Protected Member Functions

 PersistencyManager ()
void run ()
 this method contains the logic of the persistent manager
void store (PersistencyUnit &pPersistencyUnit)
 this method makes stores the information about the data stores contained in the persistent unit passed by parameter
virtual ~PersistencyManager ()
 destructor

Protected Attributes

ConditionalVariable triggerCondVar_
 conditional variable to trigger the persistency procedure
Mutex accessMutex_
 mutex to protect the access to the persistent units
std::map< const std::string,
PersistencyUnit * > 
persistencyUnitsCol_
 this hasmap contains all the persistent units
std::set< PersistencyUnit * > persistencySet_
 queue that stores the persistency units that have to be stored
uint32_t persistencyMaxDelay_
 delay of the persistency mechanism, it is triggered after persistencyMaxDelay seconds
bool isStarted_
 true if the persistent manager started
StoreManager storeManager_
 stores the persistent units
uint32_t counterOfTriggers_
 stores counters of persistent triggers The value is reset to zero when saving in a file. It is used to avoid that an avalanche of triggers produces a massive number of editions of the file.

Static Protected Attributes

static PersistencyManagertheInstance_ = NULL
 instance of the singleton object

Detailed Description

this class is responsible for managing the persistency mechanism of the classes.

Definition at line 25 of file PersistencyManager.h.


Constructor & Destructor Documentation

fesa::PersistencyManager::PersistencyManager (  )  [protected]
fesa::PersistencyManager::~PersistencyManager (  )  [protected, virtual]

destructor

Definition at line 45 of file PersistencyManager.cpp.

References persistencyUnitsCol_.


Member Function Documentation

PersistencyManager * fesa::PersistencyManager::getInstance (  )  [static]

returns the unique object instance of this class in the system

Returns:
the unique object instance of this class in the system

Definition at line 54 of file PersistencyManager.cpp.

References PersistencyManager(), and theInstance_.

Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute(), fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::initialize(), PersistencyManager(), fesa::AbstractServerController::start(), and start().

void fesa::PersistencyManager::registerPersistencyUnit ( PersistencyUnit pPersistencyUnit  ) 

this method adds a new persistence unit to the manager

Parameters:
pPersistencyUnit the persistence unit that will be added

Definition at line 32 of file PersistencyManager.cpp.

References fesa::GlobalDevice::className, fesa::ConfigFieldString::getAsString(), fesa::PersistencyUnit::getGlobalDevice(), and persistencyUnitsCol_.

void fesa::PersistencyManager::run (  )  [protected, virtual]
void fesa::PersistencyManager::start (  ) 
void fesa::PersistencyManager::store ( PersistencyUnit pPersistencyUnit  )  [protected]

this method makes stores the information about the data stores contained in the persistent unit passed by parameter

Parameters:
pPersistencyUnit containing the DataStore objects that will be stored
void fesa::PersistencyManager::trigger ( const std::string &  className  ) 

this method triggers the store procedure that saves the persistent fields of the class passed as a parameter into the persistency file

Parameters:
className name of the class from which the persistent fields will be stored

Definition at line 82 of file PersistencyManager.cpp.

References accessMutex_, counterOfTriggers_, persistencySet_, persistencyUnitsCol_, fesa::ConditionalVariable::signal(), and triggerCondVar_.

Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute().


Member Data Documentation

mutex to protect the access to the persistent units

Definition at line 82 of file PersistencyManager.h.

Referenced by run(), and trigger().

stores counters of persistent triggers The value is reset to zero when saving in a file. It is used to avoid that an avalanche of triggers produces a massive number of editions of the file.

Definition at line 120 of file PersistencyManager.h.

Referenced by run(), and trigger().

true if the persistent manager started

Definition at line 107 of file PersistencyManager.h.

Referenced by start().

delay of the persistency mechanism, it is triggered after persistencyMaxDelay seconds

Definition at line 97 of file PersistencyManager.h.

Referenced by PersistencyManager(), and run().

queue that stores the persistency units that have to be stored

Definition at line 92 of file PersistencyManager.h.

Referenced by run(), and trigger().

std::map<const std::string, PersistencyUnit*> fesa::PersistencyManager::persistencyUnitsCol_ [protected]

this hasmap contains all the persistent units

Definition at line 87 of file PersistencyManager.h.

Referenced by registerPersistencyUnit(), trigger(), and ~PersistencyManager().

stores the persistent units

Definition at line 112 of file PersistencyManager.h.

Referenced by run().

instance of the singleton object

Definition at line 58 of file PersistencyManager.h.

Referenced by getInstance().

conditional variable to trigger the persistency procedure

Definition at line 77 of file PersistencyManager.h.

Referenced by run(), and trigger().


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1