The Gaudi Framework  v30r0 (c919700c)
MultiStoreSvc Class Reference

Data service base class. More...

Inheritance diagram for MultiStoreSvc:
Collaboration diagram for MultiStoreSvc:

Classes

struct  tagROOT
 Root type (address or object) More...
 

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 (boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS registerAddress (OBJECT *parent, boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS registerAddress (IRegistry *parent, boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
STATUS unregisterAddress (boost::string_ref path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
STATUS unregisterAddress (OBJECT *pParent, boost::string_ref path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
STATUS unregisterAddress (IRegistry *pParent, boost::string_ref 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 (boost::string_ref 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 (boost::string_ref 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 (std::string 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 (std::string 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 (boost::string_ref path, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (boost::string_ref parent, boost::string_ref obj, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (boost::string_ref parent, int item, OBJECT *pObj) override
 Register object with the data store. More...
 
STATUS registerObject (OBJECT *parent, boost::string_ref 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 (boost::string_ref path) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (boost::string_ref parent, boost::string_ref obj) override
 Unregister object from the data store. More...
 
STATUS unregisterObject (boost::string_ref 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, boost::string_ref 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, boost::string_ref path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (boost::string_ref path, OBJECT *&pObj) override
 Retrieve object identified by its full path from the data store. More...
 
STATUS retrieveObject (boost::string_ref parent, boost::string_ref path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (boost::string_ref parent, int item, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
STATUS retrieveObject (OBJECT *parent, boost::string_ref 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 (boost::string_ref path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
STATUS findObject (IRegistry *parent, boost::string_ref path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
STATUS findObject (boost::string_ref parent, boost::string_ref path, OBJECT *&pObj) override
 Find object in the data store. More...
 
STATUS findObject (boost::string_ref parent, int item, OBJECT *&pObject) override
 Find object in the data store. More...
 
STATUS findObject (OBJECT *parent, boost::string_ref 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, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (boost::string_ref from, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (OBJECT *from, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS linkObject (boost::string_ref fullPath, OBJECT *to) override
 Add a link to another object. More...
 
STATUS unlinkObject (IRegistry *from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (boost::string_ref from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (OBJECT *from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
STATUS unlinkObject (boost::string_ref path) override
 Remove a link to another object. More...
 
STATUS updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry. More...
 
STATUS updateObject (boost::string_ref path) override
 Update object. More...
 
STATUS updateObject (OBJECT *pObj) override
 Update object. More...
 
STATUS updateObject (boost::string_ref parent, boost::string_ref updatePath) override
 Update object. More...
 
STATUS updateObject (OBJECT *parent, boost::string_ref 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...
 
const 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 cached level (originally extracted 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

typedef std::vector< std::stringPartitionDefs
 
typedef std::map< std::string, Partition > Partitions
 

Protected Member Functions

template<typename Fun >
STATUS fwd (Fun f)
 
- 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 > >
MSG::Level setUpMessaging ()
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
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 102 of file MultiStoreSvc.cpp.

Member Typedef Documentation

Definition at line 105 of file MultiStoreSvc.cpp.

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

Definition at line 106 of file MultiStoreSvc.cpp.

Constructor & Destructor Documentation

MultiStoreSvc::~MultiStoreSvc ( )
inlineoverride

Standard Destructor.

Definition at line 665 of file MultiStoreSvc.cpp.

666  {
667  setDataLoader( nullptr ).ignore();
668  resetPreLoad().ignore();
669  clearStore().ignore();
671  }
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:84
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 531 of file MultiStoreSvc.cpp.

532  {
533  auto i = m_partitions.find( nam );
534  if ( i != m_partitions.end() ) {
535  m_current = i->second;
536  return STATUS::SUCCESS;
537  }
538  m_current = {};
539  return PARTITION_NOT_PRESENT;
540  }
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 543 of file MultiStoreSvc.cpp.

544  {
545  auto provider = SmartIF<IDataProviderSvc>( pPartition );
546  m_current = Partition();
547  if ( !provider ) return NO_INTERFACE;
549  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
550  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
551  m_current = i->second;
552  return STATUS::SUCCESS;
553  }
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 568 of file MultiStoreSvc.cpp.

569  {
570  if ( m_current.dataProvider ) {
571  nam = m_current.name;
572  pPartition = m_current.dataProvider;
573  return STATUS::SUCCESS;
574  }
575  nam.clear();
576  pPartition = nullptr;
577  return NO_ACTIVE_PARTITION;
578  }
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 274 of file MultiStoreSvc.cpp.

275  {
276  return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
277  }
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
STATUS fwd(Fun f)
Data provider interface definition.
STATUS MultiStoreSvc::addPreLoadItem ( std::string  item)
inlineoverride

Add an item to the preload list.

Definition at line 279 of file MultiStoreSvc.cpp.

280  {
281  return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( std::move( item ) ); } );
282  }
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
STATUS fwd(Fun f)
Data provider interface definition.
T move(T...args)
STATUS MultiStoreSvc::attachServices ( )
inline

Definition at line 580 of file MultiStoreSvc.cpp.

581  {
582  // Attach address creator facility
583  m_addrCreator = service( m_loader, true );
584  if ( !m_addrCreator ) {
585  error() << "Failed to retrieve data loader "
586  << "\"" << m_loader << "\"" << endmsg;
587  return StatusCode::FAILURE;
588  }
589  // Attach data loader facility
590  auto dataLoader = service<IConversionSvc>( m_loader, true );
591  if ( !dataLoader ) {
592  error() << "Failed to retrieve data loader "
593  << "\"" << m_loader << "\"" << endmsg;
594  return StatusCode::FAILURE;
595  }
596  auto sc = setDataLoader( dataLoader.get() );
597  if ( !sc.isSuccess() ) {
598  error() << "Failed to set data loader "
599  << "\"" << m_loader << "\"" << endmsg;
600  }
601  return sc;
602  }
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
STATUS MultiStoreSvc::clearPartitions ( )
inline

Clear all partitions.

Definition at line 700 of file MultiStoreSvc.cpp.

701  {
702  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
703  m_partitions.clear();
704  return STATUS::SUCCESS;
705  }
Partitions m_partitions
Datastore partitions.
STATUS MultiStoreSvc::clearStore ( )
inlineoverride

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 203 of file MultiStoreSvc.cpp.

204  {
205  for ( auto& i : m_partitions ) {
206  i.second.dataManager->clearStore().ignore();
207  }
209  []( auto* p ) {
210  if ( p ) p->release();
211  },
212  []( boost::blank ) {} );
213  m_root.root = {};
214  m_root.path.clear();
215  return STATUS::SUCCESS;
216  }
Partitions m_partitions
Datastore partitions.
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:77
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
T clear(T...args)
STATUS MultiStoreSvc::clearSubTree ( boost::string_ref  path)
inlineoverride

Remove all data objects below the sub tree identified.

Definition at line 193 of file MultiStoreSvc.cpp.

194  {
195  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
196  }
STATUS fwd(Fun f)
virtual StatusCode clearSubTree(boost::string_ref 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 198 of file MultiStoreSvc.cpp.

199  {
200  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
201  }
STATUS fwd(Fun f)
virtual StatusCode clearSubTree(boost::string_ref 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 485 of file MultiStoreSvc.cpp.

486  {
487  IInterface* pPartition = nullptr;
488  return create( nam, typ, pPartition );
489  }
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 491 of file MultiStoreSvc.cpp.

492  {
493  if ( get( nam, pPartition ).isSuccess() ) return PARTITION_EXISTS;
495  auto isvc = serviceLocator()->service<IService>( typ );
496  if ( !isvc ) return NO_INTERFACE;
497  auto dataMgr = isvc.as<IDataManagerSvc>();
498  auto dataProv = isvc.as<IDataProviderSvc>();
499  if ( !dataMgr || !dataProv ) return NO_INTERFACE;
500  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
501  return STATUS::SUCCESS;
502  }
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 604 of file MultiStoreSvc.cpp.

605  {
608  return STATUS::SUCCESS;
609  }
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 505 of file MultiStoreSvc.cpp.

506  {
507  auto i = m_partitions.find( nam );
508  if ( i == m_partitions.end() ) return PARTITION_NOT_PRESENT;
509  if ( i->second.dataManager == m_current.dataManager ) {
510  m_current = Partition();
511  }
512  i->second.dataManager->clearStore().ignore();
513  m_partitions.erase( i );
514  return STATUS::SUCCESS;
515  }
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 518 of file MultiStoreSvc.cpp.

519  {
520  auto provider = SmartIF<IDataProviderSvc>( pPartition );
521  if ( !provider ) return NO_INTERFACE;
523  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
524  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
525  i->second.dataManager->clearStore().ignore();
526  m_partitions.erase( i );
527  return STATUS::SUCCESS;
528  }
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 649 of file MultiStoreSvc.cpp.

650  {
651  setDataLoader( nullptr ).ignore();
652  clearStore().ignore();
654  m_current = Partition();
655  detachServices();
656  return Service::finalize();
657  }
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:84
STATUS clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
STATUS MultiStoreSvc::findObject ( boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

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

Definition at line 389 of file MultiStoreSvc.cpp.

390  {
391  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
392  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( IRegistry parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

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

Definition at line 394 of file MultiStoreSvc.cpp.

395  {
396  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
397  }
STATUS fwd(Fun f)
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
Data provider interface definition.
STATUS MultiStoreSvc::findObject ( boost::string_ref  parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Find object in the data store.

Definition at line 399 of file MultiStoreSvc.cpp.

400  {
401  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
402  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::findObject ( boost::string_ref  parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 404 of file MultiStoreSvc.cpp.

405  {
406  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, item, pObject ); } );
407  }
STATUS fwd(Fun f)
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
Data provider interface definition.
STATUS MultiStoreSvc::findObject ( OBJECT parent,
boost::string_ref  path,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 409 of file MultiStoreSvc.cpp.

410  {
411  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObject ); } );
412  }
STATUS fwd(Fun f)
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
Data provider interface definition.
STATUS MultiStoreSvc::findObject ( OBJECT parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 414 of file MultiStoreSvc.cpp.

415  {
416  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, item, pObject ); } );
417  }
STATUS fwd(Fun f)
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
Data provider interface definition.
template<typename Fun >
STATUS MultiStoreSvc::fwd ( Fun  f)
inlineprotected

Definition at line 130 of file MultiStoreSvc.cpp.

131  {
132  auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
133  return svc ? f( *svc ) : static_cast<StatusCode>( IDataProviderSvc::INVALID_ROOT );
134  }
Data provider interface definition.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Partition m_current
Current partition.
STATUS MultiStoreSvc::get ( CSTR nam,
IInterface *&  pPartition 
) const
inlineoverride

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

Definition at line 556 of file MultiStoreSvc.cpp.

557  {
558  auto i = m_partitions.find( nam );
559  if ( i != m_partitions.end() ) {
560  pPartition = i->second.dataProvider;
561  return STATUS::SUCCESS;
562  }
563  pPartition = nullptr;
564  return PARTITION_NOT_PRESENT;
565  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
T find(T...args)
STATUS MultiStoreSvc::initialize ( )
inlineoverride

Service initialisation.

Definition at line 612 of file MultiStoreSvc.cpp.

613  {
614  // Nothing to do: just call base class initialisation
616  if ( !sc.isSuccess() ) return sc;
617  sc = makePartitions();
618  if ( !sc.isSuccess() ) {
619  error() << "Failed to connect to all store partitions." << endmsg;
620  return sc;
621  }
622  return attachServices();
623  }
StatusCode initialize() override
Definition: Service.cpp:64
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
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:26
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,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 419 of file MultiStoreSvc.cpp.

420  {
421  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
422  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( boost::string_ref  from,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 424 of file MultiStoreSvc.cpp.

425  {
426  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
427  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( OBJECT from,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 429 of file MultiStoreSvc.cpp.

430  {
431  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
432  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::linkObject ( boost::string_ref  fullPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 434 of file MultiStoreSvc.cpp.

435  {
436  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
437  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
STATUS MultiStoreSvc::makePartitions ( )
inline

Create all partitions according to job options.

Definition at line 708 of file MultiStoreSvc.cpp.

709  {
710  using Parser = Gaudi::Utils::AttribStringParser;
711  std::string typ, nam;
713  for ( auto part : m_partitionDefs ) {
714  for ( auto attrib : Parser( std::move( part ) ) ) {
715  switch (::toupper( attrib.tag[0] ) ) {
716  case 'N':
717  nam = std::move( attrib.value );
718  break;
719  case 'T':
720  typ = std::move( attrib.value );
721  break;
722  }
723  }
724  STATUS sc = create( nam, typ );
725  if ( !sc.isSuccess() ) return sc;
726  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
727  }
728  return STATUS::SUCCESS;
729  }
Parse attribute strings allowing iteration over the various attributes.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
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:26
Gaudi::Property< std::string > m_defaultPartition
STATUS clearPartitions()
Clear all partitions.
T move(T...args)
void ignore() const
Definition: StatusCode.h:84
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 173 of file MultiStoreSvc.cpp.

174  {
175  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
176  }
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 fwd(Fun f)
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 178 of file MultiStoreSvc.cpp.

179  {
180  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
181  }
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 fwd(Fun f)
STATUS MultiStoreSvc::objectParent ( const OBJECT pObject,
IRegistry *&  refpParent 
)
inlineoverride

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

Definition at line 183 of file MultiStoreSvc.cpp.

184  {
185  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
186  }
STATUS fwd(Fun f)
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 188 of file MultiStoreSvc.cpp.

189  {
190  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
191  }
STATUS fwd(Fun f)
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 299 of file MultiStoreSvc.cpp.

300  {
301  return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
302  }
STATUS fwd(Fun f)
virtual StatusCode preLoad()=0
Load all preload items of the list.
Data provider interface definition.
STATUS MultiStoreSvc::preparePartitions ( )
inline

Prepare partition for usage.

Definition at line 674 of file MultiStoreSvc.cpp.

675  {
676  STATUS iret = STATUS::SUCCESS;
677  for ( auto& i : m_partitions ) {
679  [&]( ADDRESS* address ) -> STATUS {
680  if ( !address ) return STATUS::FAILURE;
681  ADDRESS* pAdd = nullptr;
682  ADDRESS* p = address;
683  auto sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(),
684  p->ipar(), pAdd );
685  return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
686  },
687  [&]( OBJECT* object ) -> STATUS {
688  if ( object && object->clID() == CLID_DataObject ) {
689  return i.second.dataManager->setRoot( m_root.path, new DataObject() );
690  }
691  return STATUS::FAILURE;
692  },
693  []( boost::blank ) -> STATUS { return STATUS::FAILURE; } );
694  if ( !sc.isSuccess() ) iret = sc;
695  }
696  return iret;
697  }
Partitions m_partitions
Datastore partitions.
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:77
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STATUS MultiStoreSvc::registerAddress ( boost::string_ref  path,
ADDRESS pAddr 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 143 of file MultiStoreSvc.cpp.

144  {
145  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
146  }
STATUS fwd(Fun f)
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerAddress ( OBJECT parent,
boost::string_ref  path,
ADDRESS pAddr 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 148 of file MultiStoreSvc.cpp.

149  {
150  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
151  }
STATUS fwd(Fun f)
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerAddress ( IRegistry parent,
boost::string_ref  path,
ADDRESS pAddr 
)
inlineoverride

IDataManagerSvc: Register object address with the data store.

Definition at line 153 of file MultiStoreSvc.cpp.

154  {
155  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
156  }
STATUS fwd(Fun f)
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
STATUS MultiStoreSvc::registerObject ( boost::string_ref  path,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 304 of file MultiStoreSvc.cpp.

305  {
306  return registerObject( nullptr, path, pObj );
307  }
STATUS registerObject(boost::string_ref path, OBJECT *pObj) override
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( boost::string_ref  parent,
boost::string_ref  obj,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 309 of file MultiStoreSvc.cpp.

310  {
311  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
312  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( boost::string_ref  parent,
int  item,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 314 of file MultiStoreSvc.cpp.

315  {
316  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, item, pObj ); } );
317  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::registerObject ( OBJECT parent,
boost::string_ref  obj,
OBJECT pObj 
)
inlineoverride

Register object with the data store.

Definition at line 319 of file MultiStoreSvc.cpp.

320  {
321  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
322  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode registerObject(boost::string_ref 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 324 of file MultiStoreSvc.cpp.

325  {
326  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
327  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS MultiStoreSvc::reinitialize ( )
inlineoverride

Service initialisation.

Definition at line 626 of file MultiStoreSvc.cpp.

627  {
629  if ( !sc.isSuccess() ) {
630  error() << "Enable to reinitialize base class" << endmsg;
631  return sc;
632  }
633  detachServices();
634  sc = attachServices();
635  if ( !sc.isSuccess() ) {
636  error() << "Failed to attach necessary services." << endmsg;
637  return sc;
638  }
639  sc = makePartitions();
640  if ( !sc.isSuccess() ) {
641  error() << "Failed to connect to store partitions." << endmsg;
642  return sc;
643  }
644  // return
645  return STATUS::SUCCESS;
646  }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
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:26
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 284 of file MultiStoreSvc.cpp.

285  {
286  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
287  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
STATUS MultiStoreSvc::removePreLoadItem ( std::string  item)
inlineoverride

Add an item to the preload list.

Definition at line 289 of file MultiStoreSvc.cpp.

290  {
291  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( std::move( item ) ); } );
292  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
T move(T...args)
STATUS MultiStoreSvc::resetPreLoad ( )
inlineoverride

Clear the preload list.

Definition at line 294 of file MultiStoreSvc.cpp.

295  {
296  return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
297  }
STATUS fwd(Fun f)
virtual StatusCode resetPreLoad()=0
Clear the preload list.
Data provider interface definition.
STATUS MultiStoreSvc::retrieveObject ( IRegistry parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 359 of file MultiStoreSvc.cpp.

360  {
361  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
362  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

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

Definition at line 364 of file MultiStoreSvc.cpp.

365  {
366  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
367  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( boost::string_ref  parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 369 of file MultiStoreSvc.cpp.

370  {
371  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
372  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( boost::string_ref  parent,
int  item,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 374 of file MultiStoreSvc.cpp.

375  {
376  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, item, pObj ); } );
377  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
STATUS MultiStoreSvc::retrieveObject ( OBJECT parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 379 of file MultiStoreSvc.cpp.

380  {
381  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
382  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref 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 384 of file MultiStoreSvc.cpp.

385  {
386  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, item, pObj ); } );
387  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref 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 138 of file MultiStoreSvc.cpp.

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

Name for root Event.

Definition at line 140 of file MultiStoreSvc.cpp.

140 { 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 264 of file MultiStoreSvc.cpp.

265  {
266  m_dataLoader = pDataLoader;
267  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
268  for ( auto& i : m_partitions ) {
269  i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore();
270  }
271  return SUCCESS;
272  }
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 234 of file MultiStoreSvc.cpp.

235  {
237  []( auto* p ) {
238  if ( p ) p->release();
239  },
240  []( boost::blank ) {} );
241  m_root.path = std::move( path );
242  m_root.root = pObj;
244  return activate( m_defaultPartition );
245  }
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:77
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
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)
STATUS preparePartitions()
Prepare partition for usage.
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 249 of file MultiStoreSvc.cpp.

250  {
252  []( auto* p ) {
253  if ( p ) p->release();
254  },
255  []( boost::blank ) {} );
256  m_root.path = std::move( path );
257  m_root.root = pAddr;
258  if ( !pAddr ) return STATUS::FAILURE;
259  pAddr->addRef();
261  return activate( m_defaultPartition );
262  }
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:77
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
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)
STATUS preparePartitions()
Prepare partition for usage.
virtual unsigned long addRef()=0
Add reference to object.
STATUS MultiStoreSvc::traverseSubTree ( boost::string_ref  path,
AGENT pAgent 
)
inlineoverride

Analyze by traversing all data objects below the sub tree.

Definition at line 218 of file MultiStoreSvc.cpp.

219  {
220  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
221  }
STATUS fwd(Fun f)
virtual StatusCode traverseSubTree(boost::string_ref 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 223 of file MultiStoreSvc.cpp.

224  {
225  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
226  }
STATUS fwd(Fun f)
virtual StatusCode traverseSubTree(boost::string_ref 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 228 of file MultiStoreSvc.cpp.

229  {
230  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
231  }
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
STATUS fwd(Fun f)
STATUS MultiStoreSvc::unlinkObject ( IRegistry from,
boost::string_ref  objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 439 of file MultiStoreSvc.cpp.

440  {
441  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
442  }
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
STATUS fwd(Fun f)
Data provider interface definition.
STATUS MultiStoreSvc::unlinkObject ( boost::string_ref  from,
boost::string_ref  objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 444 of file MultiStoreSvc.cpp.

445  {
446  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
447  }
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
STATUS fwd(Fun f)
Data provider interface definition.
STATUS MultiStoreSvc::unlinkObject ( OBJECT from,
boost::string_ref  objPath 
)
inlineoverride

Remove a link to another object.

Definition at line 449 of file MultiStoreSvc.cpp.

450  {
451  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
452  }
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
STATUS fwd(Fun f)
Data provider interface definition.
STATUS MultiStoreSvc::unlinkObject ( boost::string_ref  path)
inlineoverride

Remove a link to another object.

Definition at line 454 of file MultiStoreSvc.cpp.

455  {
456  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
457  }
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
STATUS fwd(Fun f)
Data provider interface definition.
STATUS MultiStoreSvc::unregisterAddress ( boost::string_ref  path)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 158 of file MultiStoreSvc.cpp.

159  {
160  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
161  }
STATUS fwd(Fun f)
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterAddress ( OBJECT pParent,
boost::string_ref  path 
)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 163 of file MultiStoreSvc.cpp.

164  {
165  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
166  }
STATUS fwd(Fun f)
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterAddress ( IRegistry pParent,
boost::string_ref  path 
)
inlineoverride

IDataManagerSvc: Unregister object address from the data store.

Definition at line 168 of file MultiStoreSvc.cpp.

169  {
170  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
171  }
STATUS fwd(Fun f)
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
STATUS MultiStoreSvc::unregisterObject ( boost::string_ref  path)
inlineoverride

Unregister object from the data store.

Definition at line 329 of file MultiStoreSvc.cpp.

330  {
331  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
332  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( boost::string_ref  parent,
boost::string_ref  obj 
)
inlineoverride

Unregister object from the data store.

Definition at line 334 of file MultiStoreSvc.cpp.

335  {
336  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( parent, obj ); } );
337  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( boost::string_ref  parent,
int  obj 
)
inlineoverride

Unregister object from the data store.

Definition at line 339 of file MultiStoreSvc.cpp.

340  {
341  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( parent, obj ); } );
342  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( OBJECT pObj)
inlineoverride

Unregister object from the data store.

Definition at line 344 of file MultiStoreSvc.cpp.

345  {
346  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
347  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::unregisterObject ( OBJECT pObj,
boost::string_ref  path 
)
inlineoverride

Unregister object from the data store.

Definition at line 349 of file MultiStoreSvc.cpp.

350  {
351  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
352  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref 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 354 of file MultiStoreSvc.cpp.

355  {
356  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, item ); } );
357  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
STATUS MultiStoreSvc::updateObject ( IRegistry pDirectory)
inlineoverride

Update object identified by its directory entry.

Definition at line 459 of file MultiStoreSvc.cpp.

460  {
461  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
462  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( boost::string_ref  path)
inlineoverride

Update object.

Definition at line 464 of file MultiStoreSvc.cpp.

465  {
466  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( path ); } );
467  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( OBJECT pObj)
inlineoverride

Update object.

Definition at line 469 of file MultiStoreSvc.cpp.

470  {
471  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
472  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( boost::string_ref  parent,
boost::string_ref  updatePath 
)
inlineoverride

Update object.

Definition at line 474 of file MultiStoreSvc.cpp.

475  {
476  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( parent, updatePath ); } );
477  }
STATUS fwd(Fun f)
Data provider interface definition.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS MultiStoreSvc::updateObject ( OBJECT parent,
boost::string_ref  updatePath 
)
inlineoverride

Update object.

Definition at line 479 of file MultiStoreSvc.cpp.

480  {
481  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( parent, updatePath ); } );
482  }
STATUS fwd(Fun f)
Data provider interface definition.
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 117 of file MultiStoreSvc.cpp.

Partition MultiStoreSvc::m_current
protected

Current partition.

Definition at line 124 of file MultiStoreSvc.cpp.

SmartIF<IConversionSvc> MultiStoreSvc::m_dataLoader
protected

Pointer to data loader service.

Definition at line 115 of file MultiStoreSvc.cpp.

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

Definition at line 112 of file MultiStoreSvc.cpp.

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

Definition at line 111 of file MultiStoreSvc.cpp.

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

Definition at line 110 of file MultiStoreSvc.cpp.

Partitions MultiStoreSvc::m_partitions
protected

Datastore partitions.

Definition at line 126 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 108 of file MultiStoreSvc.cpp.

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

Definition at line 109 of file MultiStoreSvc.cpp.


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