| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TsDataSvc Class Reference

Data service base class. More...

`#include <GaudiKernel/TsDataSvc.h>`

Inheritance diagram for TsDataSvc:
[legend]
Collaboration diagram for TsDataSvc:
[legend]

## Public Member Functions
CLID | rootCLID () const override
| IDataManagerSvc: Accessor for root event CLID. More...
const std::string & | rootName () 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 TsDataSvc &)=delete
| no copy constructor More...
TsDataSvc & | operator= (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::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (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::PropertyBase * | declareProperty (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::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Protected Member Functions
bool | checkRoot ()
| Check if root path is valid. More...
virtual IConversionSvc * | getDataLoader (IRegistry *pReg)
| Retrieve customizable data loader according to registry entry to be retrieved. More...
virtual DataObject * | createDefaultObject () 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...
DataObject * | handleDataFault (IRegistry *pReg, std::string_view path={})
| Invoke data fault handling if enabled. More...
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
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"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, " unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Private Attributes
IConversionSvc * | m_dataLoader = nullptr
| Pointer to data loader service. More...
IIncidentSvc * | m_incidentSvc = nullptr
| Pointer to incident service. More...
Gaudi::Property< CLID > | m_rootCLID {this, "RootCLID", 110 , "CLID of root entry"}
Gaudi::Property< std::string > | m_rootName {this, "RootName", "/Event", "name of root entry"}
Gaudi::Property< bool > | m_forceLeaves {this, "ForceLeaves", false, "force creation of default leaves on registerObject"}
Gaudi::Property< std::vector< std::string > > | m_inhibitPathes {this, "InhibitPathes", {}, "inhibited leaves"}
Gaudi::Property< bool > | m_enableFaultHdlr
Gaudi::Property< std::string > | m_faultName {this, "DataFaultName", "DataFault", "Name of the data fault incident"}
Gaudi::Property< bool > | m_enableAccessHdlr
Gaudi::Property< std::string > | m_accessName {this, "DataAccessName", "DataAccess", "Name of the data access incident"}
std::vector< DataStoreItem > | m_preLoads
| Items to be pre-loaded. More...
std::unique_ptr< DataSvcHelpers::RegistryEntry > | m_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 57 of file TsDataSvc.h.

## Constructor & Destructor Documentation

## ◆ TsDataSvc()

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 756 of file TsDataSvc.cpp.

756 {
757 auto i = std::find( m_preLoads.begin(), m_preLoads.end(), item );
758 if ( i == m_preLoads.end() ) m_preLoads.push_back( item );
759 return StatusCode::SUCCESS;
760 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::vector::end
T end(T... args)
std::vector::push_back
T push_back(T... args)
std::find
T find(T... args)
std::vector::begin
T begin(T... args)
TsDataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:78

## ◆ checkRoot()

bool TsDataSvc::checkRoot | ( |  | ) |
| inline protected

Check if root path is valid.

Definition at line 263 of file TsDataSvc.h.

263 { return 0 != m_root; }
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80

## ◆ clearStore()

StatusCode TsDataSvc::clearStore | ( |  | ) |
| override

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 104 of file TsDataSvc.cpp.

104 {
105 if ( !checkRoot() ) return Status::INVALID_ROOT;
106 m_root.reset();
107 return StatusCode::SUCCESS;
108 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::unique_ptr::reset
T reset(T... args)
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263

## ◆ clearSubTree() [1/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 78 of file TsDataSvc.cpp.

78 {
79 DataObject* pObject = nullptr;
80 StatusCode status = findObject( sub_tree_path, pObject );
81 if ( !status.isSuccess() ) return status;
82 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
83 if ( !node_entry ) return Status::INVALID_OBJECT;
84 RegEntry* parent = node_entry->parentEntry();
85 if ( !parent ) return Status::INVALID_PARENT;
86 parent->remove( node_entry );
87 return StatusCode::SUCCESS;
88 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:637
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ clearSubTree() [2/2]

StatusCode TsDataSvc::clearSubTree | ( | DataObject * | pObject | ) |
| override

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

Definition at line 93 of file TsDataSvc.cpp.

93 {
94 if ( !checkRoot() ) return Status::INVALID_ROOT;
95 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
96 if ( !entry ) return Status::INVALID_OBJECT;
97 RegEntry* parent = entry->parentEntry();
98 if ( !parent ) return Status::INVALID_PARENT;
99 parent->remove( entry );
100 return StatusCode::SUCCESS;
101 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ createDefaultObject()

DataObject * TsDataSvc::createDefaultObject | ( |  | ) | const
| protected virtual

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

Definition at line 859 of file TsDataSvc.cpp.

859 { return new DataObject(); }
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:55

## ◆ finalize()

StatusCode TsDataSvc::finalize | ( |  | ) |
| override

Service initialization.

Service initialisation.

Definition at line 840 of file TsDataSvc.cpp.

840 {
841 // Nothing to do: just call base class initialisation
842 setDataLoader( nullptr ).ignore();
843 resetPreLoad().ignore();
844 clearStore().ignore();
845 if ( m_incidentSvc ) {
846 m_incidentSvc->release();
847 m_incidentSvc = nullptr;
848 }
849 return Service::finalize();
850 }
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:164
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:184
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:770
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:104

## ◆ findObject() [1/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

  pDirectory | Pointer to the object.
  path | String with relative path to directory. Ideally ""!
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

## ◆ findObject() [2/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

  fullPath | Path name of the object.
  pObject | Pointer to the object to be connected.

Returns
  Status code indicating success or failure.

## ◆ findObject() [3/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

  parentPath | Path to parent node of the object.
  objectPath | Relative path name of the object.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 324 of file IDataProviderSvc.h.

324 {
325 DataObject* parent = nullptr;
326 StatusCode status = findObject( parentPath, parent );
327 return status.isSuccess() ? findObject( parent, objectPath, pObject ) : status;
328 }
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:637
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ findObject() [4/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

  parentPath | Path to parent node of the object.
  item | Item identifier.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 338 of file IDataProviderSvc.h.

338 {
339 return findObject( parentPath, itemToPath( item ), pObject );
340 }
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:637

## ◆ findObject() [5/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

  parentObj | Pointer to parent node of the object.
  objectPath | Relative path name of the object.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 351 of file IDataProviderSvc.h.

351 {
352 return findObject( parentObj ? parentObj->registry() : nullptr, objectPath, pObject );
353 }
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:637

## ◆ findObject() [6/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

  parentObj | Pointer to parent node of the object.
  item | Item identifier.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 363 of file IDataProviderSvc.h.

363 {
364 return findObject( parentObj, itemToPath( item ), pObject );
365 }
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:637

## ◆ findObject() [7/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 637 of file TsDataSvc.cpp.

637 {
638 pObject = nullptr;
639 STD_LOCK_GUARD_MACRO
640 if ( !checkRoot() ) return Status::INVALID_ROOT;
641 if ( path.empty() || path == m_rootName ) {
642 pObject = m_root->object();
643 return !pObject ? Status::OBJ_NOT_LOADED : Status::IDataProviderSvc_NO_ERROR;
644 }
645 return findObject( path.front() != SEPARATOR ? m_root.get() : nullptr, path, pObject );
646 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
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:637
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ findObject() [8/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 623 of file TsDataSvc.cpp.

623 {
624 STD_LOCK_GUARD_MACRO
625 pObject = nullptr;
626 IRegistry* pReg = ( pRegistry ? pRegistry : m_root.get() );
627 RegEntry* root_entry = CAST_REGENTRY( RegEntry*, pReg );
628 if ( root_entry ) {
629 if ( !path.empty() ) pReg = root_entry->find( path );
630 if ( !pReg ) return Status::INVALID_OBJ_PATH;
631 pObject = pReg->object();
632 }
633 return pObject ? Status::IDataProviderSvc_NO_ERROR : Status::OBJ_NOT_LOADED;
634 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
DataSvcHelpers::RegistryEntry::find
IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:139
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ getDataLoader()

IConversionSvc * TsDataSvc::getDataLoader | ( | IRegistry * | pReg | ) |
| protected virtual

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

Definition at line 864 of file TsDataSvc.cpp.

864 { return m_dataLoader; }
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:60

## ◆ 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 429 of file TsDataSvc.cpp.

429 {
430 if ( m_enableFaultHdlr ) {
431 IRegistry* pLeaf = nullptr;
432 if ( pReg && path.empty() ) {
433 DataIncident incident( name(), m_faultName, pReg->identifier() );
434 m_incidentSvc->fireIncident( incident );
435 return pReg->object();
436 } else if ( pReg ) {
437 std::string p = pReg->identifier();
438 if ( path.front() != SEPARATOR ) p += SEPARATOR;
439 p.append( path.data(), path.size() );
440 DataIncident incident( name(), m_faultName, p );
441 m_incidentSvc->fireIncident( incident );
442 pLeaf = m_root->findLeaf( p );
443 } else {
444 std::string p = m_root->identifier();
445 if ( path.front() != SEPARATOR ) p += SEPARATOR;
446 p.append( path.data(), path.size() );
447 DataIncident incident( name(), m_faultName, p );
448 m_incidentSvc->fireIncident( incident );
449 pLeaf = m_root->findLeaf( p );
450 }
451 if ( pLeaf ) return pLeaf->object();
452 }
453 return nullptr;
454 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
std::string
STL class.
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
std::string::append
T append(T... args)
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:117
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataIncident
Data service incident class.
TsDataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: TsDataSvc.h:69
TsDataSvc::m_faultName
Gaudi::Property< std::string > m_faultName
Definition: TsDataSvc.h:71

## ◆ i_setRoot() [1/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 149 of file TsDataSvc.cpp.

149 {
150 if ( pRootObj ) {
151 m_root = std::make_unique<RegEntry>( std::move( root_path ) );
152 m_root->makeHard( pRootObj );
153 m_root->setDataSvc( this );
154 // No done with GaudiHive. preLoad().ignore();
155 }
156 return StatusCode::SUCCESS;
157 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:89
std::move
T move(T... args)
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:95

## ◆ i_setRoot() [2/4]

StatusCode TsDataSvc::i_setRoot | ( | DataObject * | pRootObj | ) |
| inline

Definition at line 150 of file TsDataSvc.h.

150 { return i_setRoot( m_rootName, pRootObj ); }
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:149
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ i_setRoot() [3/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 173 of file TsDataSvc.cpp.

173 {
174 if ( pRootAddr ) {
175 m_root = std::make_unique<RegEntry>( std::move( root_path ) );
176 m_root->makeHard( pRootAddr );
177 m_root->setDataSvc( this );
178 // Not done with GaudiHive. preLoad().ignore();
179 }
180 return StatusCode::SUCCESS;
181 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:89
std::move
T move(T... args)
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:95

## ◆ i_setRoot() [4/4]

StatusCode TsDataSvc::i_setRoot | ( | IOpaqueAddress * | pRootAddr | ) |
| inline

Definition at line 161 of file TsDataSvc.h.

161 { return i_setRoot( m_rootName, pRootAddr ); }
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:149
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ initialize()

StatusCode TsDataSvc::initialize | ( |  | ) |
| override

Service initialization.

Definition at line 803 of file TsDataSvc.cpp.

803 {
804 // Nothing to do: just call base class initialisation
805 StatusCode sc = Service::initialize();
806 if ( !sc.isSuccess() ) return sc;
807 sc = service( "IncidentSvc", m_incidentSvc, true );
808 if ( UNLIKELY( !sc.isSuccess() ) ) { error() << "Failed to access incident service." << endmsg; }
809 return sc;
810 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:60
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:83
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ 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

  fromPath | Path to the object the link originates.
  objPath | Path of the entry to be linked relative to from.
  toObj | Pointer to the object the link points to.

Returns
  Status code indicating success or failure.

Definition at line 479 of file IDataProviderSvc.h.

479 {
480 DataObject* pO = nullptr;
481 StatusCode status = retrieveObject( fromPath, pO );
482 return status.isSuccess() ? linkObject( pO->registry(), objPath, toObj ) : status;
483 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:687
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ linkObject() [2/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

  from | Pointer to data directory the link originates.
  objPath | Path of the entry to be linked relative to from.
  toObj | Pointer to the object the link points to.

Returns
  Status code indicating success or failure.

## ◆ linkObject() [3/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

  fromObj | Pointer to the object the link originates.
  objPath | Path of the entry to be linked relative to from.
  toObj | Pointer to the object the link points to.

Returns
  Status code indicating success or failure.

Definition at line 580 of file IDataProviderSvc.h.

580 {
581 if ( fromObj ) {
582 IRegistry* from_entry = fromObj->registry();
583 if ( from_entry ) return linkObject( from_entry, objPath, toObj );
584 }
585 return Status::INVALID_PARENT;
586 }
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:687
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

## ◆ linkObject() [4/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

  fullPath | Full path of the entry to be linked.
  toObj | Pointer to the object the link points to.

Returns
  Status code indicating success or failure.

## ◆ linkObject() [5/6]

StatusCode TsDataSvc::linkObject | ( | IRegistry * | from,
|  | std::string_view | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 687 of file TsDataSvc.cpp.

687 {
688 STD_LOCK_GUARD_MACRO
689 if ( !checkRoot() ) return Status::INVALID_ROOT;
690 try {
691 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
692 if ( from_entry ) {
693 // First check if both objects are already registered to the store
694 RegEntry* to_entry = m_root->findLeaf( to );
695 if ( !to_entry ) return Status::INVALID_OBJECT;
696 auto sep = objPath.rfind( SEPARATOR );
697 if ( sep > 0 && sep != std::string_view::npos ) { // in case the objPath is a sub-directory itself
698 DataObject* pO = nullptr;
699 StatusCode sc = retrieveObject( from, objPath.substr( 0, sep ), pO );
700 return sc.isSuccess() ? linkObject( pO->registry(), objPath.substr( sep ), to ) : sc;
701 }
702 // Now register the soft link
703 StatusCode status = from_entry->add( std::string{objPath}, to, true );
704 return status.isSuccess() ? Status::IDataProviderSvc_NO_ERROR : Status::DOUBL_OBJ_PATH;
705 }
706 } catch ( ... ) {}
707 return Status::INVALID_PARENT;
708 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
std::string
STL class.
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:687
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
DataSvcHelpers::RegistryEntry::add
StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:188
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ linkObject() [6/6]

StatusCode TsDataSvc::linkObject | ( | std::string_view | fullPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 711 of file TsDataSvc.cpp.

711 {
712 if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
713 if ( fullPath.front() == SEPARATOR ) {
714 auto sep = fullPath.rfind( SEPARATOR );
715 return linkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ), to );
716 }
717 STD_LOCK_GUARD_MACRO
718 return linkObject( m_root.get(), fullPath, to );
719 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:687
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44

## ◆ loadObject() [1/2]

StatusCode TsDataSvc::loadObject | ( | IRegistry * | pNode | ) |
| protected virtual

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

Definition at line 459 of file TsDataSvc.cpp.

459 {
460 IConversionSvc* pLoader = getDataLoader( pRegistry );
461 return loadObject( pLoader, pRegistry );
462 }
IConversionSvc
Definition: IConversionSvc.h:37
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:864
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:459

## ◆ loadObject() [2/2]

StatusCode TsDataSvc::loadObject | ( | IConversionSvc * | pLoader,
|  | IRegistry * | pNode
| ) |  |
| protected virtual

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

Reimplemented in DetDataSvc.

Definition at line 467 of file TsDataSvc.cpp.

467 {
468 StatusCode status = Status::INVALID_OBJ_ADDR;
469 DataObject* pObject = nullptr;
470 STD_LOCK_GUARD_MACRO
471 if ( !pLoader ) { // Precondition: Data loader must be present
472 if ( handleDataFault( pRegistry ) )
473 return StatusCode::SUCCESS;
474 else
475 return Status::NO_DATA_LOADER;
476 }
477 if ( !pRegistry ) { // Precondition: Directory must be valid
478 if ( handleDataFault( pRegistry ) )
479 return StatusCode::SUCCESS;
480 else
481 return Status::INVALID_OBJ_ADDR;
482 }
483
484 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
485
486 if ( m_enableAccessHdlr ) {
487 // Fire data access incident
488 DataIncident incident( name(), m_accessName, pRegistry->identifier() );
489 m_incidentSvc->fireIncident( incident );
490 }
491 if ( !m_inhibitPathes.empty() ) {
492 const auto& ident = pRegistry->identifier();
493 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
494 if ( inhibit != m_inhibitPathes.end() ) return Status::NO_ACCESS;
495 }
496 IOpaqueAddress* pAddress = pRegistry->address();
497 if ( !pAddress ) { // Precondition:
498 return Status::INVALID_OBJ_ADDR; // Address must be valid
499 }
500 try {
501 status = pLoader->createObj( pAddress, pObject ); // Call data loader
502 if ( status.isSuccess() ) {
503
504 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
505
506 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
507 pEntry->setObject( pObject );
508
509 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
510 status = pLoader->fillObjRefs( pAddress, pObject );
511 }
512 } catch ( const GaudiException& exc ) {
513 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
514 throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
515 exc );
516 } catch ( const std::exception& x ) {
517 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
518 throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
519 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
520 name(), StatusCode::FAILURE );
521 } catch ( ... ) {
522 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
523 throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
524 }
525 if ( !status.isSuccess() ) {
526 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
527 }
528 ON_VERBOSE if ( status.isSuccess() ) {
529 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
530 }
531 return status;
532 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
IConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
TsDataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: TsDataSvc.h:75
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, std::string_view path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:429
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:73
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:119
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
ON_VERBOSE
#define ON_VERBOSE
Definition: TsDataSvc.cpp:70
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:110
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:73
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T... args)
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DataIncident
Data service incident class.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:67
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ 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 208 of file TsDataSvc.cpp.

208 {
209 if ( !pObject ) return Status::INVALID_OBJECT;
210 return objectLeaves( pObject->registry(), leaves );
211 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:208

## ◆ 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 216 of file TsDataSvc.cpp.

216 {
217 if ( !pRegistry ) return Status::INVALID_OBJECT;
218 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
219 if ( !node_entry ) return Status::INVALID_OBJECT;
220 STD_LOCK_GUARD_MACRO
221 leaves.insert( leaves.end(), node_entry->leaves().begin(), node_entry->leaves().end() );
222 // leaves = node_entry->leaves();
223 return StatusCode::SUCCESS;
224 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::vector::end
T end(T... args)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:129
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::vector::begin
T begin(T... args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ 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 193 of file TsDataSvc.cpp.

193 {
194 if ( !pObject ) return Status::INVALID_OBJECT;
195 return objectParent( pObject->registry(), refpParent );
196 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: TsDataSvc.cpp:193

## ◆ 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 198 of file TsDataSvc.cpp.

198 {
199 STD_LOCK_GUARD_MACRO
200 if ( !checkRoot() ) return Status::INVALID_ROOT;
201 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
202 if ( !node_entry ) return Status::INVALID_OBJECT;
203 refpParent = node_entry->parent();
204 return StatusCode::SUCCESS;
205 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::parent
IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:125
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ operator=()

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

no assignment operator

## ◆ preLoad() [1/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

  depth | current level of loading from requested parent
  load_depth | maximum level of object loading
  pObject | pointer to next level root object

Returns
  Status code indicating success or failure.

Definition at line 776 of file TsDataSvc.cpp.

776 {
777 // unused: StatusCode sc = StatusCode::FAILURE;
778 if ( pObject && depth++ < load_depth ) {
779 RegEntry* dir = CAST_REGENTRY( RegEntry*, pObject->registry() );
780 if ( dir ) {
781 for ( const auto& i : *dir ) {
782 DataObject* pObj = nullptr;
783 StatusCode status = retrieveObject( pObject, i->name(), pObj );
784 if ( status.isSuccess() && depth < load_depth ) { preLoad( depth, load_depth, pObj ).ignore(); }
785 }
786 }
787 }
788 return StatusCode::SUCCESS;
789 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:792
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ preLoad() [2/2]

StatusCode TsDataSvc::preLoad | ( |  | ) |
| override

load all preload items of the list

Definition at line 792 of file TsDataSvc.cpp.

792 {
793 DataObject* pObj = nullptr;
794 for ( const auto& i : m_preLoads ) {
795 StatusCode sc = retrieveObject( i.path(), pObj );
796 int load_depth = i.depth();
797 if ( sc.isSuccess() && load_depth > 1 ) { preLoad( 1, load_depth, pObj ).ignore(); }
798 }
799 return StatusCode::SUCCESS;
800 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:792
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
TsDataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:78
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ registerAddress() [1/5]

StatusCode TsDataSvc::registerAddress | ( | std::string_view | fullPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 227 of file TsDataSvc.cpp.

227 {
228 if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
229 return registerAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath, pAddress );
230 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::registerAddress
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:227
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)

## ◆ registerAddress() [2/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.

## ◆ registerAddress() [3/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 205 of file IDataManagerSvc.h.

205 {
206 return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
207 }
TsDataSvc::registerAddress
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:227

## ◆ registerAddress() [4/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() [5/5]

StatusCode TsDataSvc::registerAddress | ( | IRegistry * | parentObj,
|  | std::string_view | objectPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 233 of file TsDataSvc.cpp.

233 {
234 if ( !checkRoot() ) return Status::INVALID_ROOT;
235 if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
236 if ( !parentObj ) {
237 if ( objPath.front() != SEPARATOR ) { return registerAddress( m_root.get(), objPath, pAddress ); }
238 auto sep = find( objPath, SEPARATOR, 1 );
239 if ( sep == std::string_view::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
240 return Status::INVALID_PARENT;
241 }
242 return registerAddress( m_root.get(), objPath.substr( sep ), pAddress );
243 }
244 if ( objPath.front() != SEPARATOR ) { return registerAddress( parentObj, SEPARATOR + objPath, pAddress ); }
245 RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
246 if ( !par_entry ) return Status::INVALID_PARENT;
247 auto sep = objPath.rfind( SEPARATOR );
248 if ( sep > 0 && sep != std::string_view::npos ) {
249 auto p_path = objPath.substr( 0, sep );
250 auto o_path = objPath.substr( sep );
251 RegEntry* p_entry = par_entry->findLeaf( p_path );
252 // Create default object leafs if the
253 // intermediate nodes are not present
254 if ( !p_entry && m_forceLeaves ) {
255 DataObject* pLeaf = createDefaultObject();
256 StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
257 if ( !sc.isSuccess() ) delete pLeaf;
258 p_entry = par_entry->findLeaf( p_path );
259 }
260 if ( !p_entry ) return Status::INVALID_PARENT;
261 return registerAddress( p_entry, o_path, pAddress );
262 }
263 StatusCode status = par_entry->add( std::string{objPath}, pAddress );
264 return status.isSuccess() ? status : Status::DOUBL_OBJ_PATH;
265 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303
std::string
STL class.
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:859
TsDataSvc::registerAddress
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:227
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:117
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
std::find
T find(T... args)
DataSvcHelpers::RegistryEntry::add
StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:188
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:66
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ registerObject() [1/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

  parentObj | Pointer to parent object.
  objectPath | Path of the object relative to the parent node
  pObject | Pointer to the object to be connected.

Returns
  Status code indicating success or failure.

## ◆ registerObject() [2/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

  parentObj | Pointer to parent object.
  item | item number of the object linked to the parent
  pObject | Pointer to the object to be connected.

Returns
  Status code indicating success or failure.

Definition at line 107 of file IDataProviderSvc.h.

107 {
108 return registerObject( parentObj, itemToPath( item ), pObject );
109 }
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303

## ◆ registerObject() [3/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

  parentPath | Path to parent node of the object.
  item | item number of the object linked to the parent
  pObject | Pointer to the object to be registered.

Returns
  Status code indicating success or failure.

Definition at line 85 of file IDataProviderSvc.h.

85 {
86 return registerObject( parentPath, itemToPath( item ), pObject );
87 }
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303

## ◆ 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

  fullPath | Path to parent node of the object.
  pObject | Pointer to the object to be registered.

Returns
  Status code indicating success or failure.

Definition at line 62 of file IDataProviderSvc.h.

62 {
63 return registerObject( nullptr, fullPath, pObject );
64 }
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303

## ◆ registerObject() [5/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

  parentPath | Path to parent node of the object.
  objectPath | Path of the object relative to the parent node
  pObject | Pointer to the object to be registered.

Returns
  Status code indicating success or failure.

## ◆ registerObject() [6/7]

StatusCode TsDataSvc::registerObject | ( | std::string_view | parentPath,
|  | std::string_view | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 303 of file TsDataSvc.cpp.

303 {
304 DataObject* pO = nullptr;
305 StatusCode status = retrieveObject( parentPath, pO );
306 if ( !status.isSuccess() && m_forceLeaves ) {
307 pO = createDefaultObject();
308 status = registerObject( parentPath, pO );
309 if ( !status.isSuccess() ) pO->release();
310 }
311 return status.isSuccess() ? registerObject( pO, objPath, pObject ) : status;
312 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:859
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:66
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ registerObject() [7/7]

StatusCode TsDataSvc::registerObject | ( | DataObject * | parentObj,
|  | std::string_view | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 315 of file TsDataSvc.cpp.

315 {
316 if ( !checkRoot() ) return Status::INVALID_ROOT;
317 if ( !parentObj ) {
318 if ( !objPath.empty() ) {
319 if ( objPath.front() != SEPARATOR ) { return registerObject( m_rootName.value(), objPath, pObject ); }
320 auto sep = find( objPath, SEPARATOR, 1 );
321 if ( sep != std::string_view::npos ) {
322 return registerObject( objPath.substr( 0, sep ), objPath.substr( sep ), pObject );
323 }
324 }
325 return Status::INVALID_OBJ_PATH;
326 }
327 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, parentObj->registry() );
328 if ( node_entry ) {
329 StatusCode status = Status::INVALID_PARENT;
330 auto sep = find( objPath, SEPARATOR, 1 );
331 if ( sep != std::string_view::npos ) {
332 auto p_path = objPath.substr( 0, sep );
333 auto o_path = objPath.substr( sep );
334 RegEntry* par_entry = node_entry->findLeaf( p_path );
335 // Create default object leafs if the
336 // intermediate nodes are not present
337 if ( !par_entry && m_forceLeaves ) {
338 DataObject* pLeaf = createDefaultObject();
339 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
340 if ( !sc.isSuccess() ) delete pLeaf;
341 par_entry = node_entry->findLeaf( p_path );
342 } else if ( par_entry && !par_entry->object() ) {
343 status = retrieveEntry( node_entry, p_path, par_entry );
344 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
345 DataObject* pLeaf = createDefaultObject();
346 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
347 if ( !sc.isSuccess() ) delete pLeaf;
348 par_entry = node_entry->findLeaf( p_path );
349 }
350 }
351 node_entry = par_entry;
352 if ( node_entry ) {
353 DataObject* obj = node_entry->object();
354 if ( obj ) status = registerObject( obj, o_path, pObject );
355 }
356 } else {
357 RegEntry* leaf = node_entry->findLeaf( objPath );
358 if ( !leaf ) {
359 status = node_entry->add( std::string{objPath}, pObject );
360 } else {
361 DataObject* obj = leaf->object();
362 if ( !obj ) {
363 if ( !pObject ) {
364 error() << "registerObject: trying to register null DataObject" << endmsg;
365 return StatusCode::FAILURE;
366 } else {
367 pObject->setRegistry( leaf );
368 }
369 leaf->setAddress( nullptr );
370 leaf->setObject( pObject );
371 status = StatusCode::SUCCESS;
372 } else {
373 status = Status::DOUBL_OBJ_PATH;
374 }
375 }
376 }
377 return status;
378 }
379 return Status::INVALID_PARENT;
380 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:109
TsDataSvc::registerObject
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:303
std::string
STL class.
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:859
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:119
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:123
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:535
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T... args)
DataSvcHelpers::RegistryEntry::add
StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:188
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:66
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ reinitialize()

StatusCode TsDataSvc::reinitialize | ( |  | ) |
| override

Service initialization.

Service reinitialization.

Definition at line 813 of file TsDataSvc.cpp.

813 {
814 StatusCode sc;
815 // the finalize part is copied here
816 setDataLoader( nullptr ).ignore();
817 resetPreLoad().ignore();
818 clearStore().ignore();
819 if ( m_incidentSvc ) {
820 m_incidentSvc->release();
821 m_incidentSvc = nullptr;
822 }
823 // re-initialize the base class
824 sc = Service::reinitialize();
825 if ( UNLIKELY( !sc.isSuccess() ) ) {
826 error() << "Unable to reinitialize base class" << endmsg;
827 return sc;
828 }
829 // the initialize part is copied here
830 sc = service( "IncidentSvc", m_incidentSvc, true );
831 if ( UNLIKELY( !sc.isSuccess() ) ) {
832 error() << "Failed to access incident service." << endmsg;
833 return sc;
834 }
835 // return
836 return StatusCode::SUCCESS;
837 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
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:184
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:770
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:62
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:237
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:83
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:104
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ removePreLoadItem()

StatusCode TsDataSvc::removePreLoadItem | ( | const DataStoreItem & | item | ) |
| override

Remove an item from the preload list.

Definition at line 763 of file TsDataSvc.cpp.

763 {
764 auto i = std::remove( m_preLoads.begin(), m_preLoads.end(), item );
765 m_preLoads.erase( i, m_preLoads.end() );
766 return StatusCode::SUCCESS;
767 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::vector::end
T end(T... args)
std::remove
T remove(T... args)
std::vector::erase
T erase(T... args)
std::vector::begin
T begin(T... args)
TsDataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:78

## ◆ resetPreLoad()

StatusCode TsDataSvc::resetPreLoad | ( |  | ) |
| override

Clear the preload list.

Definition at line 770 of file TsDataSvc.cpp.

770 {
771 m_preLoads.clear();
772 return StatusCode::SUCCESS;
773 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::vector::clear
T clear(T... args)
TsDataSvc::m_preLoads
std::vector< DataStoreItem > m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:78

## ◆ retrieveEntry()

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

Retrieve registry entry from store.

Definition at line 535 of file TsDataSvc.cpp.

535 {
536 auto sep = find( path, SEPARATOR, 1 );
537 StatusCode status = StatusCode( Status::INVALID_ROOT, true );
538 pEntry = nullptr;
539 STD_LOCK_GUARD_MACRO
540 // A.Valassi 16.08.2001 avoid core dump if store is empty
541 if ( checkRoot() ) {
542 if ( !parentObj ) {
543 if ( path.empty() || path == m_rootName ) return retrieveEntry( m_root.get(), "", pEntry );
544 if ( path.front() != SEPARATOR ) return retrieveEntry( m_root.get(), path, pEntry );
545 if ( sep == std::string_view::npos ) return Status::INVALID_OBJ_PATH;
546 if ( !m_root->object() ) {
547 RegEntry* r = nullptr;
548 status = retrieveEntry( m_root.get(), "", r );
549 if ( !status.isSuccess() ) return status;
550 }
551 return retrieveEntry( m_root.get(), path.substr( sep ), pEntry );
552 }
553 if ( sep != std::string_view::npos ) { // the string contains a separator (after pos 0)
554 auto p_path = path.substr( 0, sep );
555 auto o_path = path.substr( sep );
556 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
557 status = loadObject( parentObj );
558 if ( !status.isSuccess() ) return status;
559 }
560 RegEntry* root_entry = parentObj->findLeaf( p_path );
561 if ( !root_entry && m_enableFaultHdlr ) {
562 // If not even the parent is there, an incident
563 // to load the parent must be fired...
564 handleDataFault( parentObj, p_path );
565 root_entry = parentObj->findLeaf( p_path );
566 }
567 if ( root_entry ) {
568 DataObject* pO = root_entry->object();
569 if ( !pO ) {
570 // Object is not loaded: load the object if at all possible
571 status = loadObject( root_entry );
572 if ( !status.isSuccess() ) return status;
573 }
574 if ( root_entry->isSoft() ) { root_entry = CAST_REGENTRY( RegEntry*, pO->registry() ); }
575 return retrieveEntry( root_entry, o_path, pEntry );
576 }
577 return status;
578 } else if ( path.empty() ) {
579 pEntry = parentObj;
580 } else {
581 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
582 status = loadObject( parentObj );
583 if ( !status.isSuccess() ) return status;
584 }
585 // last leave in search: find leaf and load
586 pEntry = parentObj->findLeaf( path );
587 // If no registry entry was found, trigger incident for action-on-demand
588 if ( !pEntry && m_enableFaultHdlr ) {
589 handleDataFault( parentObj, path );
590 pEntry = ( path.empty() ? parentObj : parentObj->findLeaf( path ) );
591 }
592 }
593 // Check results and return
594 if ( !pEntry ) {
595 status = Status::INVALID_OBJ_PATH;
596 } else if ( !pEntry->object() ) {
597 status = loadObject( pEntry );
598 } else if ( m_enableAccessHdlr ) {
599 // Fire data access incident
600 // I do not know if this is a good idea....
601 // This fires too often!
602 //
603 // DataIncident incident(name(), m_accessName, pEntry->identifier());
604 // m_incidentSvc->fireIncident(incident);
605 status = StatusCode::SUCCESS;
606 } else {
607 status = StatusCode::SUCCESS;
608 }
609 }
610 return status;
611 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, std::string_view path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:429
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:73
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:535
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
std::find
T find(T... args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
DataSvcHelpers::RegistryEntry::isSoft
bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:127
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:459
TsDataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: TsDataSvc.h:69
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ retrieveObject() [1/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

  pDirectory | Pointer to the object.
  path | String with relative path to directory. Ideally ""!
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

## ◆ retrieveObject() [2/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

  parentPath | Path to parent node of the object.
  objectPath | Path of the object relative to the parent.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 247 of file IDataProviderSvc.h.

247 {
248 DataObject* parent = nullptr;
249 StatusCode status = retrieveObject( parentPath, parent );
250 return status.isSuccess() ? retrieveObject( parent, objectPath, pObject ) : status;
251 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ retrieveObject() [3/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

  parentPath | Path to parent node of the object.
  item | Item identifier.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 263 of file IDataProviderSvc.h.

263 {
264 return retrieveObject( parentPath, itemToPath( item ), pObject );
265 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614

## ◆ retrieveObject() [4/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

  fullPath | Path name of the object.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 233 of file IDataProviderSvc.h.

233 {
234 return retrieveObject( static_cast<IRegistry*>( nullptr ), fullPath, pObject );
235 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614

## ◆ retrieveObject() [5/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

  parentObj | Pointer to parent node of the object.
  objectPath | Path of the object relative to the parent.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 277 of file IDataProviderSvc.h.

277 {
278 return retrieveObject( parentObj ? parentObj->registry() : nullptr, objectPath, pObject );
279 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614

## ◆ retrieveObject() [6/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

  parentObj | Pointer to parent node of the object.
  item | Item identifier.
  pObject | Reference to the pointer of the object to be returned.

Returns
  Status code indicating success or failure.

Definition at line 291 of file IDataProviderSvc.h.

291 {
292 return retrieveObject( parentObj, itemToPath( item ), pObject );
293 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:614

## ◆ retrieveObject() [7/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 614 of file TsDataSvc.cpp.

614 {
615 pObject = nullptr;
616 RegEntry * result = nullptr, *parent = CAST_REGENTRY( RegEntry*, pRegistry );
617 StatusCode status = retrieveEntry( parent, path, result );
618 if ( status.isSuccess() ) pObject = result->object();
619 return status;
620 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:535
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ rootCLID()

CLID TsDataSvc::rootCLID | ( |  | ) | const
| override

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 853 of file TsDataSvc.cpp.

853 { return ( (CLID)m_rootCLID ); }
TsDataSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: TsDataSvc.h:64
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8

## ◆ rootName()

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 856 of file TsDataSvc.cpp.

856 { return ( m_rootName ); }
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ 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 184 of file TsDataSvc.cpp.

184 {
185 if ( pDataLoader ) pDataLoader->addRef();
186 if ( m_dataLoader ) m_dataLoader->release();
187 if ( pDataLoader ) { pDataLoader->setDataProvider( dpsvc == nullptr ? this : dpsvc ).ignore(); }
188 m_dataLoader = pDataLoader;
189 return StatusCode::SUCCESS;
190 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:60
IInterface::release
virtual unsigned long release()=0
Release Interface instance.

## ◆ 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

Definition at line 139 of file TsDataSvc.cpp.

139 {
140 clearStore().ignore();
141 return i_setRoot( std::move( root_path ), pRootObj );
142 }
std::move
T move(T... args)
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
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:149
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:104

## ◆ 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 163 of file TsDataSvc.cpp.

163 {
164 clearStore().ignore();
165 return i_setRoot( std::move( root_path ), pRootAddr );
166 }
std::move
T move(T... args)
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
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:149
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:104

## ◆ traverseSubTree() [1/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 113 of file TsDataSvc.cpp.

113 {
114 DataObject* pO = nullptr;
115 StatusCode status = findObject( sub_tree_path, pO );
116 return status.isSuccess() ? traverseSubTree( pO, pAgent ) : status;
117 }
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:637
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
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:113
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ traverseSubTree() [2/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 120 of file TsDataSvc.cpp.

120 {
121 STD_LOCK_GUARD_MACRO
122 if ( !checkRoot() ) return Status::INVALID_ROOT;
123 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
124 if ( !entry ) return Status::INVALID_OBJECT;
125 return entry->traverseTree( pAgent );
126 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
DataSvcHelpers::RegistryEntry::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:271
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ 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 129 of file TsDataSvc.cpp.

129 {
130 STD_LOCK_GUARD_MACRO
131 if ( !checkRoot() ) return Status::INVALID_ROOT;
132 return m_root->traverseTree( pAgent );
133 }
DataSvcHelpers::RegistryEntry::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:271
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44

## ◆ unlinkObject() [1/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

  from | Pointer to data directory the link originates.
  objPath | Path of the entry to be linked relative to from.

Returns
  Status code indicating success or failure.

## ◆ 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

  fromObj | Pointer to the object the link originates.
  objPath | Path of the entry to be linked relative to from.

Returns
  Status code indicating success or failure.

## ◆ unlinkObject() [3/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

  fromPath | Path to the object the link originates.
  objPath | Path of the entry to be linked relative to from.

Returns
  Status code indicating success or failure.

Definition at line 522 of file IDataProviderSvc.h.

522 {
523 DataObject* pObject = nullptr;
524 StatusCode status = findObject( fromPath, pObject );
525 return status.isSuccess() ? unlinkObject( pObject->registry(), objPath ) : status;
526 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:637
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:722
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## ◆ 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

  fullPath | Full path of the entry to be linked.

Returns
  Status code indicating success or failure.

## ◆ unlinkObject() [5/7]

StatusCode TsDataSvc::unlinkObject | ( | IRegistry * | from,
|  | std::string_view | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 722 of file TsDataSvc.cpp.

722 {
723 STD_LOCK_GUARD_MACRO
724 if ( !checkRoot() ) return Status::INVALID_ROOT;
725 try {
726 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
727 if ( from_entry ) {
728 auto sep = objPath.rfind( SEPARATOR );
729 if ( sep > 0 && sep != std::string_view::npos ) { // in case the objPath is a sub-directory itself
730 DataObject* pO = nullptr;
731 StatusCode sc = findObject( from, objPath.substr( 0, sep ), pO );
732 return sc.isSuccess() ? unlinkObject( pO->registry(), objPath.substr( sep ) ) : sc;
733 }
734 StatusCode status = from_entry->remove( objPath );
735 return status.isSuccess() ? status : Status::INVALID_OBJ_PATH;
736 }
737 } catch ( ... ) {}
738 return Status::INVALID_PARENT;
739 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
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:637
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:722
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ unlinkObject() [6/7]

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

Remove a link to another object.

Definition at line 750 of file TsDataSvc.cpp.

750 {
751 if ( !checkRoot() ) return Status::INVALID_ROOT;
752 return unlinkObject( m_root->findLeaf( from ), objPath );
753 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:722
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263

## ◆ unlinkObject() [7/7]

StatusCode TsDataSvc::unlinkObject | ( | std::string_view | fullPath | ) |
| override

Remove a link to another object.

Definition at line 742 of file TsDataSvc.cpp.

742 {
743 if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
744 if ( fullPath.front() != SEPARATOR ) { return unlinkObject( m_root.get(), fullPath ); }
745 auto sep = fullPath.rfind( SEPARATOR );
746 return unlinkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ) );
747 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:722
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)

## ◆ unregisterAddress() [1/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.

## ◆ unregisterAddress() [2/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() [3/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 233 of file IDataManagerSvc.h.

233 {
234 return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
235 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:268

## ◆ unregisterAddress() [4/5]

StatusCode TsDataSvc::unregisterAddress | ( | std::string_view | fullPath | ) |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 268 of file TsDataSvc.cpp.

268 {
269 if ( fullPath.empty() ) return Status::INVALID_OBJ_PATH;
270 return unregisterAddress( fullPath.front() != SEPARATOR ? m_root.get() : nullptr, fullPath );
271 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:268
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)

## ◆ unregisterAddress() [5/5]

StatusCode TsDataSvc::unregisterAddress | ( | IRegistry * | pParent,
|  | std::string_view | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 274 of file TsDataSvc.cpp.

274 {
275 if ( !checkRoot() ) return Status::INVALID_ROOT;
276
277 if ( objPath.empty() ) return Status::INVALID_OBJ_PATH;
278 if ( !pParent ) {
279 if ( objPath.front() != SEPARATOR ) { return unregisterAddress( m_root.get(), objPath ); }
280 auto sep = find( objPath, SEPARATOR, 1 );
281 if ( sep == std::string_view::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
282 return Status::INVALID_PARENT;
283 }
284 return unregisterAddress( m_root.get(), objPath.substr( sep ) );
285 }
286 if ( objPath.front() != SEPARATOR ) { return unregisterAddress( pParent, SEPARATOR + objPath ); }
287 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
288 if ( node_entry ) {
289 RegEntry* leaf_entry = node_entry->findLeaf( objPath );
290 if ( leaf_entry ) {
291 auto sep = objPath.rfind( SEPARATOR );
292 if ( sep > 0 && sep != std::string_view::npos ) {
293 return unregisterAddress( leaf_entry->parent(), objPath.substr( sep ) );
294 }
295 StatusCode status = node_entry->remove( objPath );
296 if ( status.isSuccess() ) return status;
297 }
298 }
299 return Status::INVALID_PARENT;
300 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:268
DataSvcHelpers::RegistryEntry::parent
IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:125
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
std::unique_ptr::get
T get(T... args)
std::find
T find(T... args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:65

## ◆ unregisterObject() [1/3]

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

Unregister object from the data store.

Definition at line 383 of file TsDataSvc.cpp.

383 {
384 DataObject* pObject = nullptr;
385 StatusCode status = findObject( fullPath, pObject );
386 if ( status.isFailure() ) return status;
387 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
388 if ( !pEntry ) return Status::INVALID_ROOT;
389 if ( !pEntry->isEmpty() ) return Status::DIR_NOT_EMPTY;
390 RegEntry* pParent = pEntry->parentEntry();
391 if ( !pParent ) return Status::INVALID_PARENT;
392 if ( pObject ) pObject->addRef();
393 pParent->remove( pEntry );
394 return StatusCode::SUCCESS;
395 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:637
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::isEmpty
bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:133
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ unregisterObject() [2/3]

StatusCode TsDataSvc::unregisterObject | ( | DataObject * | pObject | ) |
| override

Unregister object from the data store.

Definition at line 398 of file TsDataSvc.cpp.

398 {
399 if ( !checkRoot() ) return Status::INVALID_ROOT;
400 RegEntry* entry = m_root->findLeaf( pObject );
401 if ( !entry ) return Status::INVALID_OBJECT;
402 RegEntry* parent = entry->parentEntry();
403 if ( !parent ) return Status::INVALID_PARENT;
404 if ( !entry->isEmpty() ) return Status::DIR_NOT_EMPTY;
405 if ( entry->object() ) entry->object()->addRef();
406 if ( parent ) parent->remove( entry );
407 return StatusCode::SUCCESS;
408 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::isEmpty
bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:133
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::m_root
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition: TsDataSvc.h:80
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
DataSvcHelpers::RegistryEntry::parentEntry
RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263

## ◆ unregisterObject() [3/3]

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

Unregister object from the data store.

Definition at line 411 of file TsDataSvc.cpp.

411 {
412 if ( !checkRoot() ) return Status::INVALID_ROOT;
413 try {
414 RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
415 if ( parent ) {
416 RegEntry* entry = parent->findLeaf( objectPath );
417 if ( !entry ) return Status::INVALID_OBJECT;
418 if ( !entry->isEmpty() ) return Status::DIR_NOT_EMPTY;
419 if ( entry->object() ) entry->object()->addRef();
420 parent->remove( entry );
421 return StatusCode::SUCCESS;
422 }
423 } catch ( ... ) {}
424 return Status::INVALID_PARENT;
425 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(std::string_view path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::isEmpty
bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:133
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:121
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:263
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

## ◆ updateObject() [1/2]

StatusCode TsDataSvc::updateObject | ( | IRegistry * | pDirectory | ) |
| override

Update object identified by its directory entry.

Update object.

Definition at line 649 of file TsDataSvc.cpp.

649 {
650 if ( !pRegistry ) return Status::INVALID_OBJ_ADDR; // Precondition: Addres must be valid
651 DataObject* toUpdate = pRegistry->object();
652 return toUpdate ? updateObject( toUpdate ) : loadObject( pRegistry );
653 }
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:649
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:459

## ◆ updateObject() [2/2]

StatusCode TsDataSvc::updateObject | ( | DataObject * | toUpdate | ) |
| override

Update object.

Definition at line 656 of file TsDataSvc.cpp.

656 {
657 StatusCode status = Status::INVALID_OBJ_ADDR;
658 if ( !toUpdate ) return Status::INVALID_OBJECT; // Precondition: Address must be valid
659 IRegistry* pRegistry = toUpdate->registry();
660 if ( !pRegistry ) return Status::INVALID_OBJECT; // Precondition: Need valid registry
661 IOpaqueAddress* pAddress = pRegistry->address();
662 if ( !pAddress ) return Status::INVALID_OBJ_ADDR; // Precondition: Need valid address
663 STD_LOCK_GUARD_MACRO
664 IConversionSvc* pLoader = getDataLoader( pRegistry );
665 if ( !pLoader ) return Status::NO_DATA_LOADER; // Precondition: Data loader must be present
666 if ( !m_inhibitPathes.empty() ) {
667 auto& ident = pRegistry->identifier();
668 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
669 if ( inhibit != m_inhibitPathes.end() ) return Status::NO_ACCESS;
670 }
671 try {
672 status = pLoader->updateObj( pAddress, toUpdate ); // Call data loader
673 if ( status.isSuccess() ) { status = pLoader->updateObjRefs( pAddress, toUpdate ); }
674 } catch ( const GaudiException& exc ) {
675 throw GaudiException( "GaudiException in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE, exc );
676 } catch ( const std::exception& x ) {
677 throw GaudiException( "std::exception in updateObject() " + pRegistry->name() + ": " +
678 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
679 name(), StatusCode::FAILURE );
680 } catch ( ... ) {
681 throw GaudiException( "UNKN exception in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE );
682 }
683 return status;
684 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IConversionSvc
Definition: IConversionSvc.h:37
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:864
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::find
T find(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:67
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:44

## Member Data Documentation

## ◆ m_accessMutex

tsDataSvcMutex TsDataSvc::m_accessMutex
| protected

Mutex to protect access to the store.

Definition at line 295 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 75 of file TsDataSvc.h.

## ◆ m_dataLoader

IConversionSvc* TsDataSvc::m_dataLoader = nullptr
| private

Pointer to data loader service.

Definition at line 60 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 73 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 69 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 71 of file TsDataSvc.h.

## ◆ m_forceLeaves

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

Definition at line 66 of file TsDataSvc.h.

## ◆ m_incidentSvc

IIncidentSvc* TsDataSvc::m_incidentSvc = nullptr
| private

Pointer to incident service.

Definition at line 62 of file TsDataSvc.h.

## ◆ m_inhibitPathes

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

Definition at line 67 of file TsDataSvc.h.

## ◆ m_preLoads

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

Items to be pre-loaded.

Definition at line 78 of file TsDataSvc.h.

## ◆ m_root

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

Pointer to root entry.

Definition at line 80 of file TsDataSvc.h.

## ◆ m_rootCLID

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

Definition at line 64 of file TsDataSvc.h.

## ◆ m_rootName

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

Definition at line 65 of file TsDataSvc.h.

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

- GaudiKernel/GaudiKernel/TsDataSvc.h
- GaudiKernel/src/Lib/TsDataSvc.cpp