18 #define DATASVC_MULTISTORESVC_CPP
42 typedef const std::string
CSTR;
54 Partition() : dataProvider(0), dataManager(0)
57 Partition(
const Partition& entry)
58 : dataProvider(entry.dataProvider),
59 dataManager(entry.dataManager),
63 Partition& operator=(
const Partition& entry) {
64 dataProvider = entry.dataProvider;
65 dataManager = entry.dataManager;
132 #define _CALL(P,F,ARGS) \
133 P ? P->F ARGS : IDataProviderSvc::INVALID_ROOT
185 Partitions::iterator
i;
187 (*i).second.dataManager->clearStore().ignore();
261 Partitions::iterator
i;
262 if ( 0 != pDataLoader ) pDataLoader->
addRef();
264 if ( 0 != pDataLoader ) {
269 (*i).second.dataManager->setDataLoader(
m_dataLoader).ignore();
445 return create(nam, typ, pPartition);
461 p.dataManager = dataMgr;
462 p.dataProvider = dataProv;
463 p.dataManager->addRef();
464 p.dataProvider->addRef();
485 if ( (*i).second.dataManager ==
m_current.dataManager ) {
488 (*i).second.dataManager->clearStore().ignore();
489 (*i).second.dataProvider->release();
490 (*i).second.dataManager->release();
501 Partitions::iterator
i;
503 if ( (*i).second.dataProvider == provider ) {
504 (*i).second.dataManager->clearStore().ignore();
505 (*i).second.dataProvider->release();
506 (*i).second.dataManager->release();
532 Partitions::iterator
i;
534 if ( (*i).second.dataProvider == provider ) {
548 pPartition = (*i).second.dataProvider;
573 <<
"Failed to retrieve data loader "
581 log <<
MSG::ERROR <<
"Failed to retrieve data loader "
588 log <<
MSG::ERROR <<
"Failed to set data loader "
613 log <<
MSG::ERROR <<
"Failed to connect to all store partitions." <<
endmsg;
624 log <<
MSG::ERROR <<
"Enable to reinitialize base class"
693 sc = (*i).second.dataManager->setRoot(
m_root.
path, pAdd);
701 sc = (*i).second.dataManager->setRoot(
m_root.
path, pObj);
718 Partitions::iterator
i;
720 (*i).second.dataManager->clearStore().ignore();
721 (*i).second.dataProvider->release();
722 (*i).second.dataManager->release();
730 std::string typ, nam;
731 PartitionDefs::iterator j;
735 Tokenizer::Items::iterator
i;
736 tok.
analyse(*j,
" ",
"",
"",
"=",
"'",
"'");
737 for(i = tok.
items().begin(); i != tok.
items().end(); i++ ) {
738 CSTR& t = (*i).tag();
739 CSTR& v = (*i).value();
virtual STATUS resetPreLoad()
Clear the preload list.
virtual const std::string * par() const =0
Retrieve String parameters.
virtual STATUS unlinkObject(IRegistry *from, CSTR &objPath)
Remove a link to another object.
virtual STATUS activate(IInterface *pPartition)
Activate a partition object.
Definition of the MsgStream class used to transmit messages.
virtual STATUS initialize()
Service initialisation.
virtual STATUS reinitialize()
Service initialisation.
virtual STATUS retrieveObject(CSTR &parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
std::string rootName() const
Name for root Event.
virtual STATUS objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves)
Explore the object store: retrieve all leaves attached to the object.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual STATUS registerObject(CSTR &parent, CSTR &obj, OBJECT *pObj)
Register object with the data store.
Partitions m_partitions
Datastore partitions.
virtual STATUS clearSubTree(OBJECT *pObject)
Remove all data objects below the sub tree identified.
virtual STATUS setRoot(CSTR &path, OBJECT *pObj)
Initialize data store for new event by giving new event path and root object.
PartitionDefs m_partitionDefs
Datastore partition definitions.
virtual STATUS clearSubTree(CSTR &path)
Remove all data objects below the sub tree identified.
Items & items()
Access token collection.
Requested interface is not available.
virtual STATUS findObject(OBJECT *parent, int item, OBJECT *&pObject)
Find object in the data store.
virtual STATUS setDataLoader(IConversionSvc *pDataLoader)
IDataManagerSvc: Pass a default data loader to the service.
virtual STATUS traverseSubTree(CSTR &path, AGENT *pAgent)
Analyze by traversing all data objects below the sub tree.
virtual STATUS registerObject(CSTR &path, OBJECT *pObj)
Register object with the data store.
virtual STATUS traverseTree(AGENT *pAgent)
IDataManagerSvc: Analyze by traversing all data objects in the data store.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
virtual STATUS updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
virtual STATUS linkObject(OBJECT *from, CSTR &objPath, OBJECT *to)
Add a link to another object.
virtual STATUS activate(CSTR &nam)
Activate a partition object. The name identifies the partition uniquely.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Normal successful completion.
virtual STATUS registerObject(OBJECT *parent, CSTR &obj, OBJECT *pObj)
Register object with the data store.
virtual STATUS retrieveObject(CSTR &parent, int item, OBJECT *&pObj)
Retrieve object from data store.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual STATUS removePreLoadItem(CSTR &item)
Add an item to the preload list.
virtual STATUS updateObject(OBJECT *pObj)
Update object.
IAddressCreator interface definition.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
virtual STATUS findObject(CSTR &parent, CSTR &path, OBJECT *&pObj)
Find object in the data store.
virtual STATUS unregisterObject(CSTR &parent, CSTR &obj)
Unregister object from the data store.
virtual STATUS retrieveObject(CSTR &path, OBJECT *&pObj)
Retrieve object identified by its full path from the data store.
virtual STATUS retrieveObject(OBJECT *parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
virtual STATUS finalize()
Service initialisation.
virtual STATUS findObject(OBJECT *parent, CSTR &path, OBJECT *&pObject)
Find object in the data store.
virtual STATUS unregisterObject(OBJECT *pObj, CSTR &path)
Unregister object from the data store.
virtual unsigned long release()=0
release reference to object
Data provider interface definition.
virtual STATUS clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Description of the DataStoreItem class.
virtual long svcType() const =0
Retrieve service type.
std::string m_rootName
Name of root event.
Base class used to extend a class implementing other interfaces.
#define DECLARE_COMPONENT(type)
virtual STATUS create(CSTR &nam, CSTR &typ, IInterface *&pPartition)
Create a partition object. The name identifies the partition uniquely.
virtual STATUS drop(CSTR &nam)
Drop a partition object. The name identifies the partition uniquely.
virtual STATUS findObject(CSTR &path, OBJECT *&pObj)
Find object identified by its full path in the data store.
IConversionSvc * m_dataLoader
Pointer to data loader service.
std::vector< std::string > PartitionDefs
virtual STATUS unlinkObject(CSTR &from, CSTR &objPath)
Remove a link to another object.
virtual STATUS addPreLoadItem(const DataStoreItem &item)
Add an item to the preload list.
STATUS makePartitions()
Create all partitions according to job options.
virtual STATUS findObject(IRegistry *parent, CSTR &path, OBJECT *&pObj)
Find object identified by its full path in the data store.
Helper class to parse a string of format "type/name".
virtual const CLID & clID() const
Retrieve reference to class definition structure.
bool isValid() const
Allow for check if smart pointer is valid.
virtual const CLID & clID() const =0
Retrieve class information from link.
virtual STATUS preLoad()
load all preload items of the list
virtual STATUS objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves)
Explore the object store: retrieve all leaves attached to the object.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
struct MultiStoreSvc::tagROOT m_root
virtual STATUS updateObject(CSTR &parent, CSTR &updatePath)
Update object.
virtual STATUS unregisterObject(CSTR &path)
Unregister object from the data store.
virtual STATUS objectParent(const OBJECT *pObject, IRegistry *&refpParent)
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual STATUS unlinkObject(OBJECT *from, CSTR &objPath)
Remove a link to another object.
virtual STATUS registerAddress(IRegistry *parent, CSTR &path, ADDRESS *pAdd)
IDataManagerSvc: Register object address with the data store.
IAddressCreator * m_addrCreator
Reference to address creator.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual STATUS retrieveObject(IRegistry *parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
virtual STATUS addPreLoadItem(CSTR &item)
Add an item to the preload list.
virtual STATUS findObject(CSTR &parent, int item, OBJECT *&pObject)
Find object in the data store.
MultiStoreSvc(CSTR &name, ISvcLocator *svc)
Standard Constructor.
STATUS clearPartitions()
Clear all partitions.
unsigned int CLID
Class ID definition.
#define _CALL(P, F, ARGS)
union MultiStoreSvc::tagROOT::@1 root
std::string m_loader
Data loader name.
virtual const std::string & name() const
Retrieve name of the service.
Partition m_current
Current partition.
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
virtual STATUS registerObject(CSTR &parent, int item, OBJECT *pObj)
Register object with the data store.
STATUS preparePartitions()
Prepare partition for usage.
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
virtual unsigned long release()
release reference to object
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Generic data agent interface.
virtual STATUS linkObject(CSTR &from, CSTR &objPath, OBJECT *to)
Add a link to another object.
virtual STATUS drop(IInterface *pPartition)
Drop a partition object. The name identifies the partition uniquely.
virtual STATUS unregisterAddress(IRegistry *pParent, CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
virtual STATUS unregisterAddress(OBJECT *pParent, CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
virtual STATUS setRoot(CSTR &path, ADDRESS *pAddr)
Initialize data store for new event by giving new event path and address of root object.
virtual STATUS retrieveObject(OBJECT *parent, int item, OBJECT *&pObj)
Retrieve object from data store.
virtual STATUS linkObject(CSTR &fullPath, OBJECT *to)
Add a link to another object.
virtual STATUS create(CSTR &nam, CSTR &typ)
Create a partition object. The name identifies the partition uniquely.
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
virtual STATUS unregisterAddress(CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
Templated class to add the standard messaging functionalities.
virtual STATUS registerObject(OBJECT *parent, int obj, OBJECT *pObj)
Register object with the data store.
virtual STATUS registerAddress(CSTR &path, ADDRESS *pAddr)
IDataManagerSvc: Register object address with the data store.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
virtual STATUS registerAddress(OBJECT *parent, CSTR &path, ADDRESS *pAddr)
IDataManagerSvc: Register object address with the data store.
virtual CLID rootCLID() const
IDataManagerSvc: Accessor for root event CLID.
virtual ~MultiStoreSvc()
Standard Destructor.
virtual STATUS updateObject(OBJECT *parent, CSTR &updatePath)
Update object.
virtual STATUS updateObject(CSTR &path)
Update object.
Opaque address interface definition.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
virtual STATUS unlinkObject(CSTR &path)
Remove a link to another object.
std::map< std::string, Partition > Partitions
A DataObject is the base class of any identifiable object on any data store.
std::string m_defaultPartition
Default partition.
virtual StatusCode activePartition(std::string &nam, IInterface *&pPartition) const
Access the active partition object.
virtual STATUS removePreLoadItem(const DataStoreItem &item)
Remove an item from the preload list.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
virtual STATUS unregisterObject(OBJECT *pObj)
Unregister object from the data store.
void toupper(std::string &s)
virtual STATUS traverseSubTree(OBJECT *pObject, AGENT *pAgent)
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
virtual STATUS unregisterObject(CSTR &parent, int obj)
Unregister object from the data store.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
virtual STATUS linkObject(IRegistry *from, CSTR &objPath, OBJECT *to)
Add a link to another object.
virtual STATUS objectParent(const IRegistry *pObject, IRegistry *&refpParent)
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual unsigned long addRef()=0
Add reference to object.
virtual STATUS unregisterObject(OBJECT *pObj, int item)
Unregister object from the data store.