Class that manages the synchronization of persistent fields. More...
#include <FieldSynchroManager.h>
Public Member Functions | |
void | registerModifiedField (MultiplexingContext *pContext, DataStore *pDataStore, bool isShared, FieldValueBase *pFieldValue) |
void | commitModifiedFieldSynchronization (MultiplexingContext *context) |
void | abortModifiedFieldSynchronization (MultiplexingContext *context) |
void | commitModifiedFieldSynchronization () |
Sets toBeSync flag of fields for the slot and multiplexing context that is registered in the map recentlyModifiedFields_. After the setting of the flag the field, slot and multiplexing context combination is deleted from the map. | |
Static Public Member Functions | |
static FieldSynchroManager * | getInstance () |
Return single instance of field synchronization manager. Creates instance if it does not exist. | |
Protected Member Functions | |
FieldSynchroManager () | |
Constructor. | |
Static Protected Attributes | |
static FieldSynchroManager * | theInstance_ = NULL |
Private Types | |
typedef std::pair < FieldValueBase *, bool > | PairFieldValueShared |
typedef std::set < PairFieldValueShared > | SetPairFieldValueShared |
typedef std::map< DataStore *, SetPairFieldValueShared > | MapDataStoreSetOfPairs |
typedef std::map< const MultiplexingContext *, MapDataStoreSetOfPairs > | MapModifiedFields |
Private Attributes | |
MapModifiedFields | recentlyModifiedFields_ |
Mutex | mutex_ |
mutex used to lock recentlyModifiedFields_ during registering and committing of synchronized fields |
Class that manages the synchronization of persistent fields.
Definition at line 22 of file FieldSynchroManager.h.
typedef std::map<DataStore*, SetPairFieldValueShared> fesa::FieldSynchroManager::MapDataStoreSetOfPairs [private] |
Definition at line 92 of file FieldSynchroManager.h.
typedef std::map<const MultiplexingContext*, MapDataStoreSetOfPairs> fesa::FieldSynchroManager::MapModifiedFields [private] |
Definition at line 97 of file FieldSynchroManager.h.
typedef std::pair<FieldValueBase*, bool> fesa::FieldSynchroManager::PairFieldValueShared [private] |
Definition at line 83 of file FieldSynchroManager.h.
typedef std::set<PairFieldValueShared> fesa::FieldSynchroManager::SetPairFieldValueShared [private] |
Definition at line 88 of file FieldSynchroManager.h.
fesa::FieldSynchroManager::FieldSynchroManager | ( | ) | [protected] |
void fesa::FieldSynchroManager::abortModifiedFieldSynchronization | ( | MultiplexingContext * | context | ) |
Definition at line 87 of file FieldSynchroManager.cpp.
References mutex_, and recentlyModifiedFields_.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute().
fesa::FieldSynchroManager::commitModifiedFieldSynchronization | ( | ) |
Sets toBeSync flag of fields for the slot and multiplexing context that is registered in the map recentlyModifiedFields_. After the setting of the flag the field, slot and multiplexing context combination is deleted from the map.
Sets toBeSync flag of fields, for all the multiplexing contexts, that are registered in the map recentlyModifiedFields_. After the setting of the flag, the field, slot and multiplexing context combination is deleted from the map.
pContext | multiplexing context of set method |
Definition at line 117 of file FieldSynchroManager.cpp.
References mutex_, and recentlyModifiedFields_.
void fesa::FieldSynchroManager::commitModifiedFieldSynchronization | ( | MultiplexingContext * | context | ) |
Definition at line 55 of file FieldSynchroManager.cpp.
References mutex_, and recentlyModifiedFields_.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute(), fesa::AbstractServerDeviceClass::initialize(), fesa::AbstractRTDeviceClass::initialize(), fesa::AbstractAction::triggerAllAutomaticallyTriggeredOnDemandEventSources(), and fesa::AbstractAction::triggerAllOnDemandEventSources().
fesa::FieldSynchroManager::getInstance | ( | ) | [static] |
Return single instance of field synchronization manager. Creates instance if it does not exist.
Definition at line 20 of file FieldSynchroManager.cpp.
References FieldSynchroManager(), and theInstance_.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute(), fesa::AbstractServerDeviceClass::initialize(), fesa::AbstractRTDeviceClass::initialize(), fesa::AbstractField::registerModifiedField(), fesa::AbstractAction::triggerAllAutomaticallyTriggeredOnDemandEventSources(), fesa::AbstractAction::triggerAllOnDemandEventSources(), and fesa::AbstractAction::triggerOnDemandEventSource().
void fesa::FieldSynchroManager::registerModifiedField | ( | MultiplexingContext * | pContext, | |
DataStore * | pDataStore, | |||
bool | isShared, | |||
FieldValueBase * | pFieldValue | |||
) |
Definition at line 29 of file FieldSynchroManager.cpp.
References mutex_, and recentlyModifiedFields_.
Referenced by fesa::AbstractField::registerModifiedField().
fesa::FieldSynchroManager::mutex_ [private] |
mutex used to lock recentlyModifiedFields_ during registering and committing of synchronized fields
Definition at line 108 of file FieldSynchroManager.h.
Referenced by abortModifiedFieldSynchronization(), commitModifiedFieldSynchronization(), and registerModifiedField().
Definition at line 102 of file FieldSynchroManager.h.
Referenced by abortModifiedFieldSynchronization(), commitModifiedFieldSynchronization(), and registerModifiedField().
FieldSynchroManager * fesa::FieldSynchroManager::theInstance_ = NULL [static, protected] |
Definition at line 77 of file FieldSynchroManager.h.
Referenced by getInstance().