The Gaudi Framework  v30r3 (a5ef0a68)
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...
 
StatusCode registerAddress (boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
StatusCode registerAddress (OBJECT *parent, boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
StatusCode registerAddress (IRegistry *parent, boost::string_ref path, ADDRESS *pAddr) override
 IDataManagerSvc: Register object address with the data store. More...
 
StatusCode unregisterAddress (boost::string_ref path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
StatusCode unregisterAddress (OBJECT *pParent, boost::string_ref path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
StatusCode unregisterAddress (IRegistry *pParent, boost::string_ref path) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
StatusCode objectLeaves (const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
 Explore the object store: retrieve all leaves attached to the object. More...
 
StatusCode objectLeaves (const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
 Explore the object store: retrieve all leaves attached to the object. More...
 
StatusCode objectParent (const OBJECT *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
StatusCode objectParent (const IRegistry *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
StatusCode clearSubTree (boost::string_ref path) override
 Remove all data objects below the sub tree identified. More...
 
StatusCode clearSubTree (OBJECT *pObject) override
 Remove all data objects below the sub tree identified. More...
 
StatusCode clearStore () override
 IDataManagerSvc: Remove all data objects in the data store. More...
 
StatusCode traverseSubTree (boost::string_ref path, AGENT *pAgent) override
 Analyze by traversing all data objects below the sub tree. More...
 
StatusCode traverseSubTree (OBJECT *pObject, AGENT *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
StatusCode traverseTree (AGENT *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
StatusCode setRoot (std::string path, OBJECT *pObj) override
 Initialize data store for new event by giving new event path and root object. More...
 
StatusCode setRoot (std::string path, ADDRESS *pAddr) override
 Initialize data store for new event by giving new event path and address of root object. More...
 
StatusCode setDataLoader (IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
 IDataManagerSvc: Pass a default data loader to the service. More...
 
StatusCode addPreLoadItem (const DataStoreItem &item) override
 Add an item to the preload list. More...
 
StatusCode addPreLoadItem (std::string item) override
 Add an item to the preload list. More...
 
StatusCode removePreLoadItem (const DataStoreItem &item) override
 Remove an item from the preload list. More...
 
StatusCode removePreLoadItem (std::string item) override
 Add an item to the preload list. More...
 
StatusCode resetPreLoad () override
 Clear the preload list. More...
 
StatusCode preLoad () override
 load all preload items of the list More...
 
StatusCode registerObject (boost::string_ref path, OBJECT *pObj) override
 Register object with the data store. More...
 
StatusCode registerObject (boost::string_ref parent, boost::string_ref obj, OBJECT *pObj) override
 Register object with the data store. More...
 
StatusCode registerObject (boost::string_ref parent, int item, OBJECT *pObj) override
 Register object with the data store. More...
 
StatusCode registerObject (OBJECT *parent, boost::string_ref obj, OBJECT *pObj) override
 Register object with the data store. More...
 
StatusCode registerObject (OBJECT *parent, int obj, OBJECT *pObj) override
 Register object with the data store. More...
 
StatusCode unregisterObject (boost::string_ref path) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (boost::string_ref parent, boost::string_ref obj) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (boost::string_ref parent, int obj) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (OBJECT *pObj) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (OBJECT *pObj, boost::string_ref path) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (OBJECT *pObj, int item) override
 Unregister object from the data store. More...
 
StatusCode retrieveObject (IRegistry *parent, boost::string_ref path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
StatusCode retrieveObject (boost::string_ref path, OBJECT *&pObj) override
 Retrieve object identified by its full path from the data store. More...
 
StatusCode retrieveObject (boost::string_ref parent, boost::string_ref path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
StatusCode retrieveObject (boost::string_ref parent, int item, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
StatusCode retrieveObject (OBJECT *parent, boost::string_ref path, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
StatusCode retrieveObject (OBJECT *parent, int item, OBJECT *&pObj) override
 Retrieve object from data store. More...
 
StatusCode findObject (boost::string_ref path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
StatusCode findObject (IRegistry *parent, boost::string_ref path, OBJECT *&pObj) override
 Find object identified by its full path in the data store. More...
 
StatusCode findObject (boost::string_ref parent, boost::string_ref path, OBJECT *&pObj) override
 Find object in the data store. More...
 
StatusCode findObject (boost::string_ref parent, int item, OBJECT *&pObject) override
 Find object in the data store. More...
 
StatusCode findObject (OBJECT *parent, boost::string_ref path, OBJECT *&pObject) override
 Find object in the data store. More...
 
StatusCode findObject (OBJECT *parent, int item, OBJECT *&pObject) override
 Find object in the data store. More...
 
StatusCode linkObject (IRegistry *from, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
StatusCode linkObject (boost::string_ref from, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
StatusCode linkObject (OBJECT *from, boost::string_ref objPath, OBJECT *to) override
 Add a link to another object. More...
 
StatusCode linkObject (boost::string_ref fullPath, OBJECT *to) override
 Add a link to another object. More...
 
StatusCode unlinkObject (IRegistry *from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
StatusCode unlinkObject (boost::string_ref from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
StatusCode unlinkObject (OBJECT *from, boost::string_ref objPath) override
 Remove a link to another object. More...
 
StatusCode unlinkObject (boost::string_ref path) override
 Remove a link to another object. More...
 
StatusCode updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry. More...
 
StatusCode updateObject (boost::string_ref path) override
 Update object. More...
 
StatusCode updateObject (OBJECT *pObj) override
 Update object. More...
 
StatusCode updateObject (boost::string_ref parent, boost::string_ref updatePath) override
 Update object. More...
 
StatusCode updateObject (OBJECT *parent, boost::string_ref updatePath) override
 Update object. More...
 
StatusCode create (CSTR &nam, CSTR &typ) override
 Create a partition object. The name identifies the partition uniquely. More...
 
StatusCode create (CSTR &nam, CSTR &typ, IInterface *&pPartition) override
 Create a partition object. The name identifies the partition uniquely. More...
 
StatusCode drop (CSTR &nam) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
StatusCode drop (IInterface *pPartition) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
StatusCode activate (CSTR &nam) override
 Activate a partition object. The name identifies the partition uniquely. More...
 
StatusCode activate (IInterface *pPartition) override
 Activate a partition object. More...
 
StatusCode 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...
 
StatusCode attachServices ()
 
StatusCode detachServices ()
 
StatusCode initialize () override
 Service initialisation. More...
 
StatusCode reinitialize () override
 Service initialisation. More...
 
StatusCode finalize () override
 Service initialisation. More...
 
 ~MultiStoreSvc () override
 Standard Destructor. More...
 
StatusCode preparePartitions ()
 Prepare partition for usage. More...
 
StatusCode clearPartitions ()
 Clear all partitions. More...
 
StatusCode 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...
 
- 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
 
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, 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
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const
 Backward compatibility function for getting the output level. More...
 
- 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...
 

Protected Types

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

Protected Member Functions

template<typename Fun >
StatusCode 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 () const
 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
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- 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 101 of file MultiStoreSvc.cpp.

Member Typedef Documentation

Definition at line 104 of file MultiStoreSvc.cpp.

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

Definition at line 105 of file MultiStoreSvc.cpp.

Constructor & Destructor Documentation

MultiStoreSvc::~MultiStoreSvc ( )
inlineoverride

Standard Destructor.

Definition at line 664 of file MultiStoreSvc.cpp.

665  {
666  setDataLoader( nullptr ).ignore();
667  resetPreLoad().ignore();
668  clearStore().ignore();
670  }
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
StatusCode clearPartitions()
Clear all partitions.
StatusCode resetPreLoad() override
Clear the preload list.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.

Member Function Documentation

StatusCode MultiStoreSvc::activate ( CSTR nam)
inlineoverride

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

Definition at line 530 of file MultiStoreSvc.cpp.

531  {
532  auto i = m_partitions.find( nam );
533  if ( i != m_partitions.end() ) {
534  m_current = i->second;
535  return StatusCode::SUCCESS;
536  }
537  m_current = {};
539  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Partition m_current
Current partition.
T find(T...args)
StatusCode MultiStoreSvc::activate ( IInterface pPartition)
inlineoverride

Activate a partition object.

Definition at line 542 of file MultiStoreSvc.cpp.

543  {
544  auto provider = SmartIF<IDataProviderSvc>( pPartition );
545  m_current = Partition();
546  if ( !provider ) return IInterface::Status::NO_INTERFACE;
548  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
550  m_current = i->second;
551  return StatusCode::SUCCESS;
552  }
Requested interface is not available.
Partitions m_partitions
Datastore partitions.
T end(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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 567 of file MultiStoreSvc.cpp.

568  {
569  if ( m_current.dataProvider ) {
570  nam = m_current.name;
571  pPartition = m_current.dataProvider;
572  return StatusCode::SUCCESS;
573  }
574  nam.clear();
575  pPartition = nullptr;
577  }
T clear(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Partition m_current
Current partition.
StatusCode MultiStoreSvc::addPreLoadItem ( const DataStoreItem item)
inlineoverride

Add an item to the preload list.

Definition at line 273 of file MultiStoreSvc.cpp.

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

Add an item to the preload list.

Definition at line 278 of file MultiStoreSvc.cpp.

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

Definition at line 579 of file MultiStoreSvc.cpp.

580  {
581  // Attach address creator facility
582  m_addrCreator = service( m_loader, true );
583  if ( !m_addrCreator ) {
584  error() << "Failed to retrieve data loader "
585  << "\"" << m_loader << "\"" << endmsg;
586  return StatusCode::FAILURE;
587  }
588  // Attach data loader facility
589  auto dataLoader = service<IConversionSvc>( m_loader, true );
590  if ( !dataLoader ) {
591  error() << "Failed to retrieve data loader "
592  << "\"" << m_loader << "\"" << endmsg;
593  return StatusCode::FAILURE;
594  }
595  auto sc = setDataLoader( dataLoader.get() );
596  if ( !sc.isSuccess() ) {
597  error() << "Failed to set data loader "
598  << "\"" << m_loader << "\"" << endmsg;
599  }
600  return sc;
601  }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
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 setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
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:84
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StatusCode 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 StatusCode::SUCCESS;
705  }
Partitions m_partitions
Datastore partitions.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
StatusCode MultiStoreSvc::clearStore ( )
inlineoverride

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 202 of file MultiStoreSvc.cpp.

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

Remove all data objects below the sub tree identified.

Definition at line 192 of file MultiStoreSvc.cpp.

193  {
194  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
195  }
StatusCode 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.
StatusCode MultiStoreSvc::clearSubTree ( OBJECT pObject)
inlineoverride

Remove all data objects below the sub tree identified.

Definition at line 197 of file MultiStoreSvc.cpp.

198  {
199  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
200  }
StatusCode 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.
StatusCode MultiStoreSvc::create ( CSTR nam,
CSTR typ 
)
inlineoverride

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

Definition at line 484 of file MultiStoreSvc.cpp.

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

491  {
492  if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
494  auto isvc = serviceLocator()->service<IService>( typ );
495  if ( !isvc ) return IInterface::Status::NO_INTERFACE;
496  auto dataMgr = isvc.as<IDataManagerSvc>();
497  auto dataProv = isvc.as<IDataProviderSvc>();
498  if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
499  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
500  return StatusCode::SUCCESS;
501  }
Requested interface is not available.
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
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
T emplace(T...args)
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:291
StatusCode MultiStoreSvc::detachServices ( )
inline

Definition at line 603 of file MultiStoreSvc.cpp.

604  {
607  return StatusCode::SUCCESS;
608  }
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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
StatusCode MultiStoreSvc::drop ( CSTR nam)
inlineoverride

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

Definition at line 504 of file MultiStoreSvc.cpp.

505  {
506  auto i = m_partitions.find( nam );
508  if ( i->second.dataManager == m_current.dataManager ) {
509  m_current = Partition();
510  }
511  i->second.dataManager->clearStore().ignore();
512  m_partitions.erase( i );
513  return StatusCode::SUCCESS;
514  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
T erase(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Partition m_current
Current partition.
T find(T...args)
StatusCode MultiStoreSvc::drop ( IInterface pPartition)
inlineoverride

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

Definition at line 517 of file MultiStoreSvc.cpp.

518  {
519  auto provider = SmartIF<IDataProviderSvc>( pPartition );
520  if ( !provider ) return IInterface::Status::NO_INTERFACE;
522  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
524  i->second.dataManager->clearStore().ignore();
525  m_partitions.erase( i );
526  return StatusCode::SUCCESS;
527  }
Requested interface is not available.
Partitions m_partitions
Datastore partitions.
T end(T...args)
T erase(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
T find_if(T...args)
T begin(T...args)
StatusCode MultiStoreSvc::finalize ( )
inlineoverride

Service initialisation.

Definition at line 648 of file MultiStoreSvc.cpp.

649  {
650  setDataLoader( nullptr ).ignore();
651  clearStore().ignore();
653  m_current = Partition();
654  detachServices();
655  return Service::finalize();
656  }
StatusCode detachServices()
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
StatusCode finalize() override
Definition: Service.cpp:173
StatusCode clearPartitions()
Clear all partitions.
Partition m_current
Current partition.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode MultiStoreSvc::findObject ( boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

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

Definition at line 388 of file MultiStoreSvc.cpp.

389  {
390  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
391  }
StatusCode 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.
StatusCode 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 393 of file MultiStoreSvc.cpp.

394  {
395  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
396  }
StatusCode 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.
StatusCode MultiStoreSvc::findObject ( boost::string_ref  parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Find object in the data store.

Definition at line 398 of file MultiStoreSvc.cpp.

399  {
400  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
401  }
StatusCode 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.
StatusCode MultiStoreSvc::findObject ( boost::string_ref  parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 403 of file MultiStoreSvc.cpp.

404  {
405  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, item, pObject ); } );
406  }
StatusCode 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.
StatusCode MultiStoreSvc::findObject ( OBJECT parent,
boost::string_ref  path,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 408 of file MultiStoreSvc.cpp.

409  {
410  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObject ); } );
411  }
StatusCode 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.
StatusCode MultiStoreSvc::findObject ( OBJECT parent,
int  item,
OBJECT *&  pObject 
)
inlineoverride

Find object in the data store.

Definition at line 413 of file MultiStoreSvc.cpp.

414  {
415  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, item, pObject ); } );
416  }
StatusCode 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 >
StatusCode MultiStoreSvc::fwd ( Fun  f)
inlineprotected

Definition at line 129 of file MultiStoreSvc.cpp.

130  {
131  auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
132  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
133  }
Data provider interface definition.
Partition m_current
Current partition.
StatusCode MultiStoreSvc::get ( CSTR nam,
IInterface *&  pPartition 
) const
inlineoverride

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

Definition at line 555 of file MultiStoreSvc.cpp.

556  {
557  auto i = m_partitions.find( nam );
558  if ( i != m_partitions.end() ) {
559  pPartition = i->second.dataProvider;
560  return StatusCode::SUCCESS;
561  }
562  pPartition = nullptr;
564  }
Partitions m_partitions
Datastore partitions.
T end(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
T find(T...args)
StatusCode MultiStoreSvc::initialize ( )
inlineoverride

Service initialisation.

Definition at line 611 of file MultiStoreSvc.cpp.

612  {
613  // Nothing to do: just call base class initialisation
615  if ( !sc.isSuccess() ) return sc;
616  sc = makePartitions();
617  if ( !sc.isSuccess() ) {
618  error() << "Failed to connect to all store partitions." << endmsg;
619  return sc;
620  }
621  return attachServices();
622  }
StatusCode initialize() override
Definition: Service.cpp:63
bool isSuccess() const
Definition: StatusCode.h:287
StatusCode attachServices()
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode makePartitions()
Create all partitions according to job options.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StatusCode MultiStoreSvc::linkObject ( IRegistry from,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 418 of file MultiStoreSvc.cpp.

419  {
420  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
421  }
StatusCode 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.
StatusCode MultiStoreSvc::linkObject ( boost::string_ref  from,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 423 of file MultiStoreSvc.cpp.

424  {
425  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
426  }
StatusCode 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.
StatusCode MultiStoreSvc::linkObject ( OBJECT from,
boost::string_ref  objPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 428 of file MultiStoreSvc.cpp.

429  {
430  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
431  }
StatusCode 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.
StatusCode MultiStoreSvc::linkObject ( boost::string_ref  fullPath,
OBJECT to 
)
inlineoverride

Add a link to another object.

Definition at line 433 of file MultiStoreSvc.cpp.

434  {
435  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
436  }
StatusCode 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.
StatusCode 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  StatusCode sc = create( nam, typ );
725  if ( !sc.isSuccess() ) return sc;
726  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
727  }
728  return StatusCode::SUCCESS;
729  }
Parse attribute strings allowing iteration over the various attributes.
StatusCode create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
bool isSuccess() const
Definition: StatusCode.h:287
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode clearPartitions()
Clear all partitions.
Gaudi::Property< std::string > m_defaultPartition
T move(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
Gaudi::Property< PartitionDefs > m_partitionDefs
void toupper(std::string &s)
StatusCode MultiStoreSvc::objectLeaves ( const OBJECT pObject,
std::vector< IRegistry * > &  leaves 
)
inlineoverride

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

Definition at line 172 of file MultiStoreSvc.cpp.

173  {
174  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
175  }
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 ...
StatusCode fwd(Fun f)
StatusCode MultiStoreSvc::objectLeaves ( const IRegistry pObject,
std::vector< IRegistry * > &  leaves 
)
inlineoverride

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

Definition at line 177 of file MultiStoreSvc.cpp.

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

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

Definition at line 182 of file MultiStoreSvc.cpp.

183  {
184  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
185  }
StatusCode fwd(Fun f)
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode MultiStoreSvc::objectParent ( const IRegistry pObject,
IRegistry *&  refpParent 
)
inlineoverride

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

Definition at line 187 of file MultiStoreSvc.cpp.

188  {
189  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
190  }
StatusCode fwd(Fun f)
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode MultiStoreSvc::preLoad ( )
inlineoverride

load all preload items of the list

Definition at line 298 of file MultiStoreSvc.cpp.

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

Prepare partition for usage.

Definition at line 673 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Register object address with the data store.

Definition at line 142 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Register object address with the data store.

Definition at line 147 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Register object address with the data store.

Definition at line 152 of file MultiStoreSvc.cpp.

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

Register object with the data store.

Definition at line 303 of file MultiStoreSvc.cpp.

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

Register object with the data store.

Definition at line 308 of file MultiStoreSvc.cpp.

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

Register object with the data store.

Definition at line 313 of file MultiStoreSvc.cpp.

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

Register object with the data store.

Definition at line 318 of file MultiStoreSvc.cpp.

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

Register object with the data store.

Definition at line 323 of file MultiStoreSvc.cpp.

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

Service initialisation.

Definition at line 625 of file MultiStoreSvc.cpp.

626  {
628  if ( !sc.isSuccess() ) {
629  error() << "Enable to reinitialize base class" << endmsg;
630  return sc;
631  }
632  detachServices();
633  sc = attachServices();
634  if ( !sc.isSuccess() ) {
635  error() << "Failed to attach necessary services." << endmsg;
636  return sc;
637  }
638  sc = makePartitions();
639  if ( !sc.isSuccess() ) {
640  error() << "Failed to connect to store partitions." << endmsg;
641  return sc;
642  }
643  // return
644  return StatusCode::SUCCESS;
645  }
StatusCode detachServices()
bool isSuccess() const
Definition: StatusCode.h:287
StatusCode attachServices()
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode reinitialize() override
Definition: Service.cpp:249
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
StatusCode makePartitions()
Create all partitions according to job options.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StatusCode MultiStoreSvc::removePreLoadItem ( const DataStoreItem item)
inlineoverride

Remove an item from the preload list.

Definition at line 283 of file MultiStoreSvc.cpp.

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

Add an item to the preload list.

Definition at line 288 of file MultiStoreSvc.cpp.

289  {
290  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( std::move( item ) ); } );
291  }
StatusCode 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)
StatusCode MultiStoreSvc::resetPreLoad ( )
inlineoverride

Clear the preload list.

Definition at line 293 of file MultiStoreSvc.cpp.

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

Retrieve object from data store.

Definition at line 358 of file MultiStoreSvc.cpp.

359  {
360  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
361  }
StatusCode 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.
StatusCode MultiStoreSvc::retrieveObject ( boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

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

Definition at line 363 of file MultiStoreSvc.cpp.

364  {
365  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
366  }
StatusCode 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.
StatusCode MultiStoreSvc::retrieveObject ( boost::string_ref  parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 368 of file MultiStoreSvc.cpp.

369  {
370  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
371  }
StatusCode 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.
StatusCode MultiStoreSvc::retrieveObject ( boost::string_ref  parent,
int  item,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 373 of file MultiStoreSvc.cpp.

374  {
375  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, item, pObj ); } );
376  }
StatusCode 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.
StatusCode MultiStoreSvc::retrieveObject ( OBJECT parent,
boost::string_ref  path,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 378 of file MultiStoreSvc.cpp.

379  {
380  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
381  }
StatusCode 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.
StatusCode MultiStoreSvc::retrieveObject ( OBJECT parent,
int  item,
OBJECT *&  pObj 
)
inlineoverride

Retrieve object from data store.

Definition at line 383 of file MultiStoreSvc.cpp.

384  {
385  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, item, pObj ); } );
386  }
StatusCode 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 137 of file MultiStoreSvc.cpp.

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

Name for root Event.

Definition at line 139 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 263 of file MultiStoreSvc.cpp.

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

234  {
236  []( auto* p ) {
237  if ( p ) p->release();
238  },
239  []( boost::blank ) {} );
240  m_root.path = std::move( path );
241  m_root.root = pObj;
243  return activate( m_defaultPartition );
244  }
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:29
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
Gaudi::Property< std::string > m_defaultPartition
StatusCode preparePartitions()
Prepare partition for usage.
T move(T...args)
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
StatusCode 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 248 of file MultiStoreSvc.cpp.

249  {
251  []( auto* p ) {
252  if ( p ) p->release();
253  },
254  []( boost::blank ) {} );
255  m_root.path = std::move( path );
256  m_root.root = pAddr;
257  if ( !pAddr ) return StatusCode::FAILURE;
258  pAddr->addRef();
260  return activate( m_defaultPartition );
261  }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
struct MultiStoreSvc::tagROOT m_root
auto dispatch_variant
Definition: FunAdapters.h:29
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
Gaudi::Property< std::string > m_defaultPartition
StatusCode preparePartitions()
Prepare partition for usage.
T move(T...args)
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
virtual unsigned long addRef()=0
Add reference to object.
StatusCode MultiStoreSvc::traverseSubTree ( boost::string_ref  path,
AGENT pAgent 
)
inlineoverride

Analyze by traversing all data objects below the sub tree.

Definition at line 217 of file MultiStoreSvc.cpp.

218  {
219  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
220  }
StatusCode 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...
StatusCode MultiStoreSvc::traverseSubTree ( OBJECT pObject,
AGENT pAgent 
)
inlineoverride

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

Definition at line 222 of file MultiStoreSvc.cpp.

223  {
224  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
225  }
StatusCode 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...
StatusCode MultiStoreSvc::traverseTree ( AGENT pAgent)
inlineoverride

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

Definition at line 227 of file MultiStoreSvc.cpp.

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

Remove a link to another object.

Definition at line 438 of file MultiStoreSvc.cpp.

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

Remove a link to another object.

Definition at line 443 of file MultiStoreSvc.cpp.

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

Remove a link to another object.

Definition at line 448 of file MultiStoreSvc.cpp.

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

Remove a link to another object.

Definition at line 453 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 157 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 162 of file MultiStoreSvc.cpp.

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 167 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 328 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 333 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 338 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 343 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 348 of file MultiStoreSvc.cpp.

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

Unregister object from the data store.

Definition at line 353 of file MultiStoreSvc.cpp.

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

Update object identified by its directory entry.

Definition at line 458 of file MultiStoreSvc.cpp.

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

Update object.

Definition at line 463 of file MultiStoreSvc.cpp.

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

Update object.

Definition at line 468 of file MultiStoreSvc.cpp.

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

Update object.

Definition at line 473 of file MultiStoreSvc.cpp.

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

Update object.

Definition at line 478 of file MultiStoreSvc.cpp.

479  {
480  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( parent, updatePath ); } );
481  }
StatusCode 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 116 of file MultiStoreSvc.cpp.

Partition MultiStoreSvc::m_current
protected

Current partition.

Definition at line 123 of file MultiStoreSvc.cpp.

SmartIF<IConversionSvc> MultiStoreSvc::m_dataLoader
protected

Pointer to data loader service.

Definition at line 114 of file MultiStoreSvc.cpp.

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

Definition at line 111 of file MultiStoreSvc.cpp.

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

Definition at line 110 of file MultiStoreSvc.cpp.

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

Definition at line 109 of file MultiStoreSvc.cpp.

Partitions MultiStoreSvc::m_partitions
protected

Datastore partitions.

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

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

Definition at line 108 of file MultiStoreSvc.cpp.


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