The Gaudi Framework  master (37c0b60a)
TsDataSvc Class Reference

#include <GaudiKernel/TsDataSvc.h>

Inheritance diagram for TsDataSvc:
Collaboration diagram for TsDataSvc:

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 i_setRoot (DataObject *pRootObj)
 
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 i_setRoot (IOpaqueAddress *pRootAddr)
 
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...
 
 TsDataSvc (const std::string &name, ISvcLocator *svc)
 constructor More...
 
 TsDataSvc (const TsDataSvc &)=delete
 no copy constructor More...
 
TsDataSvcoperator= (const TsDataSvc &)=delete
 no assignment operator 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

tsDataSvcMutex m_accessMutex
 Mutex to protect access to the store. 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 Attributes

IConversionSvcm_dataLoader = nullptr
 Pointer to data loader service. More...
 
ServiceHandle< IIncidentSvcm_incidentSvc
 Handle 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" }
 
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...
 
std::unique_ptr< DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry. 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.

The accessor methods are protected with a lock. This is done having in mind the DetDataSvc and the retrieval of subdetectors in a multithreaded FW. This solution cannot solve the problem of having different conditions set available simultaneously but it is the simplest solution to allow multiple algorithms running concurrently to access detector components. In first approximation, since for the data we have the whiteboard, we protect only the retrieval of objects.

Author
Markus Frank
Sebastien Ponce
Danilo Piparo
Version
1.1

Definition at line 65 of file TsDataSvc.h.

Constructor & Destructor Documentation

◆ TsDataSvc() [1/2]

TsDataSvc::TsDataSvc ( const std::string name,
ISvcLocator svc 
)

constructor

Definition at line 85 of file TsDataSvc.cpp.

86  : base_class( name, svc ), m_incidentSvc( "IncidentSvc", name ) {}

◆ TsDataSvc() [2/2]

TsDataSvc::TsDataSvc ( const TsDataSvc )
delete

no copy constructor

Member Function Documentation

◆ addPreLoadItem()

StatusCode TsDataSvc::addPreLoadItem ( const DataStoreItem item)
override

Add an item to the preload list.

Definition at line 769 of file TsDataSvc.cpp.

769  {
770  auto i = std::find( m_preLoads.begin(), m_preLoads.end(), item );
771  if ( i == m_preLoads.end() ) m_preLoads.push_back( item );
772  return StatusCode::SUCCESS;
773 }

◆ checkRoot()

bool TsDataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 272 of file TsDataSvc.h.

272 { return 0 != m_root; }

◆ clearStore()

StatusCode TsDataSvc::clearStore ( )
override

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 117 of file TsDataSvc.cpp.

117  {
118  if ( !checkRoot() ) return Status::INVALID_ROOT;
119  m_root.reset();
120  return StatusCode::SUCCESS;
121 }

◆ clearSubTree() [1/2]

StatusCode TsDataSvc::clearSubTree ( DataObject pObject)
override

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

Definition at line 106 of file TsDataSvc.cpp.

106  {
107  if ( !checkRoot() ) return Status::INVALID_ROOT;
108  RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
109  if ( !entry ) return Status::INVALID_OBJECT;
110  RegEntry* parent = entry->parentEntry();
111  if ( !parent ) return Status::INVALID_PARENT;
112  parent->remove( entry );
113  return StatusCode::SUCCESS;
114 }

◆ clearSubTree() [2/2]

StatusCode TsDataSvc::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 91 of file TsDataSvc.cpp.

91  {
92  DataObject* pObject = nullptr;
93  StatusCode status = findObject( sub_tree_path, pObject );
94  if ( !status.isSuccess() ) return status;
95  RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
96  if ( !node_entry ) return Status::INVALID_OBJECT;
97  RegEntry* parent = node_entry->parentEntry();
98  if ( !parent ) return Status::INVALID_PARENT;
99  parent->remove( node_entry );
100  return StatusCode::SUCCESS;
101 }

◆ createDefaultObject()

DataObject * TsDataSvc::createDefaultObject ( ) const
protectedvirtual

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

Definition at line 864 of file TsDataSvc.cpp.

864 { return new DataObject(); }

◆ finalize()

StatusCode TsDataSvc::finalize ( )
override

Service initialization.

Service initialisation.

Definition at line 849 of file TsDataSvc.cpp.

849  {
850  // Nothing to do: just call base class initialisation
851  setDataLoader( nullptr ).ignore();
852  resetPreLoad().ignore();
853  clearStore().ignore();
854  return Service::finalize();
855 }

◆ 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 TsDataSvc::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 TsDataSvc.cpp.

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

◆ 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 TsDataSvc::findObject ( std::string_view  fullPath,
DataObject *&  pObject 
)
override

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

Definition at line 650 of file TsDataSvc.cpp.

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

◆ 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 * TsDataSvc::getDataLoader ( IRegistry pReg)
protectedvirtual

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

Definition at line 869 of file TsDataSvc.cpp.

869 { return m_dataLoader; }

◆ handleDataFault()

DataObject * TsDataSvc::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 442 of file TsDataSvc.cpp.

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

◆ i_setRoot() [1/4]

StatusCode TsDataSvc::i_setRoot ( DataObject pRootObj)
inline

Definition at line 159 of file TsDataSvc.h.

159 { return i_setRoot( m_rootName, pRootObj ); }

◆ i_setRoot() [2/4]

StatusCode TsDataSvc::i_setRoot ( IOpaqueAddress pRootAddr)
inline

Definition at line 170 of file TsDataSvc.h.

170 { return i_setRoot( m_rootName, pRootAddr ); }

◆ i_setRoot() [3/4]

StatusCode TsDataSvc::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 162 of file TsDataSvc.cpp.

162  {
163  if ( pRootObj ) {
164  m_root = std::make_unique<RegEntry>( std::move( root_path ) );
165  m_root->makeHard( pRootObj );
166  m_root->setDataSvc( this );
167  // No done with GaudiHive. preLoad().ignore();
168  }
169  return StatusCode::SUCCESS;
170 }

◆ i_setRoot() [4/4]

StatusCode TsDataSvc::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 186 of file TsDataSvc.cpp.

186  {
187  if ( pRootAddr ) {
188  m_root = std::make_unique<RegEntry>( std::move( root_path ) );
189  m_root->makeHard( pRootAddr );
190  m_root->setDataSvc( this );
191  // Not done with GaudiHive. preLoad().ignore();
192  }
193  return StatusCode::SUCCESS;
194 }

◆ initialize()

StatusCode TsDataSvc::initialize ( )
override

Service initialization.

Definition at line 816 of file TsDataSvc.cpp.

816  {
817  // Nothing to do: just call base class initialisation
819  if ( !sc.isSuccess() ) return sc;
820  sc = m_incidentSvc.retrieve();
821  if ( !sc.isSuccess() ) { error() << "Failed to access incident service." << endmsg; }
822  return sc;
823 }

◆ 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 TsDataSvc::linkObject ( IRegistry from,
std::string_view  objPath,
DataObject to 
)
override

Add a link to another object.

Definition at line 700 of file TsDataSvc.cpp.

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

◆ 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 TsDataSvc::linkObject ( std::string_view  fullPath,
DataObject to 
)
override

Add a link to another object.

Definition at line 724 of file TsDataSvc.cpp.

724  {
725  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
726  if ( fullPath.front() == SEPARATOR ) {
727  auto sep = fullPath.rfind( SEPARATOR );
728  return linkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ), to );
729  }
731  return linkObject( m_root.get(), fullPath, to );
732 }

◆ 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 TsDataSvc::loadObject ( IConversionSvc pLoader,
IRegistry pNode 
)
protectedvirtual

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

Reimplemented in DetDataSvc.

Definition at line 480 of file TsDataSvc.cpp.

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

◆ loadObject() [2/2]

StatusCode TsDataSvc::loadObject ( IRegistry pNode)
protectedvirtual

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

Definition at line 472 of file TsDataSvc.cpp.

472  {
473  IConversionSvc* pLoader = getDataLoader( pRegistry );
474  return loadObject( pLoader, pRegistry );
475 }

◆ objectLeaves() [1/2]

StatusCode TsDataSvc::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 221 of file TsDataSvc.cpp.

221  {
222  if ( !pObject ) return Status::INVALID_OBJECT;
223  return objectLeaves( pObject->registry(), leaves );
224 }

◆ objectLeaves() [2/2]

StatusCode TsDataSvc::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 229 of file TsDataSvc.cpp.

229  {
230  if ( !pRegistry ) return Status::INVALID_OBJECT;
231  const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
232  if ( !node_entry ) return Status::INVALID_OBJECT;
234  leaves.insert( leaves.end(), node_entry->leaves().begin(), node_entry->leaves().end() );
235  // leaves = node_entry->leaves();
236  return StatusCode::SUCCESS;
237 }

◆ objectParent() [1/2]

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

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

Definition at line 206 of file TsDataSvc.cpp.

206  {
207  if ( !pObject ) return Status::INVALID_OBJECT;
208  return objectParent( pObject->registry(), refpParent );
209 }

◆ objectParent() [2/2]

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

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

Definition at line 211 of file TsDataSvc.cpp.

211  {
213  if ( !checkRoot() ) return Status::INVALID_ROOT;
214  const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
215  if ( !node_entry ) return Status::INVALID_OBJECT;
216  refpParent = node_entry->parent();
217  return StatusCode::SUCCESS;
218 }

◆ operator=()

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

no assignment operator

◆ preLoad() [1/2]

StatusCode TsDataSvc::preLoad ( )
override

load all preload items of the list

Definition at line 805 of file TsDataSvc.cpp.

805  {
806  DataObject* pObj = nullptr;
807  for ( const auto& i : m_preLoads ) {
808  StatusCode sc = retrieveObject( i.path(), pObj );
809  int load_depth = i.depth();
810  if ( sc.isSuccess() && load_depth > 1 ) { preLoad( 1, load_depth, pObj ).ignore(); }
811  }
812  return StatusCode::SUCCESS;
813 }

◆ preLoad() [2/2]

StatusCode TsDataSvc::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 789 of file TsDataSvc.cpp.

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

◆ 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 TsDataSvc::registerAddress ( IRegistry parentObj,
std::string_view  objectPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

Definition at line 246 of file TsDataSvc.cpp.

246  {
247  if ( !checkRoot() ) return Status::INVALID_ROOT;
248  if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
249  if ( !parentObj ) {
250  if ( objPath.front() != SEPARATOR ) { return registerAddress( m_root.get(), objPath, pAddress ); }
251  auto sep = find( objPath, SEPARATOR, 1 );
252  if ( sep == std::string_view::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
253  return Status::INVALID_PARENT;
254  }
255  return registerAddress( m_root.get(), objPath.substr( sep ), pAddress );
256  }
257  if ( objPath.front() != SEPARATOR ) { return registerAddress( parentObj, SEPARATOR + objPath, pAddress ); }
258  RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
259  if ( !par_entry ) return Status::INVALID_PARENT;
260  auto sep = objPath.rfind( SEPARATOR );
261  if ( sep > 0 && sep != std::string_view::npos ) {
262  auto p_path = objPath.substr( 0, sep );
263  auto o_path = objPath.substr( sep );
264  RegEntry* p_entry = par_entry->findLeaf( p_path );
265  // Create default object leafs if the
266  // intermediate nodes are not present
267  if ( !p_entry && m_forceLeaves ) {
268  DataObject* pLeaf = createDefaultObject();
269  StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
270  if ( !sc.isSuccess() ) delete pLeaf;
271  p_entry = par_entry->findLeaf( p_path );
272  }
273  if ( !p_entry ) return Status::INVALID_PARENT;
274  return registerAddress( p_entry, o_path, pAddress );
275  }
276  StatusCode status = par_entry->add( std::string{ objPath }, pAddress );
277  return status.isSuccess() ? status : Status::DOUBL_OBJ_PATH;
278 }

◆ 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 TsDataSvc::registerAddress ( std::string_view  fullPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

Definition at line 240 of file TsDataSvc.cpp.

240  {
241  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
242  return registerAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath, pAddress );
243 }

◆ 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 TsDataSvc::registerObject ( DataObject parentObj,
std::string_view  objPath,
DataObject pObject 
)
override

Register object with the data store.

Definition at line 328 of file TsDataSvc.cpp.

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

◆ 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 TsDataSvc::registerObject ( std::string_view  parentPath,
std::string_view  objPath,
DataObject pObject 
)
override

Register object with the data store.

Definition at line 316 of file TsDataSvc.cpp.

316  {
317  DataObject* pO = nullptr;
318  StatusCode status = retrieveObject( parentPath, pO );
319  if ( !status.isSuccess() && m_forceLeaves ) {
320  pO = createDefaultObject();
321  status = registerObject( parentPath, pO );
322  if ( !status.isSuccess() ) pO->release();
323  }
324  return status.isSuccess() ? registerObject( pO, objPath, pObject ) : status;
325 }

◆ reinitialize()

StatusCode TsDataSvc::reinitialize ( )
override

Service initialization.

Service reinitialization.

Definition at line 826 of file TsDataSvc.cpp.

826  {
827  StatusCode sc;
828  // the finalize part is copied here
829  setDataLoader( nullptr ).ignore();
830  resetPreLoad().ignore();
831  clearStore().ignore();
832  // re-initialize the base class
833  sc = Service::reinitialize();
834  if ( !sc.isSuccess() ) {
835  error() << "Unable to reinitialize base class" << endmsg;
836  return sc;
837  }
838  // the initialize part is copied here
839  sc = m_incidentSvc.retrieve();
840  if ( !sc.isSuccess() ) {
841  error() << "Failed to access incident service." << endmsg;
842  return sc;
843  }
844  // return
845  return StatusCode::SUCCESS;
846 }

◆ removePreLoadItem()

StatusCode TsDataSvc::removePreLoadItem ( const DataStoreItem item)
override

Remove an item from the preload list.

Definition at line 776 of file TsDataSvc.cpp.

776  {
777  auto i = std::remove( m_preLoads.begin(), m_preLoads.end(), item );
778  m_preLoads.erase( i, m_preLoads.end() );
779  return StatusCode::SUCCESS;
780 }

◆ resetPreLoad()

StatusCode TsDataSvc::resetPreLoad ( )
override

Clear the preload list.

Definition at line 783 of file TsDataSvc.cpp.

783  {
784  m_preLoads.clear();
785  return StatusCode::SUCCESS;
786 }

◆ retrieveEntry()

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

Retrieve registry entry from store.

Definition at line 548 of file TsDataSvc.cpp.

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

◆ 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 TsDataSvc::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 TsDataSvc.cpp.

627  {
628  pObject = nullptr;
629  RegEntry * result = nullptr, *parent = CAST_REGENTRY( RegEntry*, pRegistry );
630  StatusCode status = 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 TsDataSvc::rootCLID ( ) const
override

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 858 of file TsDataSvc.cpp.

858 { return ( (CLID)m_rootCLID ); }

◆ rootName()

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 861 of file TsDataSvc.cpp.

861 { return ( m_rootName ); }

◆ setDataLoader()

StatusCode TsDataSvc::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 197 of file TsDataSvc.cpp.

197  {
198  if ( pDataLoader ) pDataLoader->addRef();
200  if ( pDataLoader ) { pDataLoader->setDataProvider( dpsvc == nullptr ? this : dpsvc ).ignore(); }
201  m_dataLoader = pDataLoader;
202  return StatusCode::SUCCESS;
203 }

◆ setRoot() [1/2]

StatusCode TsDataSvc::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 152 of file TsDataSvc.cpp.

152  {
153  clearStore().ignore();
154  return i_setRoot( std::move( root_path ), pRootObj );
155 }

◆ setRoot() [2/2]

StatusCode TsDataSvc::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 176 of file TsDataSvc.cpp.

176  {
177  clearStore().ignore();
178  return i_setRoot( std::move( root_path ), pRootAddr );
179 }

◆ traverseSubTree() [1/2]

StatusCode TsDataSvc::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 133 of file TsDataSvc.cpp.

133  {
135  if ( !checkRoot() ) return Status::INVALID_ROOT;
136  RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
137  if ( !entry ) return Status::INVALID_OBJECT;
138  return entry->traverseTree( pAgent );
139 }

◆ traverseSubTree() [2/2]

StatusCode TsDataSvc::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 126 of file TsDataSvc.cpp.

126  {
127  DataObject* pO = nullptr;
128  StatusCode status = findObject( sub_tree_path, pO );
129  return status.isSuccess() ? traverseSubTree( pO, pAgent ) : status;
130 }

◆ traverseTree()

StatusCode TsDataSvc::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 142 of file TsDataSvc.cpp.

142  {
144  if ( !checkRoot() ) return Status::INVALID_ROOT;
145  return m_root->traverseTree( pAgent );
146 }

◆ unlinkObject() [1/7]

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

Remove a link to another object.

Definition at line 763 of file TsDataSvc.cpp.

763  {
764  if ( !checkRoot() ) return Status::INVALID_ROOT;
765  return unlinkObject( m_root->findLeaf( from ), objPath );
766 }

◆ 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 TsDataSvc::unlinkObject ( IRegistry from,
std::string_view  objPath 
)
override

Remove a link to another object.

Definition at line 735 of file TsDataSvc.cpp.

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

◆ 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 TsDataSvc::unlinkObject ( std::string_view  fullPath)
override

Remove a link to another object.

Definition at line 755 of file TsDataSvc.cpp.

755  {
756  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
757  if ( fullPath.front() != SEPARATOR ) { return unlinkObject( m_root.get(), fullPath ); }
758  auto sep = fullPath.rfind( SEPARATOR );
759  return unlinkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ) );
760 }

◆ 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 TsDataSvc::unregisterAddress ( IRegistry pParent,
std::string_view  objPath 
)
override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 287 of file TsDataSvc.cpp.

287  {
288  if ( !checkRoot() ) return Status::INVALID_ROOT;
289 
290  if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
291  if ( !pParent ) {
292  if ( objPath.front() != SEPARATOR ) { return unregisterAddress( m_root.get(), objPath ); }
293  auto sep = find( objPath, SEPARATOR, 1 );
294  if ( sep == std::string_view::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
295  return Status::INVALID_PARENT;
296  }
297  return unregisterAddress( m_root.get(), objPath.substr( sep ) );
298  }
299  if ( objPath.front() != SEPARATOR ) { return unregisterAddress( pParent, SEPARATOR + objPath ); }
300  RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
301  if ( node_entry ) {
302  RegEntry* leaf_entry = node_entry->findLeaf( objPath );
303  if ( leaf_entry ) {
304  auto sep = objPath.rfind( SEPARATOR );
305  if ( sep > 0 && sep != std::string_view::npos ) {
306  return unregisterAddress( leaf_entry->parent(), objPath.substr( sep ) );
307  }
308  StatusCode status = node_entry->remove( objPath );
309  if ( status.isSuccess() ) return status;
310  }
311  }
312  return Status::INVALID_PARENT;
313 }

◆ 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 TsDataSvc::unregisterAddress ( std::string_view  fullPath)
override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 281 of file TsDataSvc.cpp.

281  {
282  if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
283  return unregisterAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath );
284 }

◆ 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 TsDataSvc::unregisterObject ( DataObject pObject)
override

Unregister object from the data store.

Definition at line 411 of file TsDataSvc.cpp.

411  {
412  if ( !checkRoot() ) return Status::INVALID_ROOT;
413  RegEntry* entry = m_root->findLeaf( pObject );
414  if ( !entry ) return Status::INVALID_OBJECT;
415  RegEntry* parent = entry->parentEntry();
416  if ( !parent ) return Status::INVALID_PARENT;
417  if ( !entry->isEmpty() ) return Status::DIR_NOT_EMPTY;
418  if ( entry->object() ) entry->object()->addRef();
419  if ( parent ) parent->remove( entry );
420  return StatusCode::SUCCESS;
421 }

◆ unregisterObject() [2/3]

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

Unregister object from the data store.

Definition at line 424 of file TsDataSvc.cpp.

424  {
425  if ( !checkRoot() ) return Status::INVALID_ROOT;
426  try {
427  RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
428  if ( parent ) {
429  RegEntry* entry = parent->findLeaf( objectPath );
430  if ( !entry ) return Status::INVALID_OBJECT;
431  if ( !entry->isEmpty() ) return Status::DIR_NOT_EMPTY;
432  if ( entry->object() ) entry->object()->addRef();
433  parent->remove( entry );
434  return StatusCode::SUCCESS;
435  }
436  } catch ( ... ) {}
437  return Status::INVALID_PARENT;
438 }

◆ unregisterObject() [3/3]

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

Unregister object from the data store.

Definition at line 396 of file TsDataSvc.cpp.

396  {
397  DataObject* pObject = nullptr;
398  StatusCode status = findObject( fullPath, pObject );
399  if ( status.isFailure() ) return status;
400  RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
401  if ( !pEntry ) return Status::INVALID_ROOT;
402  if ( !pEntry->isEmpty() ) return Status::DIR_NOT_EMPTY;
403  RegEntry* pParent = pEntry->parentEntry();
404  if ( !pParent ) return Status::INVALID_PARENT;
405  pObject->addRef();
406  pParent->remove( pEntry );
407  return StatusCode::SUCCESS;
408 }

◆ updateObject() [1/2]

StatusCode TsDataSvc::updateObject ( DataObject toUpdate)
override

Update object.

Definition at line 669 of file TsDataSvc.cpp.

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

◆ updateObject() [2/2]

StatusCode TsDataSvc::updateObject ( IRegistry pDirectory)
override

Update object identified by its directory entry.

Update object.

Definition at line 662 of file TsDataSvc.cpp.

662  {
663  if ( !pRegistry ) return Status::INVALID_OBJ_ADDR; // Precondition: Addres must be valid
664  DataObject* toUpdate = pRegistry->object();
665  return toUpdate ? updateObject( toUpdate ) : loadObject( pRegistry );
666 }

Member Data Documentation

◆ m_accessMutex

tsDataSvcMutex TsDataSvc::m_accessMutex
protected

Mutex to protect access to the store.

Definition at line 304 of file TsDataSvc.h.

◆ m_accessName

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

Definition at line 84 of file TsDataSvc.h.

◆ m_dataLoader

IConversionSvc* TsDataSvc::m_dataLoader = nullptr
private

Pointer to data loader service.

Definition at line 68 of file TsDataSvc.h.

◆ m_enableAccessHdlr

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

Definition at line 82 of file TsDataSvc.h.

◆ m_enableFaultHdlr

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

Definition at line 78 of file TsDataSvc.h.

◆ m_faultName

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

Definition at line 80 of file TsDataSvc.h.

◆ m_forceLeaves

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

Definition at line 74 of file TsDataSvc.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> TsDataSvc::m_incidentSvc
private

Handle to incident service.

Definition at line 70 of file TsDataSvc.h.

◆ m_inhibitPathes

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

Definition at line 76 of file TsDataSvc.h.

◆ m_preLoads

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

Items to be pre-loaded.

Definition at line 87 of file TsDataSvc.h.

◆ m_root

std::unique_ptr<DataSvcHelpers::RegistryEntry> TsDataSvc::m_root
private

Pointer to root entry.

Definition at line 89 of file TsDataSvc.h.

◆ m_rootCLID

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

Definition at line 72 of file TsDataSvc.h.

◆ m_rootName

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

Definition at line 73 of file TsDataSvc.h.


The documentation for this class was generated from the following files:
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:472
TsDataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:87
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:76
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:74
DataSvcHelpers::RegistryEntry::find
IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:149
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:89
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
TsDataSvc::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: TsDataSvc.cpp:197
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
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:700
IOpaqueAddress
Definition: IOpaqueAddress.h:33
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:805
std::find
T find(T... args)
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
GaudiException
Definition: GaudiException.h:31
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:869
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:272
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:53
std::unique_ptr::get
T get(T... args)
TsDataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: TsDataSvc.h:78
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
TsDataSvc::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: TsDataSvc.cpp:162
IRegistry
Definition: IRegistry.h:32
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, std::string_view path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:442
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:316
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:82
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:117
std::unique_ptr::reset
T reset(T... args)
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
TsDataSvc::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to incident service.
Definition: TsDataSvc.h:70
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:74
extends< Service, IDataProviderSvc, IDataManagerSvc >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:24
std::vector::clear
T clear(T... args)
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:864
std::vector::push_back
T push_back(T... args)
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)
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:73
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:139
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
TsDataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: TsDataSvc.cpp:206
DataIncident
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
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
TsDataSvc::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: TsDataSvc.cpp:126
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
TsDataSvc::m_faultName
Gaudi::Property< std::string > m_faultName
Definition: TsDataSvc.h:80
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
ServiceHandle::retrieve
StatusCode retrieve(T *&service) const override
Do the real retrieval of the Service.
Definition: ServiceHandle.h:97
std::string::append
T append(T... args)
TsDataSvc::registerAddress
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:240
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:548
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:50
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
ON_VERBOSE
#define ON_VERBOSE
Definition: TsDataSvc.cpp:79
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:281
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:783
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
TsDataSvc::findObject
StatusCode findObject(std::string_view fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:650
TsDataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: TsDataSvc.h:84
DataSvcHelpers::RegistryEntry
Definition: RegistryEntry.h:46
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:68
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:735
std::vector::begin
T begin(T... args)
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:662
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
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
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
GaudiConfig2.semantics.ident
ident
Definition: semantics.py:198
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.
std::vector::end
T end(T... args)
TsDataSvc::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: TsDataSvc.cpp:221
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:627
DataSvcHelpers::RegistryEntry::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:281
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:78
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
std::exception::what
T what(T... args)
TsDataSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: TsDataSvc.h:72
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:82
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:101
IConversionSvc
Definition: IConversionSvc.h:47