fesa::DataStore Class Reference

Base class for field-storage classes in the framework: Device, GlobalDevice and DomainStore. More...

#include <DataStore.h>

Inheritance diagram for fesa::DataStore:
fesa::AbstractDevice fesa::DomainStore fesa::EquipmentData fesa::GlobalDevice

List of all members.

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.
AbstractFieldgetField (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
AbstractMutexpMutex_
 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

Detailed Description

Base class for field-storage classes in the framework: Device, GlobalDevice and DomainStore.

Definition at line 24 of file DataStore.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

void fesa::DataStore::createMutex ( char *  pAddrMemory  )  [private]

Creates data store mutex.

Parameters:
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.

Parameters:
name name of the field
Returns:
a AbstractField pointer to the field searched.

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.

Returns:
a vector of AbstractFields containing all the fields

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

Returns:
size 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.

Returns:
a vector of AbstractFields containing all the setting fields

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.

Returns:
The size related to specific 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

Parameters:
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.

Parameters:
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 
)
void fesa::DataStore::registerField ( AbstractField pField  )  [protected, virtual]

Registers a new field in the current field collection.

Parameters:
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

Parameters:
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  ) 

Friends And Related Function Documentation

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.


Member Data Documentation

number of setting fields in data store

Definition at line 149 of file DataStore.h.

Referenced by registerField(), and synchronizeSettingFields().

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().

mutex used to lock data store during synchronization of setting fields

Definition at line 142 of file DataStore.h.

Referenced by createMutex(), and synchronizeSettingFields().


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1