The Gaudi Framework  v29r0 (ff2e7097)
MultiStoreSvc Class Reference

Data service base class. More...

Inheritance diagram for MultiStoreSvc:
Collaboration diagram for MultiStoreSvc:

Classes

struct  tagROOT
 

Public Member Functions

CLID rootCLID () const override
 IDataManagerSvc: Accessor for root event CLID. More...
 
const std::stringrootName () const override
 Name for root Event. More...
 
STATUS registerAddress (CSTR &path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS registerAddress (OBJECT *parent, CSTR &path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS registerAddress (IRegistry *parent, CSTR &path, ADDRESS *pAdd) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS unregisterAddress (CSTR &path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
STATUS unregisterAddress (OBJECT *pParent, CSTR &path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
STATUS unregisterAddress (IRegistry *pParent, CSTR &path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
STATUS objectLeaves (const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
 Explore the object store: retrieve all leaves attached to the object. More...
 
STATUS objectLeaves (const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
 Explore the object store: retrieve all leaves attached to the object. More...
 
STATUS objectParent (const OBJECT *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
STATUS objectParent (const IRegistry *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
STATUS clearSubTree (CSTR &path) override
 Remove all data objects below the sub tree identified. More...
 
STATUS clearSubTree (OBJECT *pObject) override
 Remove all data objects below the sub tree identified. More...
 
STATUS clearStore () override
 IDataManagerSvc: Remove all data objects in the data store. More...
 
STATUS traverseSubTree (CSTR &path, AGENT *pAgent) override
 Analyze by traversing all data objects below the sub tree. More...
 
STATUS traverseSubTree (OBJECT *pObject, AGENT *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
STATUS traverseTree (AGENT *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
STATUS setRoot (std::string path, OBJECT *pObj) override
 Initialize data store for new event by giving new event path and root object. More...
 
STATUS setRoot (std::string path, ADDRESS *pAddr) override
 Initialize data store for new event by giving new event path and address of root object. More...
 
STATUS setDataLoader (IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
 IDataManagerSvc: Pass a default data loader to the service. More...
 
STATUS addPreLoadItem (const DataStoreItem &item) override
 Add an item to the preload list. More...
 
STATUS addPreLoadItem (CSTR &item) override
 Add an item to the preload list. More...
 
STATUS removePreLoadItem (const DataStoreItem &item) override
 Remove an item from the preload list. More...
 
STATUS removePreLoadItem (CSTR &item) override
 Add an item to the preload list. More...
 
STATUS resetPreLoad () override
 Clear the preload list. More...
 
STATUS preLoad () override
 load all preload items of the list More...
 
STATUS registerObject (CSTR &path, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (CSTR &parent, CSTR &obj, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (CSTR &parent, int item, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (OBJECT *parent, CSTR &obj, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (OBJECT *parent, int obj, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS unregisterObject (CSTR &path) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (CSTR &parent, CSTR &obj) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (CSTR &parent, int obj) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (OBJECT *pObj) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (OBJECT *pObj, CSTR &path) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (OBJECT *pObj, int item) override
 Unregister object from the data store. More...
 
STATUS retrieveObject (IRegistry *parent, CSTR &path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (CSTR &path, OBJECT *&pObj) override
 Retrieve object identified by its full path from the data store. More...
 
STATUS retrieveObject (CSTR &parent, CSTR &path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (CSTR &parent, int item, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (OBJECT *parent, CSTR &path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (OBJECT *parent, int item, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS findObject (CSTR &path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
STATUS findObject (IRegistry *parent, CSTR &path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
STATUS findObject (CSTR &parent, CSTR &path, OBJECT *&pObj) override
 Find object in the data store. More...
 
STATUS findObject (CSTR &parent, int item, OBJECT *&pObject) override
 Find object in the data store. More...
 
STATUS findObject (OBJECT *parent, CSTR &path, OBJECT *&pObject) override
 Find object in the data store. More...
 
STATUS findObject (OBJECT *parent, int item, OBJECT *&pObject) override
 Find object in the data store. More...
 
STATUS linkObject (IRegistry *from, CSTR &objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (CSTR &from, CSTR &objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (OBJECT *from, CSTR &objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (CSTR &fullPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS unlinkObject (IRegistry *from, CSTR &objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (CSTR &from, CSTR &objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (OBJECT *from, CSTR &objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (CSTR &path) override
 Remove a link to another object. More...
 
STATUS updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry. More...
 
STATUS updateObject (CSTR &path) override
 Update object. More...
 
STATUS updateObject (OBJECT *pObj) override
 Update object. More...
 
STATUS updateObject (CSTR &parent, CSTR &updatePath) override
 Update object. More...
 
STATUS updateObject (OBJECT *parent, CSTR &updatePath) override
 Update object. More...
 
STATUS create (CSTR &nam, CSTR &typ) override
 Create a partition object. The name identifies the partition uniquely. More...
 
STATUS create (CSTR &nam, CSTR &typ, IInterface *&pPartition) override
 Create a partition object. The name identifies the partition uniquely. More...
 
STATUS drop (CSTR &nam) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
STATUS drop (IInterface *pPartition) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
STATUS activate (CSTR &nam) override
 Activate a partition object. The name identifies the partition uniquely. More...
 
STATUS activate (IInterface *pPartition) override
 Activate a partition object. More...
 
STATUS get (CSTR &nam, IInterface *&pPartition) const override
 Access a partition object. The name identifies the partition uniquely. More...
 
StatusCode activePartition (std::string &nam, IInterface *&pPartition) const override
 Access the active partition object. More...
 
STATUS attachServices ()
 
STATUS detachServices ()
 
STATUS initialize () override
 Service initialisation. More...
 
STATUS reinitialize () override
 Service initialisation. More...
 
STATUS finalize () override
 Service initialisation. More...
 
 ~MultiStoreSvc () override
 Standard Destructor. More...
 
STATUS preparePartitions ()
 Prepare partition for usage. More...
 
STATUS clearPartitions ()
 Clear all partitions. More...
 
STATUS makePartitions ()
 Create all partitions according to job options. More...
 
- Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
const std::stringname () const override
 Retrieve name of the service. More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service. More...
 
StatusCode sysStart () override
 Initialize Service. More...
 
StatusCode sysStop () override
 Initialize Service. More...
 
StatusCode sysFinalize () override
 Finalize Service. More...
 
StatusCode sysReinitialize () override
 Re-initialize the Service. More...
 
StatusCode sysRestart () override
 Re-initialize the Service. More...
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
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. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
 ~PropertyHolder () override=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p) override
 set the property form another property More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 set the property from name and the value More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (const std::string &name) const override
 get the property by name More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (const std::string &name) const override
 Return true if we have a property with the given name. More...
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
 Specializations for various GaudiHandles. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const __attribute__((deprecated))
 Backward compatibility function for getting the output level. More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces... >
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Types

enum  { no_type = 0, address_type = 1, object_type = 2 }
 Root type (address or object) More...
 
typedef std::vector< std::stringPartitionDefs
 
typedef std::map< std::string, Partition > Partitions
 

Protected Member Functions

template<typename... Args, typename... UArgs>
STATUS call_ (STATUS(IDataProviderSvc::*pmf)(Args...), UArgs &&...args)
 
template<typename... Args, typename... UArgs>
STATUS call_ (STATUS(IDataManagerSvc::*pmf)(Args...), UArgs &&...args)
 
- Protected Member Functions inherited from Service
 ~Service () override
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBaseproperty (const std::string &name) const
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

Gaudi::Property< CLIDm_rootCLID {this, "RootCLID", 110, "CLID of root entry"}
 
Gaudi::Property< std::stringm_rootName {this, "RootName", "/Event", "name of root entry"}
 
Gaudi::Property< PartitionDefsm_partitionDefs {this, "Partitions", {}, "datastore partition definitions"}
 
Gaudi::Property< std::stringm_loader {this, "DataLoader", "EventPersistencySvc", "data loader name"}
 
Gaudi::Property< std::stringm_defaultPartition {this, "DefaultPartition", "Default", "default partition name"}
 
SmartIF< IConversionSvcm_dataLoader
 Pointer to data loader service. More...
 
SmartIF< IAddressCreatorm_addrCreator
 Reference to address creator. More...
 
struct MultiStoreSvc::tagROOT m_root
 
Partition m_current
 Current partition. More...
 
Partitions m_partitions
 Datastore partitions. More...
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::Property< int > m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
 
Gaudi::Property< bool > m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
 
Gaudi::Property< bool > m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
 
Gaudi::Property< bool > m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
 
Gaudi::Property< bool > m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
 
Gaudi::Property< bool > m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
 
Gaudi::Property< bool > m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
 
Gaudi::Property< bool > m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. More...
 

Additional Inherited Members

- Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

Data service base class.

A data service manages the transient data stores and implements the IDataProviderSvc, the IDataManagerSvc and the IPartitionControl interfaces.

Author
Markus Frank
Sebastien Ponce
Version
1.0

Definition at line 68 of file MultiStoreSvc.cpp.

Member Typedef Documentation

Definition at line 71 of file MultiStoreSvc.cpp.

typedef std::map<std::string, Partition> MultiStoreSvc::Partitions
protected

Definition at line 72 of file MultiStoreSvc.cpp.

Member Enumeration Documentation

anonymous enum
protected

Root type (address or object)

Enumerator
no_type 
address_type 
object_type 

Definition at line 85 of file MultiStoreSvc.cpp.

Constructor & Destructor Documentation

MultiStoreSvc::~MultiStoreSvc ( )
inlineoverride

Standard Destructor.

Definition at line 624 of file MultiStoreSvc.cpp.

625  {
626  setDataLoader( nullptr ).ignore();
627  resetPreLoad().ignore();
628  clearStore().ignore();
630  }
STATUS setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
STATUS clearPartitions()
Clear all partitions.
STATUS resetPreLoad() override
Clear the preload list.
void ignore() const
Definition: StatusCode.h:109
STATUS clearStore() override
IDataManagerSvc: Remove all data objects in the data store.

Member Function Documentation

STATUS MultiStoreSvc::activate ( CSTR nam)
inlineoverride

Activate a partition object. The name identifies the partition uniquely.

Definition at line 490 of file MultiStoreSvc.cpp.

491  {
492  auto i = m_partitions.find( nam );
493  if ( i != m_partitions.end() ) {
494  m_current = i->second;
495  return STATUS::SUCCESS;
496  }
497  m_current = Partition();
498  return PARTITION_NOT_PRESENT;
499  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
Partition m_current
Current partition.
T find(T...args)
STATUS MultiStoreSvc::activate ( IInterface pPartition)
inlineoverride

Activate a partition object.

Definition at line 502 of file MultiStoreSvc.cpp.

503  {
504  auto provider = SmartIF<IDataProviderSvc>( pPartition );
505  m_current = Partition();
506  if ( !provider ) return NO_INTERFACE;
508  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
509  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
510  m_current = i->second;
511  return STATUS::SUCCESS;
512  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
Partition m_current
Current partition.
T find_if(T...args)
T begin(T...args)
StatusCode MultiStoreSvc::activePartition ( std::string nam,
IInterface *&  pPartition 
) const
inlineoverride

Access the active partition object.

Definition at line 527 of file MultiStoreSvc.cpp.

528  {
529  if ( m_current.dataProvider ) {
530  nam = m_current.name;
531  pPartition = m_current.dataProvider;
532  return STATUS::SUCCESS;
533  }
534  nam.clear();
535  pPartition = nullptr;
536  return NO_ACTIVE_PARTITION;
537  }
T clear(T...args)
Partition m_current
Current partition.
STATUS MultiStoreSvc::addPreLoadItem ( const DataStoreItem item)
inlineoverride

Add an item to the preload list.

Definition at line 260 of file MultiStoreSvc.cpp.

261  {
262  return call_<const DataStoreItem&>( &IDataProviderSvc::addPreLoadItem, item );
263  }
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
STATUS MultiStoreSvc::addPreLoadItem ( CSTR item)
inlineoverride

Add an item to the preload list.

Definition at line 265 of file MultiStoreSvc.cpp.

265 { return call_<CSTR&>( &IDataProviderSvc::addPreLoadItem, item ); }
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
STATUS MultiStoreSvc::attachServices ( )
inline

Definition at line 539 of file MultiStoreSvc.cpp.

540  {
541  // Attach address creator facility
542  m_addrCreator = service( m_loader, true );
543  if ( !m_addrCreator ) {
544  error() << "Failed to retrieve data loader "
545  << "\"" << m_loader << "\"" << endmsg;
546  return StatusCode::FAILURE;
547  }
548  // Attach data loader facility
549  auto dataLoader = service<IConversionSvc>( m_loader, true );
550  if ( !dataLoader ) {
551  error() << "Failed to retrieve data loader "
552  << "\"" << m_loader << "\"" << endmsg;
553  return StatusCode::FAILURE;
554  }
555  auto sc = setDataLoader( dataLoader.get() );
556  if ( !sc.isSuccess() ) {
557  error() << "Failed to set data loader "
558  << "\"" << m_loader << "\"" << endmsg;
559  }
560  return sc;
561  }
STATUS setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Gaudi::Property< std::string > m_loader
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Service.h:85
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
template<typename... Args, typename... UArgs>
STATUS MultiStoreSvc::call_ ( STATUS(IDataProviderSvc::*)(Args...)  pmf,
UArgs &&...  args 
)
inlineprotected

Definition at line 102 of file MultiStoreSvc.cpp.

103  {
104  return m_current.dataProvider ? ( m_current.dataProvider->*pmf )( std::forward<UArgs>( args )... )
106  }
Invalid root path object cannot be retrieved or stored.
Partition m_current
Current partition.
template<typename... Args, typename... UArgs>
STATUS MultiStoreSvc::call_ ( STATUS(IDataManagerSvc::*)(Args...)  pmf,
UArgs &&...  args 
)
inlineprotected

Definition at line 108 of file MultiStoreSvc.cpp.

109  {
110  return m_current.dataManager ? ( m_current.dataManager->*pmf )( std::forward<UArgs>( args )... )
112  }
Invalid root path object cannot be retrieved or stored.
Partition m_current
Current partition.
STATUS MultiStoreSvc::clearPartitions ( )
inline

Clear all partitions.

Definition at line 666 of file MultiStoreSvc.cpp.

667  {
668  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
669  m_partitions.clear();
670  return STATUS::SUCCESS;
671  }
Partitions m_partitions
Datastore partitions.
STATUS MultiStoreSvc::clearStore ( )
inlineoverride

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 172 of file MultiStoreSvc.cpp.

173  {
174  for ( auto& i : m_partitions ) {
175  i.second.dataManager->clearStore().ignore();
176  }
177  if ( m_root.root.object ) {
178  switch ( m_root.type ) {
179  case address_type:
181  break;
182  case object_type:
184  break;
185  }
186  m_root.root.object = nullptr;
187  }
188  m_root.path.clear();
189  m_root.type = no_type;
190  return STATUS::SUCCESS;
191  }
Partitions m_partitions
Datastore partitions.
struct MultiStoreSvc::tagROOT m_root
virtual unsigned long release()=0
release reference to object
T clear(T...args)
union MultiStoreSvc::tagROOT::@1 root
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
STATUS MultiStoreSvc::clearSubTree ( CSTR path)
inlineoverride

Remove all data objects below the sub tree identified.

Definition at line 168 of file MultiStoreSvc.cpp.

168 { return call_<CSTR&>( &IDataManagerSvc::clearSubTree, path ); }
virtual StatusCode clearSubTree(const std::string &sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
STATUS MultiStoreSvc::clearSubTree ( OBJECT pObject)
inlineoverride

Remove all data objects below the sub tree identified.

Definition at line 170 of file MultiStoreSvc.cpp.

170 { return call_<OBJECT*>( &IDataManagerSvc::clearSubTree, pObject ); }
virtual StatusCode clearSubTree(const std::string &sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
STATUS MultiStoreSvc::create ( CSTR nam,
CSTR typ 
)
inlineoverride

Create a partition object. The name identifies the partition uniquely.

Definition at line 444 of file MultiStoreSvc.cpp.

445  {
446  IInterface* pPartition = nullptr;
447  return create( nam, typ, pPartition );
448  }
STATUS create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
Definition of the basic interface.
Definition: IInterface.h:277
STATUS MultiStoreSvc::create ( CSTR nam,
CSTR typ,
IInterface *&  pPartition 
)
inlineoverride

Create a partition object. The name identifies the partition uniquely.

Fix-Me:
: In the old implementation the services were "unmanaged" (non-active)

Definition at line 450 of file MultiStoreSvc.cpp.

451  {
452  if ( get( nam, pPartition ).isSuccess() ) return PARTITION_EXISTS;
454  auto isvc = serviceLocator()->service<IService>( typ );
455  if ( !isvc ) return NO_INTERFACE;
456  auto dataMgr = isvc.as<IDataManagerSvc>();
457  auto dataProv = isvc.as<IDataProviderSvc>();
458  if ( !dataMgr || !dataProv ) return NO_INTERFACE;
459  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
460  return STATUS::SUCCESS;
461  }
Partitions m_partitions
Datastore partitions.
Data provider interface definition.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:79
General service interface definition.
Definition: IService.h:18
T emplace(T...args)
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
STATUS MultiStoreSvc::detachServices ( )
inline

Definition at line 563 of file MultiStoreSvc.cpp.

564  {
567  return STATUS::SUCCESS;
568  }
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
STATUS MultiStoreSvc::drop ( CSTR nam)
inlineoverride

Drop a partition object. The name identifies the partition uniquely.

Definition at line 464 of file MultiStoreSvc.cpp.

465  {
466  auto i = m_partitions.find( nam );
467  if ( i == m_partitions.end() ) return PARTITION_NOT_PRESENT;
468  if ( i->second.dataManager == m_current.dataManager ) {
469  m_current = Partition();
470  }
471  i->second.dataManager->clearStore().ignore();
472  m_partitions.erase( i );
473  return STATUS::SUCCESS;
474  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
T erase(T...args)
Partition m_current
Current partition.
T find(T...args)
STATUS MultiStoreSvc::drop ( IInterface pPartition)
inlineoverride

Drop a partition object. The name identifies the partition uniquely.

Definition at line 477 of file MultiStoreSvc.cpp.

478  {
479  auto provider = SmartIF<IDataProviderSvc>( pPartition );
480  if ( !provider ) return NO_INTERFACE;
482  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
483  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
484  i->second.dataManager->clearStore().ignore();
485  m_partitions.erase( i );
486  return STATUS::SUCCESS;
487  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
T erase(T...args)
T find_if(T...args)
T begin(T...args)
STATUS MultiStoreSvc::finalize ( )
inlineoverride

Service initialisation.

Definition at line 608 of file MultiStoreSvc.cpp.

609  {
610  setDataLoader( nullptr ).ignore();
611  clearStore().ignore();
613  m_current = Partition();
614  detachServices();
615  return Service::finalize();
616  }
StatusCode finalize() override
Definition: Service.cpp:174
STATUS detachServices()
STATUS setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
STATUS clearPartitions()
Clear all partitions.
Partition m_current
Current partition.
void ignore() const
Definition: StatusCode.h:109
STATUS clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
STATUS MultiStoreSvc::findObject ( CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Find object identified by its full path in the data store.

Definition at line 357 of file MultiStoreSvc.cpp.

358  {
359  return call_<CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, path, pObj );
360  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( IRegistry parent,
CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Find object identified by its full path in the data store.

Definition at line 362 of file MultiStoreSvc.cpp.

363  {
364  return call_<IRegistry*, CSTR&, OBJECT*&>( &IDataProviderSvc::findObject, parent, path, pObj );
365  }
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( CSTR parent,
CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Find object in the data store.

Definition at line 367 of file MultiStoreSvc.cpp.

368  {
369  return call_<CSTR&, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
370  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( CSTR parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 372 of file MultiStoreSvc.cpp.

373  {
374  return call_<CSTR&, int, OBJECT*&>( &IDataProviderSvc::findObject, parent, item, pObject );
375  }
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( OBJECT parent,
CSTR path,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 377 of file MultiStoreSvc.cpp.

378  {
379  return call_<OBJECT*, CSTR&, OBJECT*&>( &IDataProviderSvc::findObject, parent, path, pObject );
380  }
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( OBJECT parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 382 of file MultiStoreSvc.cpp.

383  {
384  return call_<OBJECT*, int, OBJECT*&>( &IDataProviderSvc::findObject, parent, item, pObject );
385  }
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
STATUS MultiStoreSvc::get ( CSTR nam,
IInterface *&  pPartition 
) const
inlineoverride

Access a partition object. The name identifies the partition uniquely.

Definition at line 515 of file MultiStoreSvc.cpp.

516  {
517  auto i = m_partitions.find( nam );
518  if ( i != m_partitions.end() ) {
519  pPartition = i->second.dataProvider;
520  return STATUS::SUCCESS;
521  }
522  pPartition = nullptr;
523  return PARTITION_NOT_PRESENT;
524  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
T find(T...args)
STATUS MultiStoreSvc::initialize ( )
inlineoverride

Service initialisation.

Definition at line 571 of file MultiStoreSvc.cpp.

572  {
573  // Nothing to do: just call base class initialisation
575  if ( !sc.isSuccess() ) return sc;
576  sc = makePartitions();
577  if ( !sc.isSuccess() ) {
578  error() << "Failed to connect to all store partitions." << endmsg;
579  return sc;
580  }
581  return attachServices();
582  }
StatusCode initialize() override
Definition: Service.cpp:64
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
STATUS makePartitions()
Create all partitions according to job options.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
STATUS attachServices()
STATUS MultiStoreSvc::linkObject ( IRegistry from,
CSTR objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 387 of file MultiStoreSvc.cpp.

388  {
389  return call_<IRegistry*, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
390  }
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( CSTR from,
CSTR objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 392 of file MultiStoreSvc.cpp.

393  {
394  return call_<CSTR&, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
395  }
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( OBJECT from,
CSTR objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 397 of file MultiStoreSvc.cpp.

398  {
399  return call_<OBJECT*, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
400  }
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( CSTR fullPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 402 of file MultiStoreSvc.cpp.

403  {
404  return call_<CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, fullPath, to );
405  }
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::makePartitions ( )
inline

Create all partitions according to job options.

Definition at line 674 of file MultiStoreSvc.cpp.

675  {
676  using Parser = Gaudi::Utils::AttribStringParser;
677  std::string typ, nam;
679  for ( auto part : m_partitionDefs ) {
680  for ( auto attrib : Parser( std::move( part ) ) ) {
681  switch (::toupper( attrib.tag[0] ) ) {
682  case 'N':
683  nam = std::move( attrib.value );
684  break;
685  case 'T':
686  typ = std::move( attrib.value );
687  break;
688  }
689  }
690  STATUS sc = create( nam, typ );
691  if ( !sc.isSuccess() ) return sc;
692  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
693  }
694  return STATUS::SUCCESS;
695  }
Parse attribute strings allowing iteration over the various attributes.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
STATUS create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
Gaudi::Property< std::string > m_defaultPartition
STATUS clearPartitions()
Clear all partitions.
T move(T...args)
void ignore() const
Definition: StatusCode.h:109
Gaudi::Property< PartitionDefs > m_partitionDefs
void toupper(std::string &s)
STATUS MultiStoreSvc::objectLeaves ( const OBJECT pObject,
std::vector< IRegistry * > &  leaves 
)
inlineoverride

Explore the object store: retrieve all leaves attached to the object.

Definition at line 148 of file MultiStoreSvc.cpp.

149  {
150  return call_<const OBJECT*, std::vector<IRegistry*>&>( &IDataManagerSvc::objectLeaves, pObject, leaves );
151  }
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
STATUS MultiStoreSvc::objectLeaves ( const IRegistry pObject,
std::vector< IRegistry * > &  leaves 
)
inlineoverride

Explore the object store: retrieve all leaves attached to the object.

Definition at line 153 of file MultiStoreSvc.cpp.

154  {
155  return call_<const IRegistry*, std::vector<IRegistry*>&>( &IDataManagerSvc::objectLeaves, pObject, leaves );
156  }
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
STATUS MultiStoreSvc::objectParent ( const OBJECT pObject,
IRegistry *&  refpParent 
)
inlineoverride

IDataManagerSvc: Explore the object store: retrieve the object's parent.

Definition at line 158 of file MultiStoreSvc.cpp.

159  {
160  return call_<const OBJECT*, IRegistry*&>( &IDataManagerSvc::objectParent, pObject, refpParent );
161  }
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
STATUS MultiStoreSvc::objectParent ( const IRegistry pObject,
IRegistry *&  refpParent 
)
inlineoverride

IDataManagerSvc: Explore the object store: retrieve the object's parent.

Definition at line 163 of file MultiStoreSvc.cpp.

164  {
165  return call_<const IRegistry*, IRegistry*&>( &IDataManagerSvc::objectParent, pObject, refpParent );
166  }
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
STATUS MultiStoreSvc::preLoad ( )
inlineoverride

load all preload items of the list

Definition at line 276 of file MultiStoreSvc.cpp.

276 { return call_<>( &IDataProviderSvc::preLoad ); }
virtual StatusCode preLoad()=0
Load all preload items of the list.
STATUS MultiStoreSvc::preparePartitions ( )
inline

Prepare partition for usage.

Definition at line 633 of file MultiStoreSvc.cpp.

634  {
635  STATUS iret = STATUS::SUCCESS;
636  for ( auto& i : m_partitions ) {
637  STATUS sc = STATUS::FAILURE;
638  switch ( m_root.type ) {
639  case address_type:
640  if ( m_root.root.address ) {
641  ADDRESS* pAdd = nullptr;
642  ADDRESS* p = m_root.root.address;
643  sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
644  if ( sc.isSuccess() ) {
645  sc = i.second.dataManager->setRoot( m_root.path, pAdd );
646  }
647  }
648  break;
649  case object_type:
650  if ( m_root.root.object ) {
651  if ( m_root.root.object->clID() == CLID_DataObject ) {
652  sc = i.second.dataManager->setRoot( m_root.path, new DataObject() );
653  }
654  }
655  break;
656  default:
657  sc = STATUS::FAILURE;
658  break;
659  }
660  if ( !sc.isSuccess() ) iret = sc;
661  }
662  return iret;
663  }
Partitions m_partitions
Datastore partitions.
virtual const CLID & clID() const =0
Retrieve class information from link.
struct MultiStoreSvc::tagROOT m_root
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.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual const std::string * par() const =0
Retrieve String parameters.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:62
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
virtual long svcType() const =0
Retrieve service type.
union MultiStoreSvc::tagROOT::@1 root
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
STATUS MultiStoreSvc::registerAddress ( CSTR path,
ADDRESS pAddr 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 121 of file MultiStoreSvc.cpp.

122  {
123  return call_<CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, path, pAddr );
124  }
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerAddress ( OBJECT parent,
CSTR path,
ADDRESS pAddr 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 126 of file MultiStoreSvc.cpp.

127  {
128  return call_<OBJECT*, CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, parent, path, pAddr );
129  }
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerAddress ( IRegistry parent,
CSTR path,
ADDRESS pAdd 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 131 of file MultiStoreSvc.cpp.

132  {
133  return call_<IRegistry*, CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, parent, path, pAdd );
134  }
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerObject ( CSTR path,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 278 of file MultiStoreSvc.cpp.

278 { return registerObject( nullptr, path, pObj ); }
STATUS registerObject(CSTR &path, OBJECT *pObj) override
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( CSTR parent,
CSTR obj,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 280 of file MultiStoreSvc.cpp.

281  {
282  return call_<CSTR&, CSTR&, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
283  }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( CSTR parent,
int  item,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 285 of file MultiStoreSvc.cpp.

286  {
287  return call_<CSTR&, int, OBJECT*>( &IDataProviderSvc::registerObject, parent, item, pObj );
288  }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( OBJECT parent,
CSTR obj,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 290 of file MultiStoreSvc.cpp.

291  {
292  return call_<OBJECT*, CSTR&, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
293  }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( OBJECT parent,
int  obj,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 295 of file MultiStoreSvc.cpp.

296  {
297  return call_<OBJECT*, int, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
298  }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::reinitialize ( )
inlineoverride

Service initialisation.

Definition at line 585 of file MultiStoreSvc.cpp.

586  {
588  if ( !sc.isSuccess() ) {
589  error() << "Enable to reinitialize base class" << endmsg;
590  return sc;
591  }
592  detachServices();
593  sc = attachServices();
594  if ( !sc.isSuccess() ) {
595  error() << "Failed to attach necessary services." << endmsg;
596  return sc;
597  }
598  sc = makePartitions();
599  if ( !sc.isSuccess() ) {
600  error() << "Failed to connect to store partitions." << endmsg;
601  return sc;
602  }
603  // return
604  return STATUS::SUCCESS;
605  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
STATUS detachServices()
STATUS makePartitions()
Create all partitions according to job options.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
StatusCode reinitialize() override
Definition: Service.cpp:250
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
STATUS attachServices()
STATUS MultiStoreSvc::removePreLoadItem ( const DataStoreItem item)
inlineoverride

Remove an item from the preload list.

Definition at line 267 of file MultiStoreSvc.cpp.

268  {
269  return call_<const DataStoreItem&>( &IDataProviderSvc::removePreLoadItem, item );
270  }
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
STATUS MultiStoreSvc::removePreLoadItem ( CSTR item)
inlineoverride

Add an item to the preload list.

Definition at line 272 of file MultiStoreSvc.cpp.

272 { return call_<CSTR&>( &IDataProviderSvc::removePreLoadItem, item ); }
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
STATUS MultiStoreSvc::resetPreLoad ( )
inlineoverride

Clear the preload list.

Definition at line 274 of file MultiStoreSvc.cpp.

274 { return call_<>( &IDataProviderSvc::resetPreLoad ); }
virtual StatusCode resetPreLoad()=0
Clear the preload list.
STATUS MultiStoreSvc::retrieveObject ( IRegistry parent,
CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 327 of file MultiStoreSvc.cpp.

328  {
329  return call_<IRegistry*, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
330  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object identified by its full path from the data store.

Definition at line 332 of file MultiStoreSvc.cpp.

333  {
334  return call_<CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, path, pObj );
335  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( CSTR parent,
CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 337 of file MultiStoreSvc.cpp.

338  {
339  return call_<CSTR&, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
340  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( CSTR parent,
int  item,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 342 of file MultiStoreSvc.cpp.

343  {
344  return call_<CSTR&, int, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, item, pObj );
345  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( OBJECT parent,
CSTR path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 347 of file MultiStoreSvc.cpp.

348  {
349  return call_<OBJECT*, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
350  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( OBJECT parent,
int  item,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 352 of file MultiStoreSvc.cpp.

353  {
354  return call_<OBJECT*, int, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, item, pObj );
355  }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
CLID MultiStoreSvc::rootCLID ( ) const
inlineoverride

IDataManagerSvc: Accessor for root event CLID.

Definition at line 116 of file MultiStoreSvc.cpp.

116 { return m_rootCLID; }
Gaudi::Property< CLID > m_rootCLID
const std::string& MultiStoreSvc::rootName ( ) const
inlineoverride

Name for root Event.

Definition at line 118 of file MultiStoreSvc.cpp.

118 { return m_rootName; }
Gaudi::Property< std::string > m_rootName
STATUS MultiStoreSvc::setDataLoader ( IConversionSvc pDataLoader,
IDataProviderSvc dpsvc = nullptr 
)
inlineoverride

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 250 of file MultiStoreSvc.cpp.

251  {
252  m_dataLoader = pDataLoader;
253  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
254  for ( auto& i : m_partitions ) {
255  i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore();
256  }
257  return SUCCESS;
258  }
Partitions m_partitions
Datastore partitions.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
STATUS MultiStoreSvc::setRoot ( std::string  path,
OBJECT pObj 
)
inlineoverride

Initialize data store for new event by giving new event path and root object.

Takes care to clear the store before reinitializing it

Definition at line 206 of file MultiStoreSvc.cpp.

207  {
208  if ( m_root.root.object ) {
209  switch ( m_root.type ) {
210  case address_type:
212  break;
213  case object_type:
215  break;
216  }
217  }
218  m_root.path = std::move( path );
220  m_root.root.object = pObj;
222  return activate( m_defaultPartition );
223  }
struct MultiStoreSvc::tagROOT m_root
virtual unsigned long release()=0
release reference to object
STATUS activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
Gaudi::Property< std::string > m_defaultPartition
T move(T...args)
union MultiStoreSvc::tagROOT::@1 root
STATUS preparePartitions()
Prepare partition for usage.
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
STATUS MultiStoreSvc::setRoot ( std::string  path,
ADDRESS pAddr 
)
inlineoverride

Initialize data store for new event by giving new event path and address of root object.

Takes care to clear the store before reinitializing it

Definition at line 227 of file MultiStoreSvc.cpp.

228  {
229  if ( m_root.root.object ) {
230  switch ( m_root.type ) {
231  case address_type:
233  break;
234  case object_type:
236  break;
237  }
238  }
239  m_root.path = std::move( path );
241  m_root.root.address = pAddr;
242  if ( m_root.root.address ) {
245  return activate( m_defaultPartition );
246  }
247  return STATUS::FAILURE;
248  }
struct MultiStoreSvc::tagROOT m_root
virtual unsigned long release()=0
release reference to object
STATUS activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
Gaudi::Property< std::string > m_defaultPartition
T move(T...args)
union MultiStoreSvc::tagROOT::@1 root
STATUS preparePartitions()
Prepare partition for usage.
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
virtual unsigned long addRef()=0
Add reference to object.
STATUS MultiStoreSvc::traverseSubTree ( CSTR path,
AGENT pAgent 
)
inlineoverride

Analyze by traversing all data objects below the sub tree.

Definition at line 193 of file MultiStoreSvc.cpp.

194  {
195  return call_<CSTR&, AGENT*>( &IDataManagerSvc::traverseSubTree, path, pAgent );
196  }
virtual StatusCode traverseSubTree(const std::string &sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
STATUS MultiStoreSvc::traverseSubTree ( OBJECT pObject,
AGENT pAgent 
)
inlineoverride

IDataManagerSvc: Analyze by traversing all data objects below the sub tree.

Definition at line 198 of file MultiStoreSvc.cpp.

199  {
200  return call_<OBJECT*, AGENT*>( &IDataManagerSvc::traverseSubTree, pObject, pAgent );
201  }
virtual StatusCode traverseSubTree(const std::string &sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
STATUS MultiStoreSvc::traverseTree ( AGENT pAgent)
inlineoverride

IDataManagerSvc: Analyze by traversing all data objects in the data store.

Definition at line 203 of file MultiStoreSvc.cpp.

203 { return call_<AGENT*>( &IDataManagerSvc::traverseTree, pAgent ); }
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
STATUS MultiStoreSvc::unlinkObject ( IRegistry from,
CSTR objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 407 of file MultiStoreSvc.cpp.

408  {
409  return call_<IRegistry*, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
410  }
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)=0
Remove a link to another object.
STATUS MultiStoreSvc::unlinkObject ( CSTR from,
CSTR objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 412 of file MultiStoreSvc.cpp.

413  {
414  return call_<CSTR&, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
415  }
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)=0
Remove a link to another object.
STATUS MultiStoreSvc::unlinkObject ( OBJECT from,
CSTR objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 417 of file MultiStoreSvc.cpp.

418  {
419  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
420  }
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)=0
Remove a link to another object.
STATUS MultiStoreSvc::unlinkObject ( CSTR path)
inlineoverride

Remove a link to another object.

Definition at line 422 of file MultiStoreSvc.cpp.

422 { return call_<CSTR&>( &IDataProviderSvc::unlinkObject, path ); }
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)=0
Remove a link to another object.
STATUS MultiStoreSvc::unregisterAddress ( CSTR path)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 136 of file MultiStoreSvc.cpp.

136 { return call_<CSTR&>( &IDataManagerSvc::unregisterAddress, path ); }
virtual StatusCode unregisterAddress(const std::string &fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterAddress ( OBJECT pParent,
CSTR path 
)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 138 of file MultiStoreSvc.cpp.

139  {
140  return call_<OBJECT*, CSTR&>( &IDataManagerSvc::unregisterAddress, pParent, path );
141  }
virtual StatusCode unregisterAddress(const std::string &fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterAddress ( IRegistry pParent,
CSTR path 
)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 143 of file MultiStoreSvc.cpp.

144  {
145  return call_<IRegistry*, CSTR&>( &IDataManagerSvc::unregisterAddress, pParent, path );
146  }
virtual StatusCode unregisterAddress(const std::string &fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterObject ( CSTR path)
inlineoverride

Unregister object from the data store.

Definition at line 300 of file MultiStoreSvc.cpp.

300 { return call_<CSTR&>( &IDataProviderSvc::unregisterObject, path ); }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( CSTR parent,
CSTR obj 
)
inlineoverride

Unregister object from the data store.

Definition at line 302 of file MultiStoreSvc.cpp.

303  {
304  return call_<CSTR&, CSTR&>( &IDataProviderSvc::unregisterObject, parent, obj );
305  }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( CSTR parent,
int  obj 
)
inlineoverride

Unregister object from the data store.

Definition at line 307 of file MultiStoreSvc.cpp.

308  {
309  return call_<CSTR&, int>( &IDataProviderSvc::unregisterObject, parent, obj );
310  }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( OBJECT pObj)
inlineoverride

Unregister object from the data store.

Definition at line 312 of file MultiStoreSvc.cpp.

313  {
314  return call_<OBJECT*>( &IDataProviderSvc::unregisterObject, pObj );
315  }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( OBJECT pObj,
CSTR path 
)
inlineoverride

Unregister object from the data store.

Definition at line 317 of file MultiStoreSvc.cpp.

318  {
319  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::unregisterObject, pObj, path );
320  }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( OBJECT pObj,
int  item 
)
inlineoverride

Unregister object from the data store.

Definition at line 322 of file MultiStoreSvc.cpp.

323  {
324  return call_<OBJECT*, int>( &IDataProviderSvc::unregisterObject, pObj, item );
325  }
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::updateObject ( IRegistry pDirectory)
inlineoverride

Update object identified by its directory entry.

Definition at line 424 of file MultiStoreSvc.cpp.

425  {
426  return call_<IRegistry*>( &IDataProviderSvc::updateObject, pDirectory );
427  }
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( CSTR path)
inlineoverride

Update object.

Definition at line 429 of file MultiStoreSvc.cpp.

429 { return call_<CSTR&>( &IDataProviderSvc::updateObject, path ); }
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( OBJECT pObj)
inlineoverride

Update object.

Definition at line 431 of file MultiStoreSvc.cpp.

431 { return call_<OBJECT*>( &IDataProviderSvc::updateObject, pObj ); }
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( CSTR parent,
CSTR updatePath 
)
inlineoverride

Update object.

Definition at line 433 of file MultiStoreSvc.cpp.

434  {
435  return call_<CSTR&, CSTR&>( &IDataProviderSvc::updateObject, parent, updatePath );
436  }
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( OBJECT parent,
CSTR updatePath 
)
inlineoverride

Update object.

Definition at line 438 of file MultiStoreSvc.cpp.

439  {
440  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::updateObject, parent, updatePath );
441  }
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.

Member Data Documentation

SmartIF<IAddressCreator> MultiStoreSvc::m_addrCreator
protected

Reference to address creator.

Definition at line 83 of file MultiStoreSvc.cpp.

Partition MultiStoreSvc::m_current
protected

Current partition.

Definition at line 96 of file MultiStoreSvc.cpp.

SmartIF<IConversionSvc> MultiStoreSvc::m_dataLoader
protected

Pointer to data loader service.

Definition at line 81 of file MultiStoreSvc.cpp.

Gaudi::Property<std::string> MultiStoreSvc::m_defaultPartition {this, "DefaultPartition", "Default", "default partition name"}
protected

Definition at line 78 of file MultiStoreSvc.cpp.

Gaudi::Property<std::string> MultiStoreSvc::m_loader {this, "DataLoader", "EventPersistencySvc", "data loader name"}
protected

Definition at line 77 of file MultiStoreSvc.cpp.

Gaudi::Property<PartitionDefs> MultiStoreSvc::m_partitionDefs {this, "Partitions", {}, "datastore partition definitions"}
protected

Definition at line 76 of file MultiStoreSvc.cpp.

Partitions MultiStoreSvc::m_partitions
protected

Datastore partitions.

Definition at line 98 of file MultiStoreSvc.cpp.

struct MultiStoreSvc::tagROOT MultiStoreSvc::m_root
protected
Gaudi::Property<CLID> MultiStoreSvc::m_rootCLID {this, "RootCLID", 110, "CLID of root entry"}
protected

Definition at line 74 of file MultiStoreSvc.cpp.

Gaudi::Property<std::string> MultiStoreSvc::m_rootName {this, "RootName", "/Event", "name of root entry"}
protected

Definition at line 75 of file MultiStoreSvc.cpp.


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