| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | 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 Types
typedef std::vector< DataStoreItem > | LoadItems
| Define set of load items. More...
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
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## 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 (boost::string_ref fullPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (DataObject *parentObj, boost::string_ref objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (IRegistry *parentObj, boost::string_ref objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | unregisterAddress (boost::string_ref fullPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (DataObject *pParent, boost::string_ref objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (IRegistry *pParent, boost::string_ref 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 (boost::string_ref 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 (boost::string_ref sub_tree_path, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
StatusCode | traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
StatusCode | traverseTree (IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
StatusCode | setRoot (std::string root_name, DataObject *pRootObj) override
| Initialize data store for new event by giving new event path and root object. More...
virtual StatusCode | i_setRoot (std::string root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object. More...
StatusCode | setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
| Initialize data store for new event by giving new event path and address of root object. More...
virtual StatusCode | i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object. More...
StatusCode | setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
| IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider. More...
StatusCode | addPreLoadItem (const DataStoreItem &item) override
| Add an item to the preload list. More...
StatusCode | addPreLoadItem (std::string itemPath) override
| Add an item to the preload list. More...
StatusCode | removePreLoadItem (const DataStoreItem &item) override
| Remove an item from the preload list. More...
StatusCode | removePreLoadItem (std::string itemPath) override
| Add an item to 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 (boost::string_ref fullPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (boost::string_ref parentPath, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, boost::string_ref objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | unregisterObject (boost::string_ref fullPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (boost::string_ref parentPath, boost::string_ref objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (boost::string_ref parentPath, int item) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, boost::string_ref objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, int item) override
| Unregister object from the data store. More...
StatusCode | retrieveObject (IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (boost::string_ref fullPath, DataObject *&pObject) override
| Retrieve object identified by its full path from the data store. More...
StatusCode | retrieveObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (boost::string_ref parentPath, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, boost::string_ref objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | findObject (boost::string_ref fullPath, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (boost::string_ref parentPath, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, boost::string_ref objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | linkObject (IRegistry *from, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (boost::string_ref fromPath, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (DataObject *from, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (boost::string_ref fullPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | unlinkObject (IRegistry *from, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (boost::string_ref fromPath, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (DataObject *fromObj, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (boost::string_ref fullPath) override
| Remove a link to another object. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (boost::string_ref updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
StatusCode | updateObject (boost::string_ref parentPath, boost::string_ref updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *pParent, boost::string_ref updatePath) override
| Update object. More...
StatusCode | initialize () override
| Service initialization. More...
StatusCode | reinitialize () override
| Service initialization. More...
StatusCode | finalize () override
| Service initialization. More...
| ~TsDataSvc () override
| Standard Destructor. 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...
| ~extends () override=default
| Virtual destructor. 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
| ~PropertyHolder () override=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, TYPE &value, const std::string &doc="none") const
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
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
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...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected 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, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
| Retrieve registry entry from store. More...
DataObject * | handleDataFault (IRegistry *pReg, boost::string_ref 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 ()
| 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
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"}
LoadItems | m_preLoads
| Items to be pre-loaded. More...
DataSvcHelpers::RegistryEntry * | m_root = nullptr
| Pointer to root entry. More...
DataSvcHelpers::InhibitMap * | m_inhibitMap = nullptr
| Map with object paths to be inhibited from loading. More...
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, "[[deprecated]] unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Private Member Functions
| TsDataSvc (const TsDataSvc &)=delete
| Fake copy constructor (never implemented). More...
TsDataSvc & | operator= (const TsDataSvc &)=delete
| Fake assignment operator (never implemented). 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 58 of file TsDataSvc.h.

## Member Typedef Documentation

typedef std::vector<DataStoreItem> TsDataSvc::LoadItems

Define set of load items.

Definition at line 62 of file TsDataSvc.h.

## Constructor & Destructor Documentation

TsDataSvc::~TsDataSvc | ( |  | ) |
| override

Standard Destructor.

Definition at line 1155 of file TsDataSvc.cpp.

1156 {
1157 setDataLoader( nullptr ).ignore();
1158 resetPreLoad().ignore();
1159 clearStore().ignore();
1160 }
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:207
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1046
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:117
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84

TsDataSvc::TsDataSvc | ( | const TsDataSvc & |  | ) |
| private delete

Fake copy constructor (never implemented).

## Member Function Documentation

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

Add an item to the preload list.

Definition at line 1018 of file TsDataSvc.cpp.

1019 {
1020 auto i = std::find( m_preLoads.begin(), m_preLoads.end(), item );
1021 if ( i == m_preLoads.end() ) m_preLoads.push_back( item );
1022 return StatusCode::SUCCESS;
1023 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::vector::end
T end(T...args)
std::vector::push_back
T push_back(T...args)
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
std::find
T find(T...args)
std::vector::begin
T begin(T...args)

StatusCode TsDataSvc::addPreLoadItem | ( | std::string | itemPath | ) |
| override

Add an item to the preload list.

Definition at line 1026 of file TsDataSvc.cpp.

1027 {
1028 return addPreLoadItem( DataStoreItem( std::move( itemPath ), 1 ) );
1029 }
TsDataSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: TsDataSvc.cpp:1018
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::move
T move(T...args)

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

Check if root path is valid.

Definition at line 335 of file TsDataSvc.h.

335 { return 0 != m_root; }
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86

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

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 117 of file TsDataSvc.cpp.

118 {
119 if ( !checkRoot() ) return INVALID_ROOT;
120 m_root->release();
121 m_root = nullptr;
122 return SUCCESS;
123 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvcHelpers::RegistryEntry::release
unsigned long release() override
IInterface implementation: Reference the object.
Definition: RegistryEntry.cpp:68
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335

StatusCode TsDataSvc::clearSubTree | ( | boost::string_ref | sub_tree_path | ) |
| override

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

Definition at line 89 of file TsDataSvc.cpp.

90 {
91 DataObject* pObject = nullptr;
92 StatusCode status = findObject( sub_tree_path, pObject );
93 if ( !status.isSuccess() ) return status;
94 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
95 if ( !node_entry ) return INVALID_OBJECT;
96 RegEntry* parent = node_entry->parentEntry();
97 if ( !parent ) return INVALID_PARENT;
98 parent->remove( node_entry );
99 return StatusCode::SUCCESS;
100 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
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:76

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

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

Definition at line 105 of file TsDataSvc.cpp.

106 {
107 if ( !checkRoot() ) return INVALID_ROOT;
108 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
109 if ( !entry ) return INVALID_OBJECT;
110 RegEntry* parent = entry->parentEntry();
111 if ( !parent ) return INVALID_PARENT;
112 parent->remove( entry );
113 return SUCCESS;
114 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
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:335
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

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

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

Definition at line 1147 of file TsDataSvc.cpp.

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

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

Service initialization.

Service initialisation.

Definition at line 1127 of file TsDataSvc.cpp.

1128 {
1129 // Nothing to do: just call base class initialisation
1130 setDataLoader( nullptr ).ignore();
1131 resetPreLoad().ignore();
1132 clearStore().ignore();
1133 if ( m_incidentSvc ) {
1134 m_incidentSvc->release();
1135 m_incidentSvc = nullptr;
1136 }
1137 return Service::finalize();
1138 }
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
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:207
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1046
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:68
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:117
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84

StatusCode TsDataSvc::findObject | ( | boost::string_ref | fullPath,
|  | DataObject *& | pObject
| ) |  |
| override

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

Definition at line 793 of file TsDataSvc.cpp.

794 {
795 STD_LOCK_GUARD_MACRO
796 pObject = nullptr;
797 if ( !checkRoot() ) return INVALID_ROOT;
798 if ( path.empty() || path == m_rootName ) {
799 pObject = m_root->object();
800 return !pObject ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
801 }
802 if ( path.front() != SEPARATOR ) {
803 return findObject( m_rootName.value(), path, pObject );
804 }
805 return findObject( static_cast<IRegistry*>( nullptr ), path, pObject );
806 }
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::findObject | ( | IRegistry * | pDirectory,
|  | boost::string_ref | 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 778 of file TsDataSvc.cpp.

779 {
780 STD_LOCK_GUARD_MACRO
781 pObject = nullptr;
782 IRegistry* pReg = ( pRegistry ? pRegistry : m_root );
783 RegEntry* root_entry = CAST_REGENTRY( RegEntry*, pReg );
784 if ( root_entry ) {
785 if ( !path.empty() ) pReg = root_entry->find( path );
786 if ( !pReg ) return INVALID_OBJ_PATH;
787 pObject = pReg->object();
788 }
789 return pObject ? IDataProviderSvc_NO_ERROR : OBJ_NOT_LOADED;
790 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
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
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:140

StatusCode TsDataSvc::findObject | ( | boost::string_ref | parentPath,
|  | boost::string_ref | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 809 of file TsDataSvc.cpp.

810 {
811 DataObject* parent = nullptr;
812 StatusCode status = findObject( parentPath, parent );
813 return status.isSuccess() ? findObject( parent, objectPath, pObject ) : status;
814 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::findObject | ( | boost::string_ref | parentPath,
|  | int | item,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 817 of file TsDataSvc.cpp.

818 {
819 return findObject( parentPath, itemToPath( item ), pObject );
820 }
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793

StatusCode TsDataSvc::findObject | ( | DataObject * | parentObj,
|  | boost::string_ref | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 829 of file TsDataSvc.cpp.

830 {
831 return findObject( parentObj ? parentObj->registry() : nullptr, path, pObject );
832 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793

StatusCode TsDataSvc::findObject | ( | DataObject * | parentObj,
|  | int | item,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 823 of file TsDataSvc.cpp.

824 {
825 return findObject( parentObj, itemToPath( item ), pObject );
826 }
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793

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

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

Definition at line 1152 of file TsDataSvc.cpp.

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

DataObject * TsDataSvc::handleDataFault | ( | IRegistry * | pReg,
|  | boost::string_ref | 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 541 of file TsDataSvc.cpp.

542 {
543 if ( m_enableFaultHdlr ) {
544 IRegistry* pLeaf = nullptr;
545 if ( pReg && path.empty() ) {
546 DataIncident incident( name(), m_faultName, pReg->identifier() );
547 m_incidentSvc->fireIncident( incident );
548 return pReg->object();
549 } else if ( pReg ) {
550 std::string p = pReg->identifier();
551 if ( path.front() != SEPARATOR ) p += SEPARATOR;
552 p.append( path.data(), path.size() );
553 DataIncident incident( name(), m_faultName, p );
554 m_incidentSvc->fireIncident( incident );
555 pLeaf = m_root->findLeaf( p );
556 } else {
557 std::string p = m_root->identifier();
558 if ( path.front() != SEPARATOR ) p += SEPARATOR;
559 p.append( path.data(), path.size() );
560 DataIncident incident( name(), m_faultName, p );
561 m_incidentSvc->fireIncident( incident );
562 pLeaf = m_root->findLeaf( p );
563 }
564 if ( pLeaf ) return pLeaf->object();
565 }
566 return nullptr;
567 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
std::string
STL class.
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:68
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
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
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:118
DataIncident
Data service incident class.
TsDataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: TsDataSvc.h:75
TsDataSvc::m_faultName
Gaudi::Property< std::string > m_faultName
Definition: TsDataSvc.h:77

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

170 {
171 if ( pRootObj ) {
172 m_root = new RegEntry( std::move( root_path ) );
173 m_root->makeHard( pRootObj );
174 m_root->setDataSvc( this );
175 // No done with GaudiHive. preLoad().ignore();
176 }
177 return SUCCESS;
178 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: TsDataSvc.cpp:78
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
std::move
T move(T...args)
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:101

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

196 {
197 if ( pRootAddr ) {
198 m_root = new RegEntry( std::move( root_path ) );
199 m_root->makeHard( pRootAddr );
200 m_root->setDataSvc( this );
201 // Not done with GaudiHive. preLoad().ignore();
202 }
203 return SUCCESS;
204 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: TsDataSvc.cpp:78
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
std::move
T move(T...args)
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:101

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

Service initialization.

Definition at line 1086 of file TsDataSvc.cpp.

1087 {
1088 // Nothing to do: just call base class initialisation
1089 StatusCode sc = Service::initialize();
1090 if ( !sc.isSuccess() ) return sc;
1091 sc = service( "IncidentSvc", m_incidentSvc, true );
1092 if ( UNLIKELY( !sc.isSuccess() ) ) {
1093 error() << "Failed to access incident service." << endmsg;
1094 }
1095 return sc;
1096 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:68
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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&#39;t already exist.
Definition: Service.h:85
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

StatusCode TsDataSvc::linkObject | ( | IRegistry * | from,
|  | boost::string_ref | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 914 of file TsDataSvc.cpp.

915 {
916 STD_LOCK_GUARD_MACRO
917 if ( !checkRoot() ) return INVALID_ROOT;
918 try {
919 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
920 if ( from_entry ) {
921 // First check if both objects are already registered to the store
922 RegEntry* to_entry = m_root->findLeaf( to );
923 if ( !to_entry ) return INVALID_OBJECT;
924 auto sep = objPath.rfind( SEPARATOR );
925 if ( sep > 0 && sep != boost::string_ref::npos ) { // in case the objPath is a sub-directory itself
926 DataObject* pO = nullptr;
927 StatusCode sc = retrieveObject( from, objPath.substr( 0, sep ), pO );
928 return sc.isSuccess() ? linkObject( pO->registry(), objPath.substr( sep ), to ) : sc;
929 }
930 // Now register the soft link
931 StatusCode status = from_entry->add( to_string( objPath ), to, true );
932 return status.isSuccess() ? IDataProviderSvc_NO_ERROR : DOUBL_OBJ_PATH;
933 }
934 } catch ( ... ) {
935 }
936 return INVALID_PARENT;
937 }
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:914
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::add
virtual StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:208
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
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:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

StatusCode TsDataSvc::linkObject | ( | boost::string_ref | fromPath,
|  | boost::string_ref | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 950 of file TsDataSvc.cpp.

951 {
952 STD_LOCK_GUARD_MACRO
953 DataObject* pO = nullptr;
954 StatusCode status = retrieveObject( from, pO );
955 return status.isSuccess() ? linkObject( pO->registry(), objPath, to ) : status;
956 }
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:914
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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:46

StatusCode TsDataSvc::linkObject | ( | DataObject * | from,
|  | boost::string_ref | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 959 of file TsDataSvc.cpp.

960 {
961 STD_LOCK_GUARD_MACRO
962 if ( from ) {
963 IRegistry* from_entry = from->registry();
964 if ( from_entry ) return linkObject( from_entry, objPath, to );
965 }
966 return INVALID_PARENT;
967 }
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:914
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

StatusCode TsDataSvc::linkObject | ( | boost::string_ref | fullPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 940 of file TsDataSvc.cpp.

941 {
942 STD_LOCK_GUARD_MACRO
943 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
944 if ( fullPath.front() != SEPARATOR ) return linkObject( m_rootName.value(), fullPath, to );
945 auto sep = fullPath.rfind( SEPARATOR );
946 return linkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ), to );
947 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:914
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

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

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

Definition at line 572 of file TsDataSvc.cpp.

573 {
574 IConversionSvc* pLoader = getDataLoader( pRegistry );
575 return loadObject( pLoader, pRegistry );
576 }
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:1152
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:572

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

582 {
583 STD_LOCK_GUARD_MACRO
584 StatusCode status = INVALID_OBJ_ADDR;
585 DataObject* pObject = nullptr;
586 if ( !pLoader ) { // Precondition: Data loader must be present
587 if ( handleDataFault( pRegistry ) )
588 return SUCCESS;
589 else
590 return NO_DATA_LOADER;
591 }
592 if ( !pRegistry ) { // Precondition: Directory must be valid
593 if ( handleDataFault( pRegistry ) )
594 return SUCCESS;
595 else
596 return INVALID_OBJ_ADDR;
597 }
598
599 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
600
601 if ( m_enableAccessHdlr ) {
602 // Fire data access incident
603 DataIncident incident( name(), m_accessName, pRegistry->identifier() );
604 m_incidentSvc->fireIncident( incident );
605 }
606 if ( !m_inhibitPathes.empty() ) {
607 const auto& ident = pRegistry->identifier();
608 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
609 if ( inhibit != m_inhibitPathes.end() ) return NO_ACCESS;
610 }
611 IOpaqueAddress* pAddress = pRegistry->address();
612 if ( !pAddress ) { // Precondition:
613 return INVALID_OBJ_ADDR; // Address must be valid
614 }
615 try {
616 status = pLoader->createObj( pAddress, pObject ); // Call data loader
617 if ( status.isSuccess() ) {
618
619 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
620
621 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
622 pEntry->setObject( pObject );
623
624 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
625 status = pLoader->fillObjRefs( pAddress, pObject );
626 }
627 } catch ( const GaudiException& exc ) {
628 if ( handleDataFault( pRegistry ) ) return SUCCESS;
629 throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
630 exc );
631 } catch ( const std::exception& x ) {
632 if ( handleDataFault( pRegistry ) ) return SUCCESS;
633 throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
634 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
635 name(), StatusCode::FAILURE );
636 } catch ( ... ) {
637 if ( handleDataFault( pRegistry ) ) return SUCCESS;
638 throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
639 }
640 if ( !status.isSuccess() ) {
641 if ( handleDataFault( pRegistry ) ) return StatusCode::SUCCESS;
642 }
643 ON_VERBOSE if ( status.isSuccess() )
644 {
645 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
646 }
647 return status;
648 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
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:336
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
TsDataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: TsDataSvc.h:81
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:118
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:84
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:128
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:68
ON_VERBOSE
#define ON_VERBOSE
Definition: TsDataSvc.cpp:81
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:79
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
Definition: StatusCode.h:29
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:73
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, boost::string_ref path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:541
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:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

238 {
239 STD_LOCK_GUARD_MACRO
240 if ( !pObject ) return INVALID_OBJECT;
241 return objectLeaves( pObject->registry(), leaves );
242 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
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:237
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

248 {
249 STD_LOCK_GUARD_MACRO
250 if ( !checkRoot() ) return INVALID_ROOT;
251 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
252 if ( !node_entry ) return INVALID_OBJECT;
253 leaves.insert( leaves.end(), node_entry->leaves().begin(), node_entry->leaves().end() );
254 // leaves = node_entry->leaves();
255 return StatusCode::SUCCESS;
256 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::vector::end
T end(T...args)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:130
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::vector::begin
T begin(T...args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

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

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

Definition at line 219 of file TsDataSvc.cpp.

220 {
221 STD_LOCK_GUARD_MACRO
222 if ( !pObject ) return INVALID_OBJECT;
223 return objectParent( pObject->registry(), refpParent );
224 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
Definition: TsDataSvc.cpp:219

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

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

Definition at line 226 of file TsDataSvc.cpp.

227 {
228 STD_LOCK_GUARD_MACRO
229 if ( !checkRoot() ) return INVALID_ROOT;
230 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
231 if ( !node_entry ) return INVALID_OBJECT;
232 refpParent = node_entry->parent();
233 return StatusCode::SUCCESS;
234 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:126
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

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

Fake assignment operator (never implemented).

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

1054 {
1055 // unused: StatusCode sc = StatusCode::FAILURE;
1056 if ( pObject && depth++ < load_depth ) {
1057 RegEntry* dir = CAST_REGENTRY( RegEntry*, pObject->registry() );
1058 if ( dir ) {
1059 for ( const auto& i : *dir ) {
1060 DataObject* pObj = nullptr;
1061 StatusCode status = retrieveObject( pObject, i->name(), pObj );
1062 if ( status.isSuccess() && depth < load_depth ) {
1063 preLoad( depth, load_depth, pObj ).ignore();
1064 }
1065 }
1066 }
1067 }
1068 return StatusCode::SUCCESS;
1069 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1072
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:68
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
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:76

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

load all preload items of the list

Definition at line 1072 of file TsDataSvc.cpp.

1073 {
1074 DataObject* pObj = nullptr;
1075 for ( const auto& i : m_preLoads ) {
1076 StatusCode sc = retrieveObject( i.path(), pObj );
1077 int load_depth = i.depth();
1078 if ( sc.isSuccess() && load_depth > 1 ) {
1079 preLoad( 1, load_depth, pObj ).ignore();
1080 }
1081 }
1082 return StatusCode::SUCCESS;
1083 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1072
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::registerAddress | ( | boost::string_ref | fullPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 259 of file TsDataSvc.cpp.

260 {
261 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
262 if ( fullPath.front() != SEPARATOR ) {
263 return registerAddress( m_root, fullPath, pAddress );
264 }
265 IRegistry* pRegistry = nullptr;
266 return registerAddress( pRegistry, fullPath, pAddress );
267 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::registerAddress
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:259
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::registerAddress | ( | DataObject * | parentObj,
|  | boost::string_ref | objectPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 270 of file TsDataSvc.cpp.

271 {
272 IRegistry* pRegistry = ( parentObj ? parentObj->registry() : nullptr );
273 return registerAddress( pRegistry, objectPath, pAddress );
274 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::registerAddress
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:259
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::registerAddress | ( | IRegistry * | parentObj,
|  | boost::string_ref | objectPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 277 of file TsDataSvc.cpp.

278 {
279 if ( !checkRoot() ) return INVALID_ROOT;
280 if ( objPath.empty() ) return INVALID_OBJ_PATH;
281 if ( !parentObj ) {
282 if ( objPath.front() != SEPARATOR ) {
283 return registerAddress( m_root, objPath, pAddress );
284 }
285 auto sep = find( objPath, SEPARATOR, 1 );
286 if ( sep == boost::string_ref::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
287 return INVALID_PARENT;
288 }
289 return registerAddress( m_root, objPath.substr( sep ), pAddress );
290 }
291 if ( objPath.front() != SEPARATOR ) {
292 return registerAddress( parentObj, SEPARATOR + objPath, pAddress );
293 }
294 RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
295 if ( !par_entry ) return INVALID_PARENT;
296 auto sep = objPath.rfind( SEPARATOR );
297 if ( sep > 0 && sep != boost::string_ref::npos ) {
298 auto p_path = objPath.substr( 0, sep );
299 auto o_path = objPath.substr( sep );
300 RegEntry* p_entry = par_entry->findLeaf( p_path );
301 // Create default object leafs if the
302 // intermediate nodes are not present
303 if ( !p_entry && m_forceLeaves ) {
304 DataObject* pLeaf = createDefaultObject();
305 StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
306 if ( !sc.isSuccess() ) delete pLeaf;
307 p_entry = par_entry->findLeaf( p_path );
308 }
309 if ( !p_entry ) return INVALID_PARENT;
310 return registerAddress( p_entry, o_path, pAddress );
311 }
312 StatusCode status = par_entry->add( to_string( objPath ), pAddress );
313 return status.isSuccess() ? status : DOUBL_OBJ_PATH;
314 }
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::registerAddress
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:259
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::add
virtual StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:208
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1147
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:72
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:118
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:76
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::registerObject | ( | boost::string_ref | fullPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 369 of file TsDataSvc.cpp.

370 {
371 return registerObject( nullptr, fullPath, pObject );
372 }
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369

StatusCode TsDataSvc::registerObject | ( | boost::string_ref | parentPath,
|  | boost::string_ref | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 375 of file TsDataSvc.cpp.

376 {
377 DataObject* pO = nullptr;
378 StatusCode status = retrieveObject( parentPath, pO );
379 if ( !status.isSuccess() && m_forceLeaves ) {
380 pO = createDefaultObject();
381 status = registerObject( parentPath, pO );
382 if ( !status.isSuccess() ) pO->release();
383 }
384 return status.isSuccess() ? registerObject( pO, objPath, pObject ) : status;
385 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1147
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:72
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369

StatusCode TsDataSvc::registerObject | ( | boost::string_ref | parentPath,
|  | int | item,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 388 of file TsDataSvc.cpp.

389 {
390 return registerObject( parentPath, itemToPath( item ), pObject );
391 }
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369

StatusCode TsDataSvc::registerObject | ( | DataObject * | parentObj,
|  | boost::string_ref | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 400 of file TsDataSvc.cpp.

401 {
402 if ( !checkRoot() ) return INVALID_ROOT;
403 if ( !parentObj ) {
404 if ( !objPath.empty() ) {
405 if ( objPath.front() != SEPARATOR ) {
406 return registerObject( m_rootName.value(), objPath, pObject );
407 }
408 auto sep = find( objPath, SEPARATOR, 1 );
409 if ( sep != boost::string_ref::npos ) {
410 return registerObject( objPath.substr( 0, sep ), objPath.substr( sep ), pObject );
411 }
412 }
413 return INVALID_OBJ_PATH;
414 }
415 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, parentObj->registry() );
416 if ( node_entry ) {
417 StatusCode status = INVALID_PARENT;
418 auto sep = find( objPath, SEPARATOR, 1 );
419 if ( sep != boost::string_ref::npos ) {
420 auto p_path = objPath.substr( 0, sep );
421 auto o_path = objPath.substr( sep );
422 RegEntry* par_entry = node_entry->findLeaf( p_path );
423 // Create default object leafs if the
424 // intermediate nodes are not present
425 if ( !par_entry && m_forceLeaves ) {
426 DataObject* pLeaf = createDefaultObject();
427 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
428 if ( !sc.isSuccess() ) delete pLeaf;
429 par_entry = node_entry->findLeaf( p_path );
430 } else if ( par_entry && !par_entry->object() ) {
431 status = retrieveEntry( node_entry, p_path, par_entry );
432 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
433 DataObject* pLeaf = createDefaultObject();
434 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
435 if ( !sc.isSuccess() ) delete pLeaf;
436 par_entry = node_entry->findLeaf( p_path );
437 }
438 }
439 node_entry = par_entry;
440 if ( node_entry ) {
441 DataObject* obj = node_entry->object();
442 if ( obj ) status = registerObject( obj, o_path, pObject );
443 }
444 } else {
445 RegEntry* leaf = node_entry->findLeaf( objPath );
446 if ( !leaf ) {
447 status = node_entry->add( to_string( objPath ), pObject );
448 } else {
449 DataObject* obj = leaf->object();
450 if ( !obj ) {
451 if ( !pObject ) {
452 error() << "registerObject: trying to register null DataObject" << endmsg;
453 return StatusCode::FAILURE;
454 } else {
455 pObject->setRegistry( leaf );
456 }
457 leaf->setAddress( nullptr );
458 leaf->setObject( pObject );
459 status = StatusCode::SUCCESS;
460 } else {
461 status = DOUBL_OBJ_PATH;
462 }
463 }
464 }
465 return status;
466 }
467 return INVALID_PARENT;
468 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:71
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:117
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:128
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:124
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:651
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::add
virtual StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:208
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1147
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
TsDataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: TsDataSvc.h:72
StatusCode::FAILURE
Definition: StatusCode.h:29
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:76
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::registerObject | ( | DataObject * | parentObj,
|  | int | item,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 394 of file TsDataSvc.cpp.

395 {
396 return registerObject( parentObj, itemToPath( item ), pObject );
397 }
TsDataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:369

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

Service initialization.

Service reinitialization.

Definition at line 1099 of file TsDataSvc.cpp.

1100 {
1101 StatusCode sc;
1102 // the finalize part is copied here
1103 setDataLoader( nullptr ).ignore();
1104 resetPreLoad().ignore();
1105 clearStore().ignore();
1106 if ( m_incidentSvc ) {
1107 m_incidentSvc->release();
1108 m_incidentSvc = nullptr;
1109 }
1110 // re-initialize the base class
1111 sc = Service::reinitialize();
1112 if ( UNLIKELY( !sc.isSuccess() ) ) {
1113 error() << "Unable to reinitialize base class" << endmsg;
1114 return sc;
1115 }
1116 // the initialize part is copied here
1117 sc = service( "IncidentSvc", m_incidentSvc, true );
1118 if ( UNLIKELY( !sc.isSuccess() ) ) {
1119 error() << "Failed to access incident service." << endmsg;
1120 return sc;
1121 }
1122 // return
1123 return StatusCode::SUCCESS;
1124 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
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:207
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1046
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:68
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:250
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&#39;t already exist.
Definition: Service.h:85
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:117
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

Remove an item from the preload list.

Definition at line 1032 of file TsDataSvc.cpp.

1033 {
1034 auto i = std::remove( m_preLoads.begin(), m_preLoads.end(), item );
1035 m_preLoads.erase( i, m_preLoads.end() );
1036 return StatusCode::SUCCESS;
1037 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::vector::end
T end(T...args)
std::remove
T remove(T...args)
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
std::vector::erase
T erase(T...args)
std::vector::begin
T begin(T...args)

StatusCode TsDataSvc::removePreLoadItem | ( | std::string | itemPath | ) |
| override

Add an item to the preload list.

Definition at line 1040 of file TsDataSvc.cpp.

1041 {
1042 return removePreLoadItem( DataStoreItem( std::move( itemPath ), 1 ) );
1043 }
TsDataSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: TsDataSvc.cpp:1032
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::move
T move(T...args)

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

Clear the preload list.

Definition at line 1046 of file TsDataSvc.cpp.

1047 {
1048 m_preLoads.clear();
1049 return StatusCode::SUCCESS;
1050 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
std::vector::clear
T clear(T...args)

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

Retrieve registry entry from store.

Definition at line 651 of file TsDataSvc.cpp.

652 {
653 STD_LOCK_GUARD_MACRO
654 auto sep = find( path, SEPARATOR, 1 );
655 StatusCode status = StatusCode( INVALID_ROOT, true );
656 pEntry = nullptr;
657 // A.Valassi 16.08.2001 avoid core dump if store is empty
658 if ( checkRoot() ) {
659 if ( !parentObj ) {
660 if ( path.empty() || path == m_rootName ) return retrieveEntry( m_root, "", pEntry );
661 if ( path.front() != SEPARATOR ) return retrieveEntry( m_root, path, pEntry );
662 if ( sep == boost::string_ref::npos ) return INVALID_OBJ_PATH;
663 if ( !m_root->object() ) {
664 RegEntry* r = nullptr;
665 status = retrieveEntry( m_root, "", r );
666 if ( !status.isSuccess() ) return status;
667 }
668 return retrieveEntry( m_root, path.substr( sep ), pEntry );
669 }
670 if ( sep != boost::string_ref::npos ) { // the string contains a separator (after pos 0)
671 auto p_path = path.substr( 0, sep );
672 auto o_path = path.substr( sep );
673 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
674 status = loadObject( parentObj );
675 if ( !status.isSuccess() ) return status;
676 }
677 RegEntry* root_entry = parentObj->findLeaf( p_path );
678 if ( !root_entry && m_enableFaultHdlr ) {
679 // If not even the parent is there, an incident
680 // to load the parent must be fired...
681 handleDataFault( parentObj, p_path );
682 root_entry = parentObj->findLeaf( p_path );
683 }
684 if ( root_entry ) {
685 DataObject* pO = root_entry->object();
686 if ( !pO ) {
687 // Object is not loaded: load the object if at all possible
688 status = loadObject( root_entry );
689 if ( !status.isSuccess() ) return status;
690 }
691 if ( root_entry->isSoft() ) {
692 root_entry = CAST_REGENTRY( RegEntry*, pO->registry() );
693 }
694 return retrieveEntry( root_entry, o_path, pEntry );
695 }
696 return status;
697 } else if ( path.empty() ) {
698 pEntry = parentObj;
699 } else {
700 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
701 status = loadObject( parentObj );
702 if ( !status.isSuccess() ) return status;
703 }
704 // last leave in search: find leaf and load
705 pEntry = parentObj->findLeaf( path );
706 // If no registry entry was found, trigger incident for action-on-demand
707 if ( !pEntry && m_enableFaultHdlr ) {
708 handleDataFault( parentObj, path );
709 pEntry = ( path.empty() ? parentObj : parentObj->findLeaf( path ) );
710 }
711 }
712 // Check results and return
713 if ( !pEntry ) {
714 status = INVALID_OBJ_PATH;
715 } else if ( !pEntry->object() ) {
716 status = loadObject( pEntry );
717 } else if ( m_enableAccessHdlr ) {
718 // Fire data access incident
719 // I do not know if this is a good idea....
720 // This fires too often!
721 //
722 // DataIncident incident(name(), m_accessName, pEntry->identifier());
723 // m_incidentSvc->fireIncident(incident);
724 status = SUCCESS;
725 } else {
726 status = SUCCESS;
727 }
728 }
729 return status;
730 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::isSoft
virtual bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:128
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:79
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:651
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, boost::string_ref path={})
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:541
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:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:572
TsDataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: TsDataSvc.h:75
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::retrieveObject | ( | IRegistry * | pDirectory,
|  | boost::string_ref | path,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 733 of file TsDataSvc.cpp.

734 {
735 STD_LOCK_GUARD_MACRO
736 pObject = nullptr;
737 RegEntry *result = nullptr, *parent = CAST_REGENTRY( RegEntry *, pRegistry );
738 StatusCode status = retrieveEntry( parent, path, result );
739 if ( status.isSuccess() ) pObject = result->object();
740 return status;
741 }
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:651
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

StatusCode TsDataSvc::retrieveObject | ( | boost::string_ref | fullPath,
|  | DataObject *& | pObject
| ) |  |
| override

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

Definition at line 744 of file TsDataSvc.cpp.

745 {
746 IRegistry* nullDir = nullptr;
747 return retrieveObject( nullDir, fullPath, pObject );
748 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::retrieveObject | ( | boost::string_ref | parentPath,
|  | boost::string_ref | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

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

Definition at line 751 of file TsDataSvc.cpp.

752 {
753 DataObject* parent = nullptr;
754 StatusCode status = retrieveObject( parentPath, parent );
755 return status.isSuccess() ? retrieveObject( parent, objectPath, pObject ) : status;
756 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::retrieveObject | ( | boost::string_ref | parentPath,
|  | int | item,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

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

Definition at line 759 of file TsDataSvc.cpp.

760 {
761 return retrieveObject( parentPath, itemToPath( item ), pObject );
762 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733

StatusCode TsDataSvc::retrieveObject | ( | DataObject * | parentObj,
|  | boost::string_ref | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Definition at line 765 of file TsDataSvc.cpp.

766 {
767 IRegistry* pRegistry = ( parentObj ? parentObj->registry() : nullptr );
768 return retrieveObject( pRegistry, path, pObject );
769 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::retrieveObject | ( | DataObject * | parentObj,
|  | int | item,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Retrieve registry entry from store.

Definition at line 772 of file TsDataSvc.cpp.

773 {
774 return retrieveObject( parentObj, itemToPath( item ), pObject );
775 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733

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

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 1141 of file TsDataSvc.cpp.

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

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1144 of file TsDataSvc.cpp.

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

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

208 {
209 if ( pDataLoader ) pDataLoader->addRef();
210 if ( m_dataLoader ) m_dataLoader->release();
211 if ( pDataLoader ) {
212 pDataLoader->setDataProvider( dpsvc == nullptr ? this : dpsvc ).ignore();
213 }
214 m_dataLoader = pDataLoader;
215 return SUCCESS;
216 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:66
IInterface::release
virtual unsigned long release()=0
Release Interface instance.

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

159 {
160 clearStore().ignore();
161 return i_setRoot( std::move( root_path ), pRootObj );
162 }
std::move
T move(T...args)
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:169
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:117
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84

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

185 {
186 clearStore().ignore();
187 return i_setRoot( std::move( root_path ), pRootAddr );
188 }
std::move
T move(T...args)
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:169
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:117
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84

StatusCode TsDataSvc::traverseSubTree | ( | boost::string_ref | 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 128 of file TsDataSvc.cpp.

129 {
130 STD_LOCK_GUARD_MACRO
131 DataObject* pO = nullptr;
132 StatusCode status = findObject( sub_tree_path, pO );
133 return status.isSuccess() ? traverseSubTree( pO, pAgent ) : status;
134 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::traverseSubTree
StatusCode traverseSubTree(boost::string_ref 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:128
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:46

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

138 {
139 STD_LOCK_GUARD_MACRO
140 if ( !checkRoot() ) return INVALID_ROOT;
141 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
142 if ( !entry ) return INVALID_OBJECT;
143 return entry->traverseTree( pAgent );
144 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:298
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
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:335
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

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

148 {
149 STD_LOCK_GUARD_MACRO
150 if ( !checkRoot() ) return INVALID_ROOT;
151 return m_root->traverseTree( pAgent );
152 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:298
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

StatusCode TsDataSvc::unlinkObject | ( | IRegistry * | from,
|  | boost::string_ref | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 970 of file TsDataSvc.cpp.

971 {
972 STD_LOCK_GUARD_MACRO
973 if ( !checkRoot() ) return INVALID_ROOT;
974 try {
975 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
976 if ( from_entry ) {
977 auto sep = objPath.rfind( SEPARATOR );
978 if ( sep > 0 && sep != boost::string_ref::npos ) { // in case the objPath is a sub-directory itself
979 DataObject* pO = nullptr;
980 StatusCode sc = findObject( from, objPath.substr( 0, sep ), pO );
981 return sc.isSuccess() ? unlinkObject( pO->registry(), objPath.substr( sep ) ) : sc;
982 }
983 StatusCode status = from_entry->remove( objPath );
984 return status.isSuccess() ? status : INVALID_OBJ_PATH;
985 }
986 } catch ( ... ) {
987 }
988 return INVALID_PARENT;
989 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:970
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:335
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
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:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

StatusCode TsDataSvc::unlinkObject | ( | boost::string_ref | fromPath,
|  | boost::string_ref | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1003 of file TsDataSvc.cpp.

1004 {
1005 DataObject* pObject = nullptr;
1006 StatusCode status = findObject( from, pObject );
1007 return status.isSuccess() ? unlinkObject( pObject->registry(), objPath ) : status;
1008 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:970
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::unlinkObject | ( | DataObject * | fromObj,
|  | boost::string_ref | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1011 of file TsDataSvc.cpp.

1012 {
1013 if ( !checkRoot() ) return INVALID_ROOT;
1014 return unlinkObject( m_root->findLeaf( from ), objPath );
1015 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:970
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335

StatusCode TsDataSvc::unlinkObject | ( | boost::string_ref | fullPath | ) |
| override

Remove a link to another object.

Definition at line 992 of file TsDataSvc.cpp.

993 {
994 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
995 if ( fullPath.front() != SEPARATOR ) {
996 return unlinkObject( m_rootName.value(), fullPath );
997 }
998 auto sep = fullPath.rfind( SEPARATOR );
999 return unlinkObject( fullPath.substr( 0, sep ), fullPath.substr( sep ) );
1000 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:970
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::unregisterAddress | ( | boost::string_ref | fullPath | ) |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 317 of file TsDataSvc.cpp.

318 {
319 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
320 IRegistry* pRegistry = nullptr;
321 if ( fullPath.front() != SEPARATOR ) {
322 return unregisterAddress( m_root, fullPath );
323 }
324 return unregisterAddress( pRegistry, fullPath );
325 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:317
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::unregisterAddress | ( | DataObject * | pParent,
|  | boost::string_ref | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 328 of file TsDataSvc.cpp.

329 {
330 IRegistry* pRegistry = ( pParent ? pParent->registry() : nullptr );
331 return unregisterAddress( pRegistry, objPath );
332 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:317
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

StatusCode TsDataSvc::unregisterAddress | ( | IRegistry * | pParent,
|  | boost::string_ref | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 335 of file TsDataSvc.cpp.

336 {
337 if ( !checkRoot() ) return INVALID_ROOT;
338
339 if ( objPath.empty() ) return INVALID_OBJ_PATH;
340 if ( !pParent ) {
341 if ( objPath.front() != SEPARATOR ) {
342 return unregisterAddress( m_root, objPath );
343 }
344 auto sep = find( objPath, SEPARATOR, 1 );
345 if ( sep == boost::string_ref::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
346 return INVALID_PARENT;
347 }
348 return unregisterAddress( m_root, objPath.substr( sep ) );
349 }
350 if ( objPath.front() != SEPARATOR ) {
351 return unregisterAddress( pParent, SEPARATOR + objPath );
352 }
353 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
354 if ( node_entry ) {
355 RegEntry* leaf_entry = node_entry->findLeaf( objPath );
356 if ( leaf_entry ) {
357 auto sep = objPath.rfind( SEPARATOR );
358 if ( sep > 0 && sep != boost::string_ref::npos ) {
359 return unregisterAddress( leaf_entry->parent(), objPath.substr( sep ) );
360 }
361 StatusCode status = node_entry->remove( objPath );
362 if ( status.isSuccess() ) return status;
363 }
364 }
365 return INVALID_PARENT;
366 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:317
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:126
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::unregisterObject | ( | boost::string_ref | fullPath | ) |
| override

Unregister object from the data store.

Definition at line 471 of file TsDataSvc.cpp.

472 {
473 DataObject* pObject = nullptr;
474 StatusCode status = findObject( fullPath, pObject );
475 if ( status.isFailure() ) return status;
476 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
477 if ( !pEntry ) return INVALID_ROOT;
478 if ( !pEntry->isEmpty() ) return DIR_NOT_EMPTY;
479 RegEntry* pParent = pEntry->parentEntry();
480 if ( !pParent ) return INVALID_PARENT;
481 if ( pObject ) pObject->addRef();
482 pParent->remove( pEntry );
483 return StatusCode::SUCCESS;
484 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:59
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
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:76

StatusCode TsDataSvc::unregisterObject | ( | boost::string_ref | parentPath,
|  | boost::string_ref | objectPath
| ) |  |
| override

Unregister object from the data store.

Definition at line 487 of file TsDataSvc.cpp.

488 {
489 DataObject* pO = nullptr;
490 StatusCode status = findObject( parentPath, pO );
491 return status.isSuccess() ? unregisterObject( pO, objPath ) : status;
492 }
TsDataSvc::unregisterObject
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:471
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::unregisterObject | ( | boost::string_ref | parentPath,
|  | int | item
| ) |  |
| override

Unregister object from the data store.

Definition at line 495 of file TsDataSvc.cpp.

496 {
497 return unregisterObject( parentPath, itemToPath( item ) );
498 }
TsDataSvc::unregisterObject
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:471

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

Unregister object from the data store.

Definition at line 501 of file TsDataSvc.cpp.

502 {
503 if ( !checkRoot() ) return INVALID_ROOT;
504 RegEntry* entry = m_root->findLeaf( pObject );
505 if ( !entry ) return INVALID_OBJECT;
506 RegEntry* parent = entry->parentEntry();
507 if ( !parent ) return INVALID_PARENT;
508 if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
509 if ( entry->object() ) entry->object()->addRef();
510 if ( parent ) parent->remove( entry );
511 return SUCCESS;
512 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:59
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:86
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
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:335
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154

StatusCode TsDataSvc::unregisterObject | ( | DataObject * | pObject,
|  | boost::string_ref | objectPath
| ) |  |
| override

Unregister object from the data store.

Definition at line 515 of file TsDataSvc.cpp.

516 {
517 if ( !checkRoot() ) return INVALID_ROOT;
518 try {
519 RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
520 if ( parent ) {
521 RegEntry* entry = parent->findLeaf( objectPath );
522 if ( !entry ) return INVALID_OBJECT;
523 if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
524 if ( entry->object() ) entry->object()->addRef();
525 parent->remove( entry );
526 return SUCCESS;
527 }
528 } catch ( ... ) {
529 }
530 return INVALID_PARENT;
531 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:59
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
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:335
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:76

StatusCode TsDataSvc::unregisterObject | ( | DataObject * | pObject,
|  | int | item
| ) |  |
| override

Unregister object from the data store.

Definition at line 534 of file TsDataSvc.cpp.

535 {
536 return unregisterObject( pParentObj, itemToPath( item ) );
537 }
TsDataSvc::unregisterObject
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:471

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

Update object identified by its directory entry.

Update object.

Definition at line 843 of file TsDataSvc.cpp.

844 {
845 if ( !pRegistry ) { // Precondition:
846 return INVALID_OBJ_ADDR; // Addres must be valid
847 }
848 DataObject* toUpdate = pRegistry->object();
849 if ( !toUpdate ) { // Try first to load
850 return loadObject( pRegistry );
851 }
852 return updateObject( toUpdate );
853 }
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:843
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:572

StatusCode TsDataSvc::updateObject | ( | boost::string_ref | updatePath | ) |
| override

Update object.

Definition at line 835 of file TsDataSvc.cpp.

836 {
837 DataObject* pO = nullptr;
838 StatusCode status = findObject( updatePath, pO );
839 return status.isSuccess() ? updateObject( pO ) : retrieveObject( updatePath, pO );
840 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:843
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:733
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Update object.

Definition at line 856 of file TsDataSvc.cpp.

857 {
858 STD_LOCK_GUARD_MACRO
859 StatusCode status = INVALID_OBJ_ADDR;
860 if ( !toUpdate ) { // Precondition:
861 return INVALID_OBJECT; // Address must be valid
862 }
863 IRegistry* pRegistry = toUpdate->registry(); // Precondition:
864 if ( !pRegistry ) { // Need valid registry
865 return INVALID_OBJECT;
866 }
867 IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
868 if ( !pAddress ) { // Need valid address
869 return INVALID_OBJ_ADDR;
870 }
871 IConversionSvc* pLoader = getDataLoader( pRegistry );
872 if ( !pLoader ) { // Precondition:
873 return NO_DATA_LOADER; // Data loader must be present
874 }
875 if ( !m_inhibitPathes.empty() ) {
876 auto& ident = pRegistry->identifier();
877 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
878 if ( inhibit != m_inhibitPathes.end() ) return NO_ACCESS;
879 }
880 try {
881 status = pLoader->updateObj( pAddress, toUpdate ); // Call data loader
882 if ( status.isSuccess() ) {
883 status = pLoader->updateObjRefs( pAddress, toUpdate );
884 }
885 } catch ( const GaudiException& exc ) {
886 throw GaudiException( "GaudiException in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE, exc );
887 } catch ( const std::exception& x ) {
888 throw GaudiException( "std::exception in updateObject() " + pRegistry->name() + ": " +
889 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
890 name(), StatusCode::FAILURE );
891 } catch ( ... ) {
892 throw GaudiException( "UNKN exception in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE );
893 }
894 return status;
895 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
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:336
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:1152
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IConverter::updateObjRefs
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::exception
STL class.
std::find
T find(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
TsDataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: TsDataSvc.h:73
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

StatusCode TsDataSvc::updateObject | ( | boost::string_ref | parentPath,
|  | boost::string_ref | updatePath
| ) |  |
| override

Update object.

Definition at line 898 of file TsDataSvc.cpp.

899 {
900 DataObject* pParent = nullptr;
901 StatusCode status = findObject( parentPath, pParent );
902 return status.isSuccess() ? updateObject( pParent, updatePath ) : status;
903 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:843
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

StatusCode TsDataSvc::updateObject | ( | DataObject * | pParent,
|  | boost::string_ref | updatePath
| ) |  |
| override

Update object.

Definition at line 906 of file TsDataSvc.cpp.

907 {
908 DataObject* pObject = nullptr;
909 StatusCode status = findObject( parent, updatePath, pObject );
910 return status.isSuccess() ? updateObject( pObject ) : status;
911 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:843
TsDataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:793
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## Member Data Documentation

tsDataSvcMutex TsDataSvc::m_accessMutex
| protected

Mutex to protect access to the store.

Definition at line 367 of file TsDataSvc.h.

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

Definition at line 81 of file TsDataSvc.h.

IConversionSvc* TsDataSvc::m_dataLoader = nullptr
| protected

Pointer to data loader service.

Definition at line 66 of file TsDataSvc.h.

Gaudi::Property<bool> TsDataSvc::m_enableAccessHdlr
| protected

Initial value:
{this, "EnableAccessHandler", false,
"enable incidents on data access requests"}

Definition at line 79 of file TsDataSvc.h.

Gaudi::Property<bool> TsDataSvc::m_enableFaultHdlr
| protected

Initial value:
{this, "EnableFaultHandler", false,
"enable incidents on data creation requests"}

Definition at line 75 of file TsDataSvc.h.

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

Definition at line 77 of file TsDataSvc.h.

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

Definition at line 72 of file TsDataSvc.h.

IIncidentSvc* TsDataSvc::m_incidentSvc = nullptr
| protected

Pointer to incident service.

Definition at line 68 of file TsDataSvc.h.

DataSvcHelpers::InhibitMap* TsDataSvc::m_inhibitMap = nullptr
| protected

Map with object paths to be inhibited from loading.

Definition at line 88 of file TsDataSvc.h.

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

Definition at line 73 of file TsDataSvc.h.

LoadItems TsDataSvc::m_preLoads
| protected

Items to be pre-loaded.

Definition at line 84 of file TsDataSvc.h.

DataSvcHelpers::RegistryEntry* TsDataSvc::m_root = nullptr
| protected

Pointer to root entry.

Definition at line 86 of file TsDataSvc.h.

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

Definition at line 70 of file TsDataSvc.h.

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

Definition at line 71 of file TsDataSvc.h.

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

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