The Gaudi Framework  master (37c0b60a)
DataSvc Class Reference

#include <GaudiKernel/DataSvc.h>

Inheritance diagram for DataSvc:
Collaboration diagram for DataSvc:

Public Member Functions

CLID rootCLID () const override
 IDataManagerSvc: Accessor for root event CLID. More...
 
const std::stringrootName () const override
 IDataManagerSvc: Accessor for root event name. More...
 
StatusCode registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store. More...
 
StatusCode registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store. More...
 
StatusCode unregisterAddress (std::string_view fullPath) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
StatusCode unregisterAddress (IRegistry *pParent, std::string_view objPath) override
 IDataManagerSvc: Unregister object address from the data store. More...
 
StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
StatusCode clearSubTree (std::string_view sub_tree_path) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
 
StatusCode clearSubTree (DataObject *pObject) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
 
StatusCode clearStore () override
 IDataManagerSvc: Remove all data objects in the data store. More...
 
StatusCode traverseSubTree (std::string_view sub_tree_path, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
 
StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
StatusCode traverseTree (IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
StatusCode setRoot (std::string root_name, DataObject *pRootObj) override
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode i_setRoot (std::string root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
StatusCode setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
StatusCode setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider. More...
 
StatusCode addPreLoadItem (const DataStoreItem &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 resetPreLoad () override
 Clear the preload list. More...
 
virtual StatusCode preLoad (int depth, int load_depth, DataObject *pObject)
 Execute one level of preloading and recursively load until the final level is reached. More...
 
StatusCode preLoad () override
 load all preload items of the list More...
 
StatusCode registerObject (std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
 Register object with the data store. More...
 
StatusCode registerObject (DataObject *parentObj, std::string_view objPath, DataObject *pObject) override
 Register object with the data store. More...
 
StatusCode unregisterObject (std::string_view fullPath) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (DataObject *pObject) override
 Unregister object from the data store. More...
 
StatusCode unregisterObject (DataObject *pObject, std::string_view objectPath) override
 Unregister object from the data store. More...
 
StatusCode retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Retrieve object from data store. More...
 
StatusCode findObject (std::string_view fullPath, DataObject *&pObject) override
 Find object identified by its full path in the data store. More...
 
StatusCode findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Find object identified by its full path in the data store. More...
 
StatusCode linkObject (IRegistry *from, std::string_view objPath, DataObject *to) override
 Add a link to another object. More...
 
StatusCode linkObject (std::string_view fullPath, DataObject *to) override
 Add a link to another object. More...
 
StatusCode unlinkObject (IRegistry *from, std::string_view objPath) override
 Remove a link to another object. More...
 
StatusCode unlinkObject (DataObject *fromObj, std::string_view objPath) override
 Remove a link to another object. More...
 
StatusCode unlinkObject (std::string_view fullPath) override
 Remove a link to another object. More...
 
StatusCode updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry. More...
 
StatusCode updateObject (DataObject *toUpdate) override
 Update object. More...
 
StatusCode initialize () override
 Service initialization. More...
 
StatusCode reinitialize () override
 Service initialization. More...
 
StatusCode finalize () override
 Service initialization. More...
 
 DataSvc (const DataSvc &)=delete
 copy constructor disabled More...
 
DataSvcoperator= (const DataSvc &)=delete
 Fake assignment operator (never implemented). More...
 
virtual StatusCode registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress)=0
 Register object address with the data store. More...
 
StatusCode registerAddress (DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
 Register object address with the data store. More...
 
virtual StatusCode registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)=0
 Register object address with the data store. More...
 
virtual StatusCode unregisterAddress (std::string_view fullPath)=0
 Unregister object address from the data store. More...
 
StatusCode unregisterAddress (DataObject *pParent, std::string_view objPath)
 Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (IRegistry *pParent, std::string_view objPath)=0
 Unregister object address from the data store. More...
 
StatusCode registerObject (std::string_view fullPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (std::string_view parentPath, std::string_view objectPath, DataObject *pObject)=0
 Register object with the data store. More...
 
StatusCode registerObject (std::string_view parentPath, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, std::string_view objectPath, DataObject *pObject)=0
 Register object with the data store. More...
 
StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
 Retrieve object identified by its directory entry. More...
 
StatusCode retrieveObject (std::string_view fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store. More...
 
StatusCode retrieveObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
StatusCode retrieveObject (std::string_view parentPath, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
StatusCode retrieveObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
 Find object identified by its directory entry. More...
 
virtual StatusCode findObject (std::string_view fullPath, DataObject *&pObject)=0
 Find object identified by its full path in the data store. More...
 
StatusCode findObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent. More...
 
StatusCode findObject (std::string_view parentPath, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store. More...
 
StatusCode findObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent. More...
 
StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store. More...
 
virtual StatusCode linkObject (IRegistry *from, std::string_view objPath, DataObject *toObj)=0
 Add a link to another object. More...
 
StatusCode linkObject (std::string_view fromPath, std::string_view objPath, DataObject *toObj)
 Add a link to another object. More...
 
StatusCode linkObject (DataObject *fromObj, std::string_view objPath, DataObject *toObj)
 Add a link to another object. More...
 
virtual StatusCode linkObject (std::string_view fullPath, DataObject *toObj)=0
 Add a link to another object. More...
 
virtual StatusCode unlinkObject (IRegistry *from, std::string_view objPath)=0
 Remove a link to another object. More...
 
StatusCode unlinkObject (std::string_view fromPath, std::string_view objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (DataObject *fromObj, std::string_view objPath)=0
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (std::string_view fullPath)=0
 Remove a link to another object. More...
 
- Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
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...
 
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 >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
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 std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view 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 (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 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...
 

Protected Member Functions

bool checkRoot ()
 Check if root path is valid. More...
 
virtual IConversionSvcgetDataLoader (IRegistry *pReg)
 Retrieve customizable data loader according to registry entry to be retrieved. More...
 
virtual DataObjectcreateDefaultObject () const
 Create default objects in case forced creation of leaves is requested. More...
 
virtual StatusCode loadObject (IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation. More...
 
virtual StatusCode loadObject (IConversionSvc *pLoader, IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation. More...
 
StatusCode retrieveEntry (DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
 Retrieve registry entry from store. More...
 
DataObjecthandleDataFault (IRegistry *pReg, std::string_view path="")
 Invoke data fault handling if enabled. More...
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 Standard Destructor
More...
 
int outputLevel () const
 get the Service's output level More...
 
- 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

SmartIF< IIncidentSvcm_incidentSvc = nullptr
 Pointer to incident service. More...
 
Gaudi::Property< CLIDm_rootCLID { this, "RootCLID", 110 , "CLID of root entry" }
 
Gaudi::Property< std::stringm_rootName { this, "RootName", "/Event", "name of root entry" }
 
std::unique_ptr< DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry. 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" }
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
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()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service
More...
 

Private Member Functions

StatusCode i_retrieveEntry (DataSvcHelpers::RegistryEntry *parentObj, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
 
DataObjecti_handleDataFault (IRegistry *pReg, std::string_view path=std::string_view{})
 

Private Attributes

SmartIF< IConversionSvcm_dataLoader = nullptr
 Pointer to data loader service. More...
 
Gaudi::Property< bool > m_forceLeaves
 
Gaudi::Property< std::vector< std::string > > m_inhibitPathes { this, "InhibitPathes", {}, "inhibited leaves" }
 
Gaudi::Property< bool > m_enableFaultHdlr
 
Gaudi::Property< std::stringm_faultName { this, "DataFaultName", "DataFault", "Name of the data fault incident" }
 
Gaudi::Property< bool > m_enableAccessHdlr
 
Gaudi::Property< std::stringm_accessName { this, "DataAccessName", "DataAccess", "Name of the data access incident" }
 
std::vector< DataStoreItemm_preLoads
 Items to be pre-loaded. More...
 

Additional Inherited Members

- Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
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 and IDataManagerSvc interfaces.

Author
Markus Frank
Sebastien Ponce
Version
1.0

Definition at line 52 of file DataSvc.h.

Constructor & Destructor Documentation

◆ DataSvc()

DataSvc::DataSvc ( const DataSvc )
delete

copy constructor disabled

Member Function Documentation

◆ addPreLoadItem()

StatusCode DataSvc::addPreLoadItem ( const DataStoreItem item)
override

Add an item to the preload list.

Definition at line 775 of file DataSvc.cpp.

775  {
776  auto i = std::find( begin( m_preLoads ), end( m_preLoads ), item );
777  if ( i == end( m_preLoads ) ) m_preLoads.push_back( item );
778  return StatusCode::SUCCESS;
779 }

◆ checkRoot()

bool DataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 264 of file DataSvc.h.

264 { return 0 != m_root; }

◆ clearStore()

StatusCode DataSvc::clearStore ( )
override

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 111 of file DataSvc.cpp.

111  {
112  if ( checkRoot() ) m_root.reset();
113  return StatusCode::SUCCESS;
114 }

◆ clearSubTree() [1/2]

StatusCode DataSvc::clearSubTree ( DataObject pObject)
override

IDataManagerSvc: Remove all data objects below the sub tree identified by the object.

Definition at line 100 of file DataSvc.cpp.

100  {
101  if ( !checkRoot() ) return Status::INVALID_ROOT;
102  RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
103  if ( !entry ) return Status::INVALID_OBJECT;
104  RegEntry* parent = entry->parentEntry();
105  if ( !parent ) return Status::INVALID_PARENT;
106  parent->remove( entry );
107  return StatusCode::SUCCESS;
108 }

◆ clearSubTree() [2/2]

StatusCode DataSvc::clearSubTree ( std::string_view  sub_tree_path)
override

IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name.

Definition at line 85 of file DataSvc.cpp.

85  {
86  DataObject* pObject = nullptr;
87  StatusCode status = findObject( sub_tree_path, pObject );
88  if ( !status.isSuccess() ) return status;
89  RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
90  if ( !node_entry ) return Status::INVALID_OBJECT;
91  RegEntry* parent = node_entry->parentEntry();
92  if ( !parent ) return Status::INVALID_PARENT;
93  parent->remove( node_entry );
94  return StatusCode::SUCCESS;
95 }

◆ createDefaultObject()

DataObject * DataSvc::createDefaultObject ( ) const
protectedvirtual

Create default objects in case forced creation of leaves is requested.

Definition at line 870 of file DataSvc.cpp.

870 { return new DataObject(); }

◆ finalize()

StatusCode DataSvc::finalize ( )
override

Service initialization.

Service initialisation.

Definition at line 854 of file DataSvc.cpp.

854  {
855  // Nothing to do: just call base class initialisation
856  setDataLoader( nullptr ).ignore();
857  resetPreLoad().ignore();
858  clearStore().ignore();
860  return Service::finalize();
861 }

◆ findObject() [1/8]

StatusCode IDataProviderSvc::findObject
inline

Find object identified by its parent object and an integer identifier in the data store.

In case the object is not present the pointer will be set to NULL.

Parameters
parentObjPointer to parent node of the object.
itemItem identifier.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 373 of file IDataProviderSvc.h.

373  {
374  return findObject( parentObj, itemToPath( item ), pObject );
375  }

◆ findObject() [2/8]

StatusCode IDataProviderSvc::findObject
inline

Find object identified by its parent object and the path to the object relative to the parent.

The result will be returned in the second argument. In case the object is not present the pointer will be set to NULL.

Parameters
parentObjPointer to parent node of the object.
objectPathRelative path name of the object.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 361 of file IDataProviderSvc.h.

361  {
362  return findObject( parentObj ? parentObj->registry() : nullptr, objectPath, pObject );
363  }

◆ findObject() [3/8]

StatusCode DataSvc::findObject ( IRegistry pDirectory,
std::string_view  path,
DataObject *&  pObject 
)
override

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

Retrieve object identified by its directory from the data store.

Definition at line 636 of file DataSvc.cpp.

636  {
637  pObject = nullptr;
638  IRegistry* pReg = ( pRegistry ? pRegistry : m_root.get() );
639  RegEntry* root_entry = CAST_REGENTRY( RegEntry*, pReg );
640  if ( root_entry ) {
641  if ( !path.empty() ) pReg = root_entry->find( path );
642  if ( !pReg ) return Status::INVALID_OBJ_PATH;
643  pObject = pReg->object();
644  }
645  return ( !pObject ) ? Status::OBJ_NOT_LOADED : Status::IDataProviderSvc_NO_ERROR;
646 }

◆ findObject() [4/8]

virtual StatusCode IDataProviderSvc::findObject

Find object identified by its directory entry.

The result will be returned in the second argument. In case the object is not present the pointer will be set to NULL. ** FASTEST ACCESS TO THE DATA STORE **

Parameters
pDirectoryPointer to the object.
pathString with relative path to directory. Ideally ""!
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

◆ findObject() [5/8]

StatusCode DataSvc::findObject ( std::string_view  fullPath,
DataObject *&  pObject 
)
override

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

Definition at line 649 of file DataSvc.cpp.

649  {
650  pObject = nullptr;
651  if ( !checkRoot() ) return Status::INVALID_ROOT;
652  if ( path.empty() || path == m_rootName.value() ) {
653  pObject = m_root->object();
654  return !pObject ? Status::OBJ_NOT_LOADED : Status::IDataProviderSvc_NO_ERROR;
655  }
656  return findObject( path.front() != SEPARATOR ? m_root.get() : nullptr, path, pObject );
657 }

◆ findObject() [6/8]

virtual StatusCode IDataProviderSvc::findObject

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

The result will be returned in the second argument. In case the object is not present the pointer will be set to NULL.

Parameters
fullPathPath name of the object.
pObjectPointer to the object to be connected.
Returns
Status code indicating success or failure.

◆ findObject() [7/8]

StatusCode IDataProviderSvc::findObject
inline

Find object identified by its parent object and an integer identifier in the data store.

In case the object is not present the pointer will be set to NULL.

Parameters
parentPathPath to parent node of the object.
itemItem identifier.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 348 of file IDataProviderSvc.h.

348  {
349  return findObject( parentPath, itemToPath( item ), pObject );
350  }

◆ findObject() [8/8]

StatusCode IDataProviderSvc::findObject
inline

Find object identified by its parent object and the path to the object relative to the parent.

The result will be returned in the second argument. In case the object is not present the pointer will be set to NULL.

Parameters
parentPathPath to parent node of the object.
objectPathRelative path name of the object.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 334 of file IDataProviderSvc.h.

334  {
335  DataObject* parent = nullptr;
336  StatusCode status = findObject( parentPath, parent );
337  return status.isSuccess() ? findObject( parent, objectPath, pObject ) : status;
338  }

◆ getDataLoader()

IConversionSvc * DataSvc::getDataLoader ( IRegistry pReg)
protectedvirtual

Retrieve customizable data loader according to registry entry to be retrieved.

Reimplemented in NTupleSvc.

Definition at line 875 of file DataSvc.cpp.

875 { return m_dataLoader.get(); }

◆ handleDataFault()

DataObject * DataSvc::handleDataFault ( IRegistry pReg,
std::string_view  path = "" 
)
protected

Invoke data fault handling if enabled.

Parameters
pReg[IN] Pointer to missing registry entry
path[IN] Sub-path of requested object from pReg
Returns
Object corresponding to the specified leaf

Definition at line 434 of file DataSvc.cpp.

434  {
435  return i_handleDataFault( pReg, path );
436 }

◆ i_handleDataFault()

DataObject * DataSvc::i_handleDataFault ( IRegistry pReg,
std::string_view  path = std::string_view{} 
)
private

Definition at line 438 of file DataSvc.cpp.

438  {
439  if ( m_enableFaultHdlr ) {
440  IRegistry* pLeaf = nullptr;
441  if ( pReg && path.empty() ) {
442  DataIncident incident( name(), m_faultName, pReg->identifier() );
443  m_incidentSvc->fireIncident( incident );
444  return pReg->object();
445  }
446  if ( pReg ) {
447  std::string p = pReg->identifier();
448  if ( path.front() != SEPARATOR ) p += SEPARATOR;
449  p.append( path.data(), path.size() );
450  DataIncident incident( name(), m_faultName, p );
451  m_incidentSvc->fireIncident( incident );
452  pLeaf = m_root->findLeaf( p );
453  } else {
455  if ( path.front() != SEPARATOR ) p += SEPARATOR;
456  p.append( path.data(), path.size() );
457  DataIncident incident( name(), m_faultName, p );
458  m_incidentSvc->fireIncident( incident );
459  pLeaf = m_root->findLeaf( p );
460  }
461  if ( pLeaf ) { return pLeaf->object(); }
462  }
463  return nullptr;
464 }

◆ i_retrieveEntry()

StatusCode DataSvc::i_retrieveEntry ( DataSvcHelpers::RegistryEntry parentObj,
std::string_view  path,
DataSvcHelpers::RegistryEntry *&  pEntry 
)
private

Definition at line 541 of file DataSvc.cpp.

541  {
542  // A.Valassi 16.08.2001 avoid core dump if store is empty
543  if ( !checkRoot() ) return Status::INVALID_ROOT;
544 
545  static constexpr auto empty = std::string_view{};
546  auto sep = find( path, SEPARATOR, 1 );
547  pEntry = nullptr;
548 
549  if ( !parentObj ) {
550  if ( path.empty() || path == m_rootName.value() ) {
551  parentObj = m_root.get();
552  path = empty;
553  } else if ( path.front() != SEPARATOR ) {
554  parentObj = m_root.get();
555  } else if ( sep != std::string_view::npos ) {
556  if ( !m_root->object() ) {
557  RegEntry* r = nullptr;
558  auto status = i_retrieveEntry( m_root.get(), empty, r );
559  if ( !status.isSuccess() ) return status;
560  }
561  parentObj = m_root.get();
562  path = path.substr( sep );
563  } else {
564  return Status::INVALID_OBJ_PATH;
565  }
566  sep = find( path, SEPARATOR, 1 );
567  }
568 
569  StatusCode status{ Status::INVALID_ROOT };
570  if ( sep != std::string_view::npos ) { // the string contains a separator (after pos 0)
571  if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
572  status = loadObject( parentObj );
573  if ( !status.isSuccess() ) return status;
574  }
575  auto p_path = path.substr( 0, sep );
576  RegEntry* root_entry = parentObj->findLeaf( p_path );
577  if ( !root_entry && m_enableFaultHdlr ) {
578  // If not even the parent is there, an incident
579  // to load the parent must be fired...
580  i_handleDataFault( parentObj, p_path );
581  root_entry = parentObj->findLeaf( p_path );
582  }
583  if ( root_entry ) {
584  DataObject* pO = root_entry->object();
585  if ( !pO ) {
586  // Object is not loaded: load the object if at all possible
587  status = loadObject( root_entry );
588  if ( !status.isSuccess() ) return status;
589  }
590  if ( root_entry->isSoft() ) { root_entry = CAST_REGENTRY( RegEntry*, pO->registry() ); }
591  return i_retrieveEntry( root_entry, path.substr( sep ), pEntry );
592  }
593  return Status::INVALID_OBJ_PATH;
594  } else if ( path.empty() ) {
595  pEntry = parentObj;
596  } else {
597  if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
598  status = loadObject( parentObj );
599  if ( !status.isSuccess() ) return status;
600  }
601  // last leave in search: find leaf and load
602  pEntry = parentObj->findLeaf( path );
603  // If no registry entry was found, trigger incident for action-on-demand
604  if ( !pEntry && m_enableFaultHdlr ) {
605  i_handleDataFault( parentObj, path );
606  pEntry = ( path.empty() ? parentObj : parentObj->findLeaf( path ) );
607  }
608  }
609 
610  // Check results and return
611  if ( !pEntry ) return Status::INVALID_OBJ_PATH;
612  if ( !pEntry->object() ) return loadObject( pEntry );
613 
614  if ( m_enableAccessHdlr ) {
615  // Fire data access incident
616  // I do not know if this is a good idea....
617  // This fires too often!
618  //
619  // DataIncident incident(name(), m_accessName, pEntry->identifier());
620  // m_incidentSvc->fireIncident(incident);
621  return StatusCode::SUCCESS;
622  }
623  return StatusCode::SUCCESS;
624 }

◆ i_setRoot() [1/2]

StatusCode DataSvc::i_setRoot ( std::string  root_path,
DataObject pRootObj 
)
virtual

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

Does not clear the store before reinitializing it. This could lead to errors and should be handle with care. Use setRoot if unsure

Definition at line 151 of file DataSvc.cpp.

151  {
152  if ( pRootObj ) {
153  m_root = std::make_unique<RegEntry>( std::move( root_path ) );
154  m_root->makeHard( pRootObj );
155  m_root->setDataSvc( this );
156  // No done with GaudiHive. preLoad().ignore();
157  }
158  return StatusCode::SUCCESS;
159 }

◆ i_setRoot() [2/2]

StatusCode DataSvc::i_setRoot ( std::string  root_path,
IOpaqueAddress pRootAddr 
)
virtual

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

Does not clear the store before reinitializing it. This could lead to errors and should be handle with care. Use setRoot if unsure

Definition at line 175 of file DataSvc.cpp.

175  {
176  if ( pRootAddr ) {
177  m_root = std::make_unique<RegEntry>( std::move( root_path ) );
178  m_root->makeHard( pRootAddr );
179  m_root->setDataSvc( this );
180  // Not done with GaudiHive. preLoad().ignore();
181  }
182  return StatusCode::SUCCESS;
183 }

◆ initialize()

StatusCode DataSvc::initialize ( )
override

Service initialization.

Definition at line 821 of file DataSvc.cpp.

821  {
822  // Nothing to do: just call base class initialisation
824  if ( !sc.isSuccess() ) return sc;
825  m_incidentSvc = service( "IncidentSvc", true );
826  if ( !m_incidentSvc ) { error() << "Failed to access incident service." << endmsg; }
827  return sc;
828 }

◆ linkObject() [1/6]

StatusCode IDataProviderSvc::linkObject
inline

Add a link to another object.

Both objects must already be registered with the data store. Once linked, the object can only be unregistered after unlinking.

Parameters
fromObjPointer to the object the link originates.
objPathPath of the entry to be linked relative to from.
toObjPointer to the object the link points to.
Returns
Status code indicating success or failure.

Definition at line 503 of file IDataProviderSvc.h.

590  {
591  if ( fromObj ) {
592  IRegistry* from_entry = fromObj->registry();
593  if ( from_entry ) return linkObject( from_entry, objPath, toObj );
594  }
595  return Status::INVALID_PARENT;
596 }

◆ linkObject() [2/6]

StatusCode DataSvc::linkObject ( IRegistry from,
std::string_view  objPath,
DataObject to 
)
override

Add a link to another object.

Definition at line 709 of file DataSvc.cpp.

709  {
710  if ( !checkRoot() ) return Status::INVALID_ROOT;
711  try {
712  RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
713  if ( from_entry ) {
714  // First check if both objects are already registered to the store
715  RegEntry* to_entry = m_root->findLeaf( to );
716  if ( !to_entry ) return Status::INVALID_OBJECT;
717  auto sep = objPath.rfind( SEPARATOR );
718  if ( sep > 0 && sep != std::string_view::npos ) { // in case the objPath is a sub-directory itself
719  DataObject* pO = nullptr;
720  StatusCode sc = retrieveObject( from, objPath.substr( 0, sep ), pO );
721  return sc.isSuccess() ? linkObject( pO->registry(), objPath.substr( sep ), to ) : sc;
722  }
723  // Now register the soft link
724  StatusCode status = from_entry->add( to_string( objPath ), to, true );
725  return status.isSuccess() ? Status::IDataProviderSvc_NO_ERROR : Status::DOUBL_OBJ_PATH;
726  }
727  } catch ( ... ) {}
728  return Status::INVALID_PARENT;
729 }

◆ linkObject() [3/6]

virtual StatusCode IDataProviderSvc::linkObject

Add a link to another object.

Both objects must already be registered with the data store. Once linked, the object can only be unregistered after unlinking.

Parameters
fromPointer to data directory the link originates.
objPathPath of the entry to be linked relative to from.
toObjPointer to the object the link points to.
Returns
Status code indicating success or failure.

◆ linkObject() [4/6]

StatusCode IDataProviderSvc::linkObject
inline

Add a link to another object.

Both objects must already be registered with the data store. Once linked, the object can only be unregistered after unlinking.

Parameters
fromPathPath to the object the link originates.
objPathPath of the entry to be linked relative to from.
toObjPointer to the object the link points to.
Returns
Status code indicating success or failure.

Definition at line 489 of file IDataProviderSvc.h.

489  {
490  DataObject* pO = nullptr;
491  StatusCode status = retrieveObject( fromPath, pO );
492  return status.isSuccess() ? linkObject( pO->registry(), objPath, toObj ) : status;
493  }

◆ linkObject() [5/6]

StatusCode DataSvc::linkObject ( std::string_view  fullPath,
DataObject to 
)
override

Add a link to another object.

Definition at line 732 of file DataSvc.cpp.

732  {
733  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
734  if ( fullPath.front() != SEPARATOR ) { return linkObject( m_rootName.value(), fullPath, to ); }
735  auto sep = fullPath.rfind( SEPARATOR );
736  return linkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ), to );
737 }

◆ linkObject() [6/6]

virtual StatusCode IDataProviderSvc::linkObject

Add a link to another object.

Both objects must already be registered with the data store. Once linked, the object can only be unregistered after unlinking.

Parameters
fullPathFull path of the entry to be linked.
toObjPointer to the object the link points to.
Returns
Status code indicating success or failure.

◆ loadObject() [1/2]

StatusCode DataSvc::loadObject ( IConversionSvc pLoader,
IRegistry pNode 
)
protectedvirtual

Invoke Persistency service to create transient object from its persistent representation.

Definition at line 477 of file DataSvc.cpp.

477  {
478  StatusCode status = Status::INVALID_OBJ_ADDR;
479  DataObject* pObject = nullptr;
480  if ( !pLoader ) { // Precondition: Data loader must be present
481  return handleDataFault( pRegistry ) ? StatusCode::SUCCESS : StatusCode( Status::NO_DATA_LOADER );
482  }
483  if ( !pRegistry ) { // Precondition: Directory must be valid
484  return handleDataFault( pRegistry ) ? StatusCode::SUCCESS : StatusCode( Status::INVALID_OBJ_ADDR );
485  }
486 
487  VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
488 
489  if ( m_enableAccessHdlr ) {
490  // Fire data access incident
491  DataIncident incident( name(), m_accessName, pRegistry->identifier() );
492  m_incidentSvc->fireIncident( incident );
493  }
494  if ( !m_inhibitPathes.empty() ) {
495  auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), pRegistry->identifier() );
496  if ( inhibit != m_inhibitPathes.end() ) { return Status::NO_ACCESS; }
497  }
498  IOpaqueAddress* pAddress = pRegistry->address();
499  if ( !pAddress ) { // Precondition:
500  return Status::INVALID_OBJ_ADDR; // Address must be valid
501  }
502  try {
503  status = pLoader->createObj( pAddress, pObject ); // Call data loader
504  if ( status.isSuccess() ) {
505 
506  VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
507 
508  RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
509  pEntry->setObject( pObject );
510 
511  VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
512  status = pLoader->fillObjRefs( pAddress, pObject );
513  }
514  } catch ( const GaudiException& exc ) {
515  if ( handleDataFault( pRegistry ) ) { return StatusCode::SUCCESS; }
516  throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
517  exc );
518  } catch ( const std::exception& x ) {
519  if ( handleDataFault( pRegistry ) ) { return StatusCode::SUCCESS; }
520  throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
521  System::typeinfoName( typeid( x ) ) + ", " + x.what(),
523  } catch ( ... ) {
524  if ( handleDataFault( pRegistry ) ) { return StatusCode::SUCCESS; }
525  throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
526  }
527  if ( !status.isSuccess() ) {
528  if ( handleDataFault( pRegistry ) ) { return StatusCode::SUCCESS; }
529  }
530  ON_VERBOSE if ( status.isSuccess() ) {
531  verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
532  }
533  return status;
534 }

◆ loadObject() [2/2]

StatusCode DataSvc::loadObject ( IRegistry pNode)
protectedvirtual

Invoke Persistency service to create transient object from its persistent representation.

Definition at line 469 of file DataSvc.cpp.

469  {
470  IConversionSvc* pLoader = getDataLoader( pRegistry );
471  return loadObject( pLoader, pRegistry );
472 }

◆ objectLeaves() [1/2]

StatusCode DataSvc::objectLeaves ( const DataObject pObject,
std::vector< IRegistry * > &  refLeaves 
)
override

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

IDataManagerSvc: Explore an object identified by its pointer.

Definition at line 207 of file DataSvc.cpp.

207  {
208  if ( !pObject ) return Status::INVALID_OBJECT;
209  return objectLeaves( pObject->registry(), leaves );
210 }

◆ objectLeaves() [2/2]

StatusCode DataSvc::objectLeaves ( const IRegistry pRegistry,
std::vector< IRegistry * > &  refLeaves 
)
override

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

IDataManagerSvc: Explore an object identified by the pointer to the registry entry.

Definition at line 215 of file DataSvc.cpp.

215  {
216  if ( !checkRoot() ) return Status::INVALID_ROOT;
217  const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
218  if ( !node_entry ) return Status::INVALID_OBJECT;
219  leaves = node_entry->leaves();
220  return StatusCode::SUCCESS;
221 }

◆ objectParent() [1/2]

StatusCode DataSvc::objectParent ( const DataObject pObject,
IRegistry *&  refpParent 
)
override

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

Definition at line 193 of file DataSvc.cpp.

193  {
194  if ( !pObject ) return Status::INVALID_OBJECT;
195  return objectParent( pObject->registry(), refpParent );
196 }

◆ objectParent() [2/2]

StatusCode DataSvc::objectParent ( const IRegistry pRegistry,
IRegistry *&  refpParent 
)
override

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

Definition at line 198 of file DataSvc.cpp.

198  {
199  if ( !checkRoot() ) return Status::INVALID_ROOT;
200  const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
201  if ( !node_entry ) return Status::INVALID_OBJECT;
202  refpParent = node_entry->parent();
203  return StatusCode::SUCCESS;
204 }

◆ operator=()

DataSvc& DataSvc::operator= ( const DataSvc )
delete

Fake assignment operator (never implemented).

◆ preLoad() [1/2]

StatusCode DataSvc::preLoad ( )
override

load all preload items of the list

Definition at line 810 of file DataSvc.cpp.

810  {
811  DataObject* pObj = nullptr;
812  for ( const auto& i : m_preLoads ) {
813  StatusCode sc = retrieveObject( i.path(), pObj );
814  int load_depth = i.depth();
815  if ( sc.isSuccess() && load_depth > 1 ) { preLoad( 1, load_depth, pObj ).ignore(); }
816  }
817  return StatusCode::SUCCESS;
818 }

◆ preLoad() [2/2]

StatusCode DataSvc::preLoad ( int  depth,
int  load_depth,
DataObject pObject 
)
virtual

Execute one level of preloading and recursively load until the final level is reached.

Preload one level deep, then recursively call the next level.

Parameters
depthcurrent level of loading from requested parent
load_depthmaximum level of object loading
pObjectpointer to next level root object
Returns
Status code indicating success or failure.

Definition at line 794 of file DataSvc.cpp.

794  {
795  // unused: StatusCode sc = StatusCode::FAILURE;
796  if ( pObject && depth++ < load_depth ) {
797  RegEntry* dir = CAST_REGENTRY( RegEntry*, pObject->registry() );
798  if ( dir ) {
799  for ( const auto& i : *dir ) {
800  DataObject* pObj = nullptr;
801  StatusCode status = retrieveObject( pObject, i->name(), pObj );
802  if ( status.isSuccess() && depth < load_depth ) { preLoad( depth, load_depth, pObj ).ignore(); }
803  }
804  }
805  }
806  return StatusCode::SUCCESS;
807 }

◆ registerAddress() [1/5]

StatusCode IDataManagerSvc::registerAddress
inline

Register object address with the data store.

Connect the object identified by its pointer to the parent object and the relative path of the object with respect to the parent.

Parameters
parentObj[IN] Pointer to parent object.
objectPath[IN] Path of the object relative to the parent node
pAddress[IN] Pointer to the object to be connected.
Returns
Status code indicating success or failure.

Definition at line 215 of file IDataManagerSvc.h.

215  {
216  return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
217  }

◆ registerAddress() [2/5]

StatusCode DataSvc::registerAddress ( IRegistry parentObj,
std::string_view  objectPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

Definition at line 230 of file DataSvc.cpp.

230  {
231  if ( !checkRoot() ) return Status::INVALID_ROOT;
232  if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
233 
234  if ( !parentObj ) {
235  if ( objPath.front() != SEPARATOR ) { return registerAddress( m_root.get(), objPath, pAddress ); }
236  auto sep = find( objPath, SEPARATOR, 1 );
237  if ( sep == std::string_view::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
238  return Status::INVALID_PARENT;
239  }
240  return registerAddress( m_root.get(), objPath.substr( sep ), pAddress );
241  }
242  if ( objPath.front() != SEPARATOR ) { return registerAddress( parentObj, char( SEPARATOR ) + objPath, pAddress ); }
243  RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
244  if ( !par_entry ) return Status::INVALID_PARENT;
245 
246  auto sep = objPath.rfind( SEPARATOR );
247  if ( sep > 0 && sep != std::string_view::npos ) {
248  auto p_path = objPath.substr( 0, sep );
249  auto o_path = objPath.substr( sep );
250  RegEntry* p_entry = par_entry->findLeaf( p_path );
251  // Create default object leafs if the
252  // intermediate nodes are not present
253  if ( !p_entry && m_forceLeaves ) {
254  DataObject* pLeaf = createDefaultObject();
255  StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
256  if ( sc.isFailure() ) delete pLeaf;
257  p_entry = par_entry->findLeaf( p_path );
258  }
259  if ( !p_entry ) return Status::INVALID_PARENT;
260  return registerAddress( p_entry, o_path, pAddress );
261  }
262  StatusCode status = par_entry->add( to_string( objPath ), pAddress );
263  return status.isSuccess() ? status : Status::DOUBL_OBJ_PATH;
264 }

◆ registerAddress() [3/5]

virtual StatusCode IDataManagerSvc::registerAddress

Register object address with the data store.

Connect the object identified by its pointer to the parent object and the relative path of the object with respect to the parent.

Parameters
parentObj[IN] Pointer to parent object.
objectPath[IN] Path of the object relative to the parent node
pAddress[IN] Pointer to the object to be connected.
Returns
Status code indicating success or failure.

◆ registerAddress() [4/5]

StatusCode DataSvc::registerAddress ( std::string_view  fullPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

Definition at line 224 of file DataSvc.cpp.

224  {
225  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
226  return registerAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath, pAddress );
227 }

◆ registerAddress() [5/5]

virtual StatusCode IDataManagerSvc::registerAddress

Register object address with the data store.

Connect the object identified by its pointer to the node object identified by its path.

Parameters
fullPath[IN] Path to parent node of the object.
pAddress[IN] Pointer to the object to be registered.
Returns
Status code indicating success or failure.

◆ registerObject() [1/7]

StatusCode IDataProviderSvc::registerObject
inline

Register object with the data store.

Connect the object identified by its pointer to the node object identified by its pointer.

Parameters
parentObjPointer to parent object.
itemitem number of the object linked to the parent
pObjectPointer to the object to be connected.
Returns
Status code indicating success or failure.

Definition at line 117 of file IDataProviderSvc.h.

117  {
118  return registerObject( parentObj, itemToPath( item ), pObject );
119  }

◆ registerObject() [2/7]

virtual StatusCode IDataProviderSvc::registerObject

Register object with the data store.

Connect the object identified by its pointer to the parent object and the relative path of the object with respect to the parent.

Parameters
parentObjPointer to parent object.
objectPathPath of the object relative to the parent node
pObjectPointer to the object to be connected.
Returns
Status code indicating success or failure.

◆ registerObject() [3/7]

StatusCode DataSvc::registerObject ( DataObject parentObj,
std::string_view  objPath,
DataObject pObject 
)
override

Register object with the data store.

Definition at line 314 of file DataSvc.cpp.

314  {
315  if ( !checkRoot() ) return Status::INVALID_ROOT;
316 
317  if ( !parentObj ) {
318  if ( !objPath.empty() ) {
319  if ( objPath.front() != SEPARATOR ) { return registerObject( m_rootName.value(), objPath, pObject ); }
320  auto sep = find( objPath, SEPARATOR, 1 );
321  if ( sep != std::string_view::npos ) {
322  return registerObject( objPath.substr( 0, sep ), objPath.substr( sep ), pObject );
323  }
324  }
325  return Status::INVALID_OBJ_PATH;
326  }
327  RegEntry* node_entry = CAST_REGENTRY( RegEntry*, parentObj->registry() );
328  if ( node_entry ) {
329  StatusCode status = Status::INVALID_PARENT;
330  auto sep = find( objPath, SEPARATOR, 1 );
331  if ( sep != std::string_view::npos ) {
332  auto p_path = objPath.substr( 0, sep );
333  auto o_path = objPath.substr( sep );
334  RegEntry* par_entry = node_entry->findLeaf( p_path );
335  // Create default object leafs if the
336  // intermediate nodes are not present
337  if ( !par_entry && m_forceLeaves ) {
338  DataObject* pLeaf = createDefaultObject();
339  StatusCode sc = registerObject( parentObj, p_path, pLeaf );
340  if ( !sc.isSuccess() ) delete pLeaf;
341  par_entry = node_entry->findLeaf( p_path );
342  } else if ( par_entry && !par_entry->object() ) {
343  status = i_retrieveEntry( node_entry, p_path, par_entry );
344  if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
345  DataObject* pLeaf = createDefaultObject();
346  StatusCode sc = registerObject( parentObj, p_path, pLeaf );
347  if ( !sc.isSuccess() ) delete pLeaf;
348  par_entry = node_entry->findLeaf( p_path );
349  }
350  }
351  node_entry = par_entry;
352  if ( node_entry ) {
353  DataObject* obj = node_entry->object();
354  if ( obj ) status = registerObject( obj, o_path, pObject );
355  }
356  } else {
357  RegEntry* leaf = node_entry->findLeaf( objPath );
358  if ( !leaf ) {
359  status = node_entry->add( to_string( objPath ), pObject );
360  } else {
361  DataObject* obj = leaf->object();
362  if ( !obj ) {
363  if ( !pObject ) {
364  error() << "registerObject: trying to register null DataObject" << endmsg;
365  return StatusCode::FAILURE;
366  }
367  pObject->setRegistry( leaf );
368  leaf->setAddress( nullptr );
369  leaf->setObject( pObject );
370  status = StatusCode::SUCCESS;
371  } else {
372  status = Status::DOUBL_OBJ_PATH;
373  }
374  }
375  }
376  return status;
377  }
378  return Status::INVALID_PARENT;
379 }

◆ registerObject() [4/7]

StatusCode IDataProviderSvc::registerObject
inline

Register object with the data store.

Connect the object identified by its pointer to the node object identified by its path.

Parameters
fullPathPath to parent node of the object.
pObjectPointer to the object to be registered.
Returns
Status code indicating success or failure.

Definition at line 72 of file IDataProviderSvc.h.

72  {
73  return registerObject( nullptr, fullPath, pObject );
74  }

◆ registerObject() [5/7]

StatusCode IDataProviderSvc::registerObject
inline

Register object with the data store.

Connect the object identified by its pointer to the parent object and an integer identifier.

Parameters
parentPathPath to parent node of the object.
itemitem number of the object linked to the parent
pObjectPointer to the object to be registered.
Returns
Status code indicating success or failure.

Definition at line 95 of file IDataProviderSvc.h.

95  {
96  return registerObject( parentPath, itemToPath( item ), pObject );
97  }

◆ registerObject() [6/7]

virtual StatusCode IDataProviderSvc::registerObject

Register object with the data store.

Connect the object identified by the path to the parent object and the path of the object itself relative to the specified parent.

Parameters
parentPathPath to parent node of the object.
objectPathPath of the object relative to the parent node
pObjectPointer to the object to be registered.
Returns
Status code indicating success or failure.

◆ registerObject() [7/7]

StatusCode DataSvc::registerObject ( std::string_view  parentPath,
std::string_view  objPath,
DataObject pObject 
)
override

Register object with the data store.

Definition at line 302 of file DataSvc.cpp.

302  {
303  DataObject* pO = nullptr;
304  StatusCode status = retrieveObject( parentPath, pO );
305  if ( !status.isSuccess() && m_forceLeaves ) {
306  pO = createDefaultObject();
307  status = registerObject( parentPath, pO );
308  if ( !status.isSuccess() ) pO->release();
309  }
310  return status.isSuccess() ? registerObject( pO, objPath, pObject ) : status;
311 }

◆ reinitialize()

StatusCode DataSvc::reinitialize ( )
override

Service initialization.

Service reinitialization.

Definition at line 831 of file DataSvc.cpp.

831  {
832  // the finalize part is copied here
833  setDataLoader( nullptr ).ignore();
834  resetPreLoad().ignore();
835  clearStore().ignore();
837  // re-initialize the base class
839  if ( !sc.isSuccess() ) {
840  error() << "Unable to reinitialize base class" << endmsg;
841  return sc;
842  }
843  // the initialize part is copied here
844  m_incidentSvc = service( "IncidentSvc", true );
845  if ( !m_incidentSvc ) {
846  error() << "Failed to access incident service." << endmsg;
847  return StatusCode::FAILURE;
848  }
849  // return
850  return StatusCode::SUCCESS;
851 }

◆ removePreLoadItem()

StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
override

Remove an item from the preload list.

Definition at line 782 of file DataSvc.cpp.

782  {
784  return StatusCode::SUCCESS;
785 }

◆ resetPreLoad()

StatusCode DataSvc::resetPreLoad ( )
override

Clear the preload list.

Definition at line 788 of file DataSvc.cpp.

788  {
790  return StatusCode::SUCCESS;
791 }

◆ retrieveEntry()

StatusCode DataSvc::retrieveEntry ( DataSvcHelpers::RegistryEntry pNode,
std::string_view  path,
DataSvcHelpers::RegistryEntry *&  pEntry 
)
protected

Retrieve registry entry from store.

Definition at line 537 of file DataSvc.cpp.

537  {
538  return i_retrieveEntry( parentObj, path, pEntry );
539 }

◆ retrieveObject() [1/7]

StatusCode IDataProviderSvc::retrieveObject
inline

Retrieve object from data store.

The object to be retrieved is identified by the pointer to the parent object and an integer identifier. In case the object is not present it will be loaded and converted if possible.

Parameters
parentObjPointer to parent node of the object.
itemItem identifier.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 301 of file IDataProviderSvc.h.

301  {
302  return retrieveObject( parentObj, itemToPath( item ), pObject );
303  }

◆ retrieveObject() [2/7]

StatusCode IDataProviderSvc::retrieveObject
inline

Retrieve object from data store.

The object to be retrieved is identified by the pointer to the parent object and the relative path with respect to the node. In case the object is not present it will be loaded and converted if possible.

Parameters
parentObjPointer to parent node of the object.
objectPathPath of the object relative to the parent.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 287 of file IDataProviderSvc.h.

287  {
288  return retrieveObject( parentObj ? parentObj->registry() : nullptr, objectPath, pObject );
289  }

◆ retrieveObject() [3/7]

StatusCode DataSvc::retrieveObject ( IRegistry pDirectory,
std::string_view  path,
DataObject *&  pObject 
)
override

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 627 of file DataSvc.cpp.

627  {
628  pObject = nullptr;
629  RegEntry * result = nullptr, *parent = CAST_REGENTRY( RegEntry*, pRegistry );
630  StatusCode status = i_retrieveEntry( parent, path, result );
631  if ( status.isSuccess() ) pObject = result->object();
632  return status;
633 }

◆ retrieveObject() [4/7]

virtual StatusCode IDataProviderSvc::retrieveObject

Retrieve object identified by its directory entry.

The result will be returned in the second argument. In case the object is not present it will be loaded and converted if possible. ** FASTEST ACCESS TO THE DATA STORE **

Parameters
pDirectoryPointer to the object.
pathString with relative path to directory. Ideally ""!
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

◆ retrieveObject() [5/7]

StatusCode IDataProviderSvc::retrieveObject
inline

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

The result will be returned in the second argument. In case the object is not present it will be loaded and converted if possible.

Parameters
fullPathPath name of the object.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 243 of file IDataProviderSvc.h.

243  {
244  return retrieveObject( static_cast<IRegistry*>( nullptr ), fullPath, pObject );
245  }

◆ retrieveObject() [6/7]

StatusCode IDataProviderSvc::retrieveObject
inline

Retrieve object from data store.

The object to be retrieved is identified by the path to the parent object and an integer identifier. In case the object is not present it will be loaded and converted if possible.

Parameters
parentPathPath to parent node of the object.
itemItem identifier.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 273 of file IDataProviderSvc.h.

273  {
274  return retrieveObject( parentPath, itemToPath( item ), pObject );
275  }

◆ retrieveObject() [7/7]

StatusCode IDataProviderSvc::retrieveObject
inline

Retrieve object from data store.

The object to be retrieved is identified by the path of the parent object and the relative path with respect to the node. In case the object is not present it will be loaded and converted if possible.

Parameters
parentPathPath to parent node of the object.
objectPathPath of the object relative to the parent.
pObjectReference to the pointer of the object to be returned.
Returns
Status code indicating success or failure.

Definition at line 257 of file IDataProviderSvc.h.

257  {
258  DataObject* parent = nullptr;
259  StatusCode status = retrieveObject( parentPath, parent );
260  return status.isSuccess() ? retrieveObject( parent, objectPath, pObject ) : status;
261  }

◆ rootCLID()

CLID DataSvc::rootCLID ( ) const
override

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 864 of file DataSvc.cpp.

864 { return (CLID)m_rootCLID; }

◆ rootName()

const std::string & DataSvc::rootName ( ) const
override

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 867 of file DataSvc.cpp.

867 { return m_rootName; }

◆ setDataLoader()

StatusCode DataSvc::setDataLoader ( IConversionSvc svc,
IDataProviderSvc dpsvc = nullptr 
)
override

IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider.

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 186 of file DataSvc.cpp.

186  {
187  m_dataLoader = pDataLoader;
188  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this ).ignore();
189  return StatusCode::SUCCESS;
190 }

◆ setRoot() [1/2]

StatusCode DataSvc::setRoot ( std::string  root_path,
DataObject pRootObj 
)
override

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

Takes care to clear the store before reinitializing it

Takes care to clear the store before reinitializing it

Definition at line 141 of file DataSvc.cpp.

141  {
142  clearStore().ignore();
143  return i_setRoot( std::move( root_path ), pRootObj );
144 }

◆ setRoot() [2/2]

StatusCode DataSvc::setRoot ( std::string  root_path,
IOpaqueAddress pRootAddr 
)
override

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 165 of file DataSvc.cpp.

165  {
166  clearStore().ignore();
167  return i_setRoot( std::move( root_path ), pRootAddr );
168 }

◆ traverseSubTree() [1/2]

StatusCode DataSvc::traverseSubTree ( DataObject pObject,
IDataStoreAgent pAgent 
)
override

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

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

Definition at line 126 of file DataSvc.cpp.

126  {
127  RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
128  return entry ? entry->traverseTree( pAgent ) : Status::INVALID_OBJECT;
129 }

◆ traverseSubTree() [2/2]

StatusCode DataSvc::traverseSubTree ( std::string_view  sub_tree_path,
IDataStoreAgent pAgent 
)
override

IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name.

IDataManagerSvc: Analyse by traversing all data objects below the sub tree identified by its full path name.

Definition at line 119 of file DataSvc.cpp.

119  {
120  DataObject* pO = nullptr;
121  StatusCode status = findObject( sub_tree_path, pO );
122  return status.isSuccess() ? traverseSubTree( pO, pAgent ) : status;
123 }

◆ traverseTree()

StatusCode DataSvc::traverseTree ( IDataStoreAgent pAgent)
override

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

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

Definition at line 132 of file DataSvc.cpp.

132  {
133  if ( !checkRoot() ) return Status::INVALID_ROOT;
134  return m_root->traverseTree( pAgent );
135 }

◆ unlinkObject() [1/7]

StatusCode DataSvc::unlinkObject ( DataObject fromObj,
std::string_view  objPath 
)
override

Remove a link to another object.

Definition at line 768 of file DataSvc.cpp.

768  {
769  if ( !checkRoot() ) return Status::INVALID_ROOT;
770  IRegistry* from_entry = m_root->findLeaf( from );
771  return unlinkObject( from_entry, objPath );
772 }

◆ unlinkObject() [2/7]

virtual StatusCode IDataProviderSvc::unlinkObject

Remove a link to another object.

Both objects must be registered with the data store. This entry point can be used to unlink objects e.g. in order to unregister them.

Parameters
fromObjPointer to the object the link originates.
objPathPath of the entry to be linked relative to from.
Returns
Status code indicating success or failure.

◆ unlinkObject() [3/7]

StatusCode DataSvc::unlinkObject ( IRegistry from,
std::string_view  objPath 
)
override

Remove a link to another object.

Definition at line 740 of file DataSvc.cpp.

740  {
741  if ( !checkRoot() ) return Status::INVALID_ROOT;
742  try {
743  RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
744  if ( from_entry ) {
745  auto sep = objPath.rfind( SEPARATOR );
746  if ( sep > 0 && sep != std::string_view::npos ) { // in case the objPath is a sub-directory itself
747  DataObject* pO = nullptr;
748  StatusCode sc = findObject( from, objPath.substr( 0, sep ), pO );
749  return sc.isSuccess() ? unlinkObject( pO->registry(), objPath.substr( sep ) ) : sc;
750  }
751  StatusCode status = from_entry->remove( objPath );
752  if ( status.isSuccess() ) return status;
753  return Status::INVALID_OBJ_PATH;
754  }
755  } catch ( ... ) {}
756  return Status::INVALID_PARENT;
757 }

◆ unlinkObject() [4/7]

virtual StatusCode IDataProviderSvc::unlinkObject

Remove a link to another object.

Both objects must be registered with the data store. This entry point can be used to unlink objects e.g. in order to unregister them.

Parameters
fromPointer to data directory the link originates.
objPathPath of the entry to be linked relative to from.
Returns
Status code indicating success or failure.

◆ unlinkObject() [5/7]

StatusCode IDataProviderSvc::unlinkObject
inline

Remove a link to another object.

Both objects must be registered with the data store. This entry point can be used to unlink objects e.g. in order to unregister them.

Parameters
fromPathPath to the object the link originates.
objPathPath of the entry to be linked relative to from.
Returns
Status code indicating success or failure.

Definition at line 532 of file IDataProviderSvc.h.

532  {
533  DataObject* pObject = nullptr;
534  StatusCode status = findObject( fromPath, pObject );
535  return status.isSuccess() ? unlinkObject( pObject->registry(), objPath ) : status;
536  }

◆ unlinkObject() [6/7]

StatusCode DataSvc::unlinkObject ( std::string_view  fullPath)
override

Remove a link to another object.

Definition at line 760 of file DataSvc.cpp.

760  {
761  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
762  if ( fullPath.front() != SEPARATOR ) return unlinkObject( m_rootName.value(), fullPath );
763  auto sep = fullPath.rfind( SEPARATOR );
764  return unlinkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ) );
765 }

◆ unlinkObject() [7/7]

virtual StatusCode IDataProviderSvc::unlinkObject

Remove a link to another object.

Both objects must be registered with the data store. This entry point can be used to unlink objects e.g. in order to unregister them.

Parameters
fullPathFull path of the entry to be linked.
Returns
Status code indicating success or failure.

◆ unregisterAddress() [1/5]

StatusCode IDataManagerSvc::unregisterAddress
inline

Unregister object address from the data store.

The object is identified by parent object and the path of the object relative to the parent.

Parameters
pParent[IN] Pointer to parent object.
objPath[IN] Path name of the object relative to the parent.
Returns
Status code indicating success or failure.

Definition at line 243 of file IDataManagerSvc.h.

243  {
244  return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
245  }

◆ unregisterAddress() [2/5]

StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
std::string_view  objPath 
)
override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 273 of file DataSvc.cpp.

273  {
274  if ( !checkRoot() ) return Status::INVALID_ROOT;
275  if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
276 
277  if ( !pParent ) {
278  if ( objPath.front() != SEPARATOR ) return unregisterAddress( m_root.get(), objPath );
279  auto sep = find( objPath, SEPARATOR, 1 );
280  if ( sep != std::string_view::npos && objPath.substr( 0, sep ) == m_rootName.value() ) {
281  return unregisterAddress( m_root.get(), objPath.substr( sep ) );
282  }
283  return Status::INVALID_PARENT;
284  }
285  if ( objPath.front() != SEPARATOR ) { return unregisterAddress( pParent, char( SEPARATOR ) + objPath ); }
286  RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
287  if ( node_entry ) {
288  RegEntry* leaf_entry = node_entry->findLeaf( objPath );
289  if ( leaf_entry ) {
290  auto sep = objPath.rfind( SEPARATOR );
291  if ( sep > 0 && sep != std::string_view::npos ) {
292  return unregisterAddress( leaf_entry->parent(), objPath.substr( sep ) );
293  }
294  StatusCode status = node_entry->remove( objPath );
295  if ( status.isSuccess() ) return status;
296  }
297  }
298  return Status::INVALID_PARENT;
299 }

◆ unregisterAddress() [3/5]

virtual StatusCode IDataManagerSvc::unregisterAddress

Unregister object address from the data store.

The object is identified by parent object and the path of the object relative to the parent.

Parameters
pParent[IN] Pointer to parent object.
objPath[IN] Path name of the object relative to the parent.
Returns
Status code indicating success or failure.

◆ unregisterAddress() [4/5]

StatusCode DataSvc::unregisterAddress ( std::string_view  fullPath)
override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 267 of file DataSvc.cpp.

267  {
268  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
269  return unregisterAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath );
270 }

◆ unregisterAddress() [5/5]

virtual StatusCode IDataManagerSvc::unregisterAddress

Unregister object address from the data store.

The object is identified by full path name.

Parameters
fullPath[IN] Path name of the object.
Returns
Status code indicating success or failure.

◆ unregisterObject() [1/3]

StatusCode DataSvc::unregisterObject ( DataObject pObject)
override

Unregister object from the data store.

Definition at line 397 of file DataSvc.cpp.

397  {
398  if ( !checkRoot() ) return Status::INVALID_ROOT;
399  RegEntry* entry = m_root->findLeaf( pObject );
400  if ( !entry ) return Status::INVALID_OBJECT;
401  RegEntry* parent = entry->parentEntry();
402  if ( !parent ) return Status::INVALID_PARENT;
403  if ( !entry->isEmpty() ) return Status::DIR_NOT_EMPTY;
404  if ( entry->object() ) entry->object()->addRef();
405  if ( parent ) parent->remove( entry );
406  return StatusCode::SUCCESS;
407 }

◆ unregisterObject() [2/3]

StatusCode DataSvc::unregisterObject ( DataObject pObject,
std::string_view  objectPath 
)
override

Unregister object from the data store.

Definition at line 410 of file DataSvc.cpp.

410  {
411  if ( checkRoot() ) {
412  try {
413  RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
414  if ( parent ) {
415  RegEntry* entry = parent->findLeaf( objectPath );
416  if ( entry ) {
417  if ( entry->isEmpty() ) {
418  if ( entry->object() ) { entry->object()->addRef(); }
419  parent->remove( entry );
420  return StatusCode::SUCCESS;
421  }
422  return Status::DIR_NOT_EMPTY;
423  }
424  return Status::INVALID_OBJECT;
425  }
426  } catch ( ... ) {}
427  return Status::INVALID_PARENT;
428  }
429  return Status::INVALID_ROOT;
430 }

◆ unregisterObject() [3/3]

StatusCode DataSvc::unregisterObject ( std::string_view  fullPath)
override

Unregister object from the data store.

Definition at line 382 of file DataSvc.cpp.

382  {
383  DataObject* pObject = nullptr;
384  StatusCode status = findObject( fullPath, pObject );
385  if ( status.isFailure() ) return status;
386  RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
387  if ( !pEntry ) return Status::INVALID_ROOT;
388  if ( !pEntry->isEmpty() ) return Status::DIR_NOT_EMPTY;
389  RegEntry* pParent = pEntry->parentEntry();
390  if ( !pParent ) return Status::INVALID_PARENT;
391  pObject->addRef();
392  pParent->remove( pEntry );
393  return StatusCode::SUCCESS;
394 }

◆ updateObject() [1/2]

StatusCode DataSvc::updateObject ( DataObject toUpdate)
override

Update object.

Definition at line 672 of file DataSvc.cpp.

672  {
673  StatusCode status = Status::INVALID_OBJ_ADDR;
674  if ( !toUpdate ) { // Precondition:
675  return Status::INVALID_OBJECT; // Address must be valid
676  }
677  IRegistry* pRegistry = toUpdate->registry(); // Precondition:
678  if ( !pRegistry ) { // Need valid registry
679  return Status::INVALID_OBJECT;
680  }
681  IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
682  if ( !pAddress ) { // Need valid address
683  return Status::INVALID_OBJ_ADDR;
684  }
685  IConversionSvc* pLoader = getDataLoader( pRegistry );
686  if ( !pLoader ) { // Precondition:
687  return Status::NO_DATA_LOADER; // Data loader must be present
688  }
689  if ( !m_inhibitPathes.empty() ) {
690  auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), pRegistry->identifier() );
691  if ( inhibit != m_inhibitPathes.end() ) { return Status::NO_ACCESS; }
692  }
693  try {
694  status = pLoader->updateObj( pAddress, toUpdate ); // Call data loader
695  if ( status.isSuccess() ) { status = pLoader->updateObjRefs( pAddress, toUpdate ); }
696  } catch ( const GaudiException& exc ) {
697  throw GaudiException( "GaudiException in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE, exc );
698  } catch ( const std::exception& x ) {
699  throw GaudiException( "std::exception in updateObject() " + pRegistry->name() + ": " +
700  System::typeinfoName( typeid( x ) ) + ", " + x.what(),
702  } catch ( ... ) {
703  throw GaudiException( "UNKN exception in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE );
704  }
705  return status;
706 }

◆ updateObject() [2/2]

StatusCode DataSvc::updateObject ( IRegistry pDirectory)
override

Update object identified by its directory entry.

Update object.

Definition at line 660 of file DataSvc.cpp.

660  {
661  if ( !pRegistry ) { // Precondition:
662  return Status::INVALID_OBJ_ADDR; // Addres must be valid
663  }
664  DataObject* toUpdate = pRegistry->object();
665  if ( !toUpdate ) { // Try first to load
666  return loadObject( pRegistry );
667  }
668  return updateObject( toUpdate );
669 }

Member Data Documentation

◆ m_accessName

Gaudi::Property<std::string> DataSvc::m_accessName { this, "DataAccessName", "DataAccess", "Name of the data access incident" }
private

Definition at line 75 of file DataSvc.h.

◆ m_dataLoader

SmartIF<IConversionSvc> DataSvc::m_dataLoader = nullptr
private

Pointer to data loader service.

Definition at line 55 of file DataSvc.h.

◆ m_enableAccessHdlr

Gaudi::Property<bool> DataSvc::m_enableAccessHdlr
private
Initial value:
{ this, "EnableAccessHandler", false,
"enable incidents on data access requests" }

Definition at line 73 of file DataSvc.h.

◆ m_enableFaultHdlr

Gaudi::Property<bool> DataSvc::m_enableFaultHdlr
private
Initial value:
{ this, "EnableFaultHandler", false,
"enable incidents on data creation requests" }

Definition at line 69 of file DataSvc.h.

◆ m_faultName

Gaudi::Property<std::string> DataSvc::m_faultName { this, "DataFaultName", "DataFault", "Name of the data fault incident" }
private

Definition at line 71 of file DataSvc.h.

◆ m_forceLeaves

Gaudi::Property<bool> DataSvc::m_forceLeaves
private
Initial value:
{ this, "ForceLeaves", false,
"force creation of default leaves on registerObject" }

Definition at line 65 of file DataSvc.h.

◆ m_incidentSvc

SmartIF<IIncidentSvc> DataSvc::m_incidentSvc = nullptr
protected

Pointer to incident service.

Definition at line 59 of file DataSvc.h.

◆ m_inhibitPathes

Gaudi::Property<std::vector<std::string> > DataSvc::m_inhibitPathes { this, "InhibitPathes", {}, "inhibited leaves" }
private

Definition at line 67 of file DataSvc.h.

◆ m_preLoads

std::vector<DataStoreItem> DataSvc::m_preLoads
private

Items to be pre-loaded.

Definition at line 78 of file DataSvc.h.

◆ m_root

std::unique_ptr<DataSvcHelpers::RegistryEntry> DataSvc::m_root
protected

Pointer to root entry.

Definition at line 82 of file DataSvc.h.

◆ m_rootCLID

Gaudi::Property<CLID> DataSvc::m_rootCLID { this, "RootCLID", 110 , "CLID of root entry" }
protected

Definition at line 61 of file DataSvc.h.

◆ m_rootName

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

Definition at line 62 of file DataSvc.h.


The documentation for this class was generated from the following files:
DataSvcHelpers::RegistryEntry::find
IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:149
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:76
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:119
std::string
STL class.
std::exception
STL class.
std::move
T move(T... args)
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:103
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
DataSvcHelpers::RegistryEntry::isSoft
bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:137
IOpaqueAddress
Definition: IOpaqueAddress.h:33
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:788
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::find
T find(T... args)
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:72
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
DataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: DataSvc.cpp:186
GaudiException
Definition: GaudiException.h:31
std::unique_ptr::get
T get(T... args)
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:740
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:541
IConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:105
IRegistry
Definition: IRegistry.h:32
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
DataSvc::findObject
StatusCode findObject(std::string_view fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:649
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:627
std::unique_ptr::reset
T reset(T... args)
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:111
std::vector::push_back
T push_back(T... args)
DataSvc::i_handleDataFault
DataObject * i_handleDataFault(IRegistry *pReg, std::string_view path=std::string_view{})
Definition: DataSvc.cpp:438
DataSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:55
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:133
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:139
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:136
DataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:870
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:131
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
DataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, std::string_view path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:434
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:62
DataSvc::traverseSubTree
StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: DataSvc.cpp:119
DataIncident
ON_VERBOSE
#define ON_VERBOSE
Definition: DataSvc.cpp:77
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:152
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:129
DataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:151
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
DataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: DataSvc.h:69
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
std::to_string
T to_string(T... args)
std::vector::erase
T erase(T... args)
DataSvcHelpers::RegistryEntry::isEmpty
bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:143
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
genconfuser.verbose
verbose
Definition: genconfuser.py:28
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
DataSvcHelpers::RegistryEntry::parent
IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:135
std::remove
T remove(T... args)
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:99
DataSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:267
std::string::append
T append(T... args)
DataSvc::m_faultName
Gaudi::Property< std::string > m_faultName
Definition: DataSvc.h:71
DataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: DataSvc.h:67
DataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: DataSvc.cpp:810
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:50
DataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: DataSvc.h:82
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:264
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:59
DataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: DataSvc.h:65
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataSvc::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: DataSvc.cpp:207
VERMSG
#define VERMSG
Definition: DataSvc.cpp:80
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
IConverter::updateObjRefs
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
DataSvcHelpers::RegistryEntry
Definition: RegistryEntry.h:46
DataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:875
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:709
DataSvcHelpers::RegistryEntry::add
StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:198
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataObject
Definition: DataObject.h:36
DataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: DataSvc.cpp:193
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
DataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:302
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:127
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
DataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: DataSvc.h:75
IOTest.end
end
Definition: IOTest.py:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
DataSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: DataSvc.h:61
DataSvcHelpers::RegistryEntry::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:281
DataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: DataSvc.h:73
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:660
Service::service
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.
Definition: Service.h:89
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:78
DataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:78
DataSvc::registerAddress
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:224
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
std::exception::what
T what(T... args)
DataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:469
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:101
IConversionSvc
Definition: IConversionSvc.h:47