Base class for field-storage classes in the framework: Device, GlobalDevice and DomainStore. More...
#include <DataStore.h>
Public Member Functions | |
DataStore () | |
Constructor. | |
virtual | ~DataStore () |
destructor | |
const std::vector < AbstractField * > & | getFieldCollection () |
Method to retrieve the field collection of that data store. | |
const std::vector < AbstractField * > & | getPersistentFieldsCollection () |
Method to retrieve the setting field collection of that data store. | |
AbstractField * | getField (const std::string &name) |
Retrieves a pointer to a concrete field. | |
void | synchronizeSettingFields (MultiplexingContext &context) |
Synchronizes setting fields and swaps pending buffer to active buffer. | |
void | synchronizeSettingFields () |
Synchronizes all the setting fields and swaps pending buffer to active buffer no matter the context. | |
int32_t | getMemorySizeToAllocate () |
retrieve the size related to all the global fields that have to be allocated in memory | |
void | mapMemory (char *p, bool initializeFields) |
Protected Member Functions | |
void | initializeFromElement (DataStoreElement &element) |
this method initializes the data store with the element passed as a parameter | |
virtual void | initialize () |
This method initialize the datastore. | |
void | restoreFromElement (DataStoreElement &element) |
this method restores the data store with the element passed as a parameter | |
virtual void | registerField (AbstractField *pField) |
Registers a new field in the current field collection. | |
virtual int32_t | getSizeOfAdditionalFields () |
Get the size related to non-Fesa-type fields. | |
virtual void | mapAdditionalFields (char *p) |
Map the non-Fesa-type fields. | |
Protected Attributes | |
std::vector< AbstractField * > | pFieldCol_ |
field collection containing all fields of the data store | |
std::vector< AbstractField * > | persistentCol_ |
setting collection containg all the persistent fields | |
AbstractMutex * | pMutex_ |
mutex used to lock data store during synchronization of setting fields | |
uint32_t | numberOfSettingFields_ |
number of setting fields in data store | |
Private Member Functions | |
void | createMutex (char *pAddrMemory) |
Creates data store mutex. | |
Friends | |
class | HeapFactory |
class | DeviceFactoryImp |
class | ShmFactory |
class | AbstractField |
class | StoreManager |
Base class for field-storage classes in the framework: Device, GlobalDevice and DomainStore.
Definition at line 24 of file DataStore.h.
fesa::DataStore::DataStore | ( | ) |
Constructor.
Definition at line 28 of file DataStore.cpp.
fesa::DataStore::~DataStore | ( | ) | [virtual] |
destructor
Definition at line 34 of file DataStore.cpp.
void fesa::DataStore::createMutex | ( | char * | pAddrMemory | ) | [private] |
Creates data store mutex.
pAddrMemory | address in memory where mutex is created |
Definition at line 69 of file DataStore.cpp.
References fesa::AbstractEquipment::getInstance(), pMutex_, and fesa::unsplit.
Referenced by mapMemory().
AbstractField * fesa::DataStore::getField | ( | const std::string & | name | ) |
Retrieves a pointer to a concrete field.
name | name of the field |
Definition at line 57 of file DataStore.cpp.
References pFieldCol_.
Referenced by fesa::AbstractServerAction::checkInvalidatingFields(), and fesa::FieldExpression::match().
const std::vector< AbstractField * > & fesa::DataStore::getFieldCollection | ( | ) | [inline] |
Method to retrieve the field collection of that data store.
Definition at line 174 of file DataStore.h.
References pFieldCol_.
Referenced by fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::configureFields().
fesa::DataStore::getMemorySizeToAllocate | ( | ) |
retrieve the size related to all the global fields that have to be allocated in memory
Definition at line 150 of file DataStore.cpp.
References fesa::AbstractEquipment::getInstance(), fesa::AbstractMutex::getSize(), getSizeOfAdditionalFields(), pFieldCol_, and fesa::unsplit.
Referenced by fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::computeMemorySize().
const std::vector< AbstractField * > & fesa::DataStore::getPersistentFieldsCollection | ( | ) | [inline] |
Method to retrieve the setting field collection of that data store.
Definition at line 179 of file DataStore.h.
References persistentCol_.
Referenced by fesa::StoreManager::store().
int32_t fesa::DataStore::getSizeOfAdditionalFields | ( | ) | [protected, virtual] |
Get the size related to non-Fesa-type fields.
Reimplemented in fesa::AbstractDevice, and fesa::EquipmentData.
Definition at line 187 of file DataStore.cpp.
Referenced by getMemorySizeToAllocate(), and mapMemory().
void fesa::DataStore::initialize | ( | ) | [protected, virtual] |
This method initialize the datastore.
Reimplemented in fesa::AbstractDevice, and fesa::EquipmentData.
Definition at line 196 of file DataStore.cpp.
Referenced by initializeFromElement().
void fesa::DataStore::initializeFromElement | ( | DataStoreElement & | element | ) | [protected] |
this method initializes the data store with the element passed as a parameter
dataStoreElement | that contains the information |
Definition at line 120 of file DataStore.cpp.
References fesa::DataStoreElement::getFieldElement(), initialize(), and pFieldCol_.
void fesa::DataStore::mapAdditionalFields | ( | char * | p | ) | [protected, virtual] |
Map the non-Fesa-type fields.
Pointer | to the allocated memory |
Reimplemented in fesa::AbstractDevice, and fesa::EquipmentData.
Definition at line 192 of file DataStore.cpp.
Referenced by mapMemory().
void fesa::DataStore::mapMemory | ( | char * | p, | |
bool | initializeFields | |||
) |
Definition at line 169 of file DataStore.cpp.
References createMutex(), getSizeOfAdditionalFields(), mapAdditionalFields(), and pFieldCol_.
Referenced by fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::mapFields().
void fesa::DataStore::registerField | ( | AbstractField * | pField | ) | [protected, virtual] |
Registers a new field in the current field collection.
pField | pointer to the AbstractField to be registered in the field collection |
Definition at line 39 of file DataStore.cpp.
References fesa::AbstractField::getType(), fesa::AbstractField::isPersistent(), numberOfSettingFields_, persistentCol_, pFieldCol_, and fesa::Setting.
Referenced by fesa::AbstractField::AbstractField().
void fesa::DataStore::restoreFromElement | ( | DataStoreElement & | element | ) | [protected] |
this method restores the data store with the element passed as a parameter
dataStoreElement | that contains the information |
Definition at line 134 of file DataStore.cpp.
References fesa::DataStoreElement::getFieldElement(), and persistentCol_.
Referenced by fesa::StoreManager::restore().
void fesa::DataStore::synchronizeSettingFields | ( | ) |
Synchronizes all the setting fields and swaps pending buffer to active buffer no matter the context.
Definition at line 103 of file DataStore.cpp.
References numberOfSettingFields_, pFieldCol_, and pMutex_.
void fesa::DataStore::synchronizeSettingFields | ( | MultiplexingContext & | context | ) |
Synchronizes setting fields and swaps pending buffer to active buffer.
context | multiplexing context |
Definition at line 81 of file DataStore.cpp.
References fesa::MultiplexingContext::getType(), fesa::MultiplexingContext::NoneCtxt, numberOfSettingFields_, pFieldCol_, and pMutex_.
Referenced by fesa::AbstractServerDeviceClass::initialize(), fesa::AbstractRTDeviceClass::initialize(), fesa::ServiceLocatorServerSplitImplementation::synchronizeSettingFields(), fesa::ServiceLocatorRealtimeSplitImplementation::synchronizeSettingFields(), and fesa::ServiceLocatorUnsplitImplementation::synchronizeSettingFields().
friend class AbstractField [friend] |
Definition at line 163 of file DataStore.h.
friend class DeviceFactoryImp [friend] |
Definition at line 158 of file DataStore.h.
friend class HeapFactory [friend] |
Definition at line 155 of file DataStore.h.
friend class ShmFactory [friend] |
Definition at line 161 of file DataStore.h.
friend class StoreManager [friend] |
Definition at line 164 of file DataStore.h.
fesa::DataStore::numberOfSettingFields_ [protected] |
number of setting fields in data store
Definition at line 149 of file DataStore.h.
Referenced by registerField(), and synchronizeSettingFields().
std::vector<AbstractField*> fesa::DataStore::persistentCol_ [protected] |
setting collection containg all the persistent fields
Definition at line 136 of file DataStore.h.
Referenced by getPersistentFieldsCollection(), registerField(), and restoreFromElement().
std::vector<AbstractField*> fesa::DataStore::pFieldCol_ [protected] |
field collection containing all fields of the data store
Definition at line 131 of file DataStore.h.
Referenced by getField(), getFieldCollection(), getMemorySizeToAllocate(), initializeFromElement(), mapMemory(), registerField(), and synchronizeSettingFields().
fesa::DataStore::pMutex_ [protected] |
mutex used to lock data store during synchronization of setting fields
Definition at line 142 of file DataStore.h.
Referenced by createMutex(), and synchronizeSettingFields().