this class is responsible for storing and restoring devices of a class from a persistency mechanism More...
#include <StoreManager.h>
Public Member Functions | |
StoreManager () | |
constructor | |
~StoreManager () | |
destructor | |
void | restore (GlobalDevice &globalDevice, std::vector< AbstractDevice * > &deviceCol, std::vector< DomainStore * > &domainStoreCol, const std::string &className) |
this method fills the objects passed as parameters with the information in the persistent system of the equipment | |
void | store (PersistencyUnit &pu) |
this method makes stores the information about the data stores contained in the persistent unit passed by parameter | |
Private Member Functions | |
void | storeFields (XMLParser &parser, const std::vector< AbstractField * > &fields, std::string dataStore) |
this method stores into the parser the fields passed by argument | |
GlobalDeviceElement * | retrieveGlobalDeviceElement (XMLParser &parser) |
return the global device element from the persistency | |
std::vector< DeviceElement * > * | retrieveDeviceElements (XMLParser &parser) |
return the devices from from the initialization system (instance file) | |
std::vector < DomainStoreElement * > * | retrieveDomainStoreElements (XMLParser &parser) |
return the devices from from the initialization system (instance file) | |
void | fillElements (ElementXML *dataStoreXML, DataStoreElement *dataStoreElement) |
Static Private Attributes | |
static const std::string | GLOBAL_DEVICE_TAG = "global-instance" |
static const std::string | DEVICE_INSTANCE_TAG = "device-instance" |
static const std::string | DOMAIN_STORE_TAG = "domain-data" |
this class is responsible for storing and restoring devices of a class from a persistency mechanism
Definition at line 29 of file StoreManager.h.
fesa::StoreManager::StoreManager | ( | ) |
constructor
Definition at line 22 of file StoreManager.cpp.
fesa::StoreManager::~StoreManager | ( | ) |
destructor
Definition at line 26 of file StoreManager.cpp.
void fesa::StoreManager::fillElements | ( | ElementXML * | dataStoreXML, | |
DataStoreElement * | dataStoreElement | |||
) | [private] |
Definition at line 411 of file StoreManager.cpp.
References fesa::DataStoreElement::addFieldElement(), fesa::ElementXML::attributeList_, fesa::ElementXML::childList_, fesa::FieldElement::cyclesNamesCol_, FesaErrorLoadGlobalDeviceElement, fesa::FieldElement::fieldExtraValuesCol_, fesa::FieldElement::fieldValuesCol_, fesa::FieldElement::fromPersistency_, fesa::AttributeXML::name_, fesa::ElementXML::name_, and fesa::AttributeXML::value_.
Referenced by retrieveDeviceElements(), retrieveDomainStoreElements(), and retrieveGlobalDeviceElement().
void fesa::StoreManager::restore | ( | GlobalDevice & | globalDevice, | |
std::vector< AbstractDevice * > & | deviceCol, | |||
std::vector< DomainStore * > & | domainStoreCol, | |||
const std::string & | className | |||
) |
this method fills the objects passed as parameters with the information in the persistent system of the equipment
globalDevice | of the class | |
deviceCol | devices of the class | |
domainCol | domain stores of the class | |
className | to access the persistent system |
Definition at line 30 of file StoreManager.cpp.
References FesaErrorDataStoreElementRetrievingFieldElement, FesaErrorRestoringDevices, FesaErrorRestoringDomainStores, FesaErrorRestoringGlobalDevice, fesa::FesaException::getFileName(), fesa::AbstractEquipment::getInstance(), fesa::FesaException::getLineNumber(), fesa::AbstractEquipment::getPersistencyFileName(), fesa::DataStore::restoreFromElement(), retrieveDeviceElements(), retrieveDomainStoreElements(), and retrieveGlobalDeviceElement().
Referenced by fesa::DeviceFactoryImp< GlobalDeviceType, DomainStoreType, DevInstType >::initialize().
std::vector< DeviceElement * > * fesa::StoreManager::retrieveDeviceElements | ( | XMLParser & | parser | ) | [private] |
return the devices from from the initialization system (instance file)
Definition at line 315 of file StoreManager.cpp.
References fesa::ElementXML::attributeList_, DEVICE_INSTANCE_TAG, fesa::XMLParser::extractElements(), FesaErrorLoadDeviceElements, fillElements(), and fesa::AttributeXML::value_.
Referenced by restore().
std::vector< DomainStoreElement * > * fesa::StoreManager::retrieveDomainStoreElements | ( | XMLParser & | parser | ) | [private] |
return the devices from from the initialization system (instance file)
Definition at line 367 of file StoreManager.cpp.
References fesa::ElementXML::attributeList_, DOMAIN_STORE_TAG, fesa::XMLParser::extractElements(), FesaErrorLoadDomainStoreElements, fillElements(), and fesa::AttributeXML::value_.
Referenced by restore().
GlobalDeviceElement * fesa::StoreManager::retrieveGlobalDeviceElement | ( | XMLParser & | parser | ) | [private] |
return the global device element from the persistency
Definition at line 274 of file StoreManager.cpp.
References fesa::XMLParser::extractAttribute(), fesa::XMLParser::extractElements(), fillElements(), GLOBAL_DEVICE_TAG, and fesa::AttributeXML::value_.
Referenced by restore().
void fesa::StoreManager::store | ( | PersistencyUnit & | pu | ) |
this method makes stores the information about the data stores contained in the persistent unit passed by parameter
pPersistencyUnit | containing the DataStore objects that will be stored |
Definition at line 119 of file StoreManager.cpp.
References fesa::GlobalDevice::className, fesa::XMLParser::createFile(), DEVICE_INSTANCE_TAG, DOMAIN_STORE_TAG, fesa::XMLParser::endDocument(), fesa::XMLParser::endElement(), fesa::GlobalDevice::fecName, fesa::ConfigFieldString::getAsString(), fesa::PersistencyUnit::getDeviceCollection(), fesa::PersistencyUnit::getDomainStoreCollection(), fesa::PersistencyUnit::getGlobalDevice(), fesa::AbstractDevice::getName(), fesa::PersistencyUnit::getPersistencyFileName(), fesa::DataStore::getPersistentFieldsCollection(), GLOBAL_DEVICE_TAG, fesa::XMLParser::startDocument(), fesa::XMLParser::startElement(), storeFields(), fesa::GlobalDevice::version, fesa::XMLParser::writeAttribute(), and fesa::XMLParser::writeNewline().
Referenced by fesa::PersistencyManager::run().
void fesa::StoreManager::storeFields | ( | XMLParser & | parser, | |
const std::vector< AbstractField * > & | fields, | |||
std::string | dataStore | |||
) | [private] |
this method stores into the parser the fields passed by argument
fields | to store | |
dataStore | tag that represents the datastore that contains the fields |
Definition at line 187 of file StoreManager.cpp.
References fesa::FieldElement::cyclesNamesCol_, fesa::XMLParser::endElement(), fesa::FieldElement::fieldExtraValuesCol_, fesa::FieldElement::fieldValuesCol_, fesa::XMLParser::startElement(), fesa::StringUtilities::toString(), fesa::XMLParser::writeAttribute(), and fesa::XMLParser::writeNewline().
Referenced by store().
const std::string fesa::StoreManager::DEVICE_INSTANCE_TAG = "device-instance" [static, private] |
Definition at line 88 of file StoreManager.h.
Referenced by retrieveDeviceElements(), and store().
const std::string fesa::StoreManager::DOMAIN_STORE_TAG = "domain-data" [static, private] |
Definition at line 89 of file StoreManager.h.
Referenced by retrieveDomainStoreElements(), and store().
const std::string fesa::StoreManager::GLOBAL_DEVICE_TAG = "global-instance" [static, private] |
Definition at line 87 of file StoreManager.h.
Referenced by retrieveGlobalDeviceElement(), and store().