| The Gaudi Framework v29r1 (5cd95fa2)

- 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 (const std::string &fullPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | unregisterAddress (const std::string &fullPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (DataObject *pParent, const std::string &objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (IRegistry *pParent, const std::string &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 (const std::string &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 (const std::string &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 (const 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 (const 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 (const std::string &fullPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (const std::string &parentPath, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, const std::string &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 (const std::string &fullPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (const std::string &parentPath, const std::string &objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (const std::string &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, const std::string &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, const std::string &path, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (const std::string &fullPath, DataObject *&pObject) override
| Retrieve object identified by its full path from the data store. More...
StatusCode | retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (const std::string &parentPath, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, const std::string &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 (const std::string &fullPath, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (const std::string &parentPath, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, const std::string &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, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (DataObject *from, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (const std::string &fullPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | unlinkObject (IRegistry *from, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (const std::string &fromPath, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (DataObject *fromObj, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (const std::string &fullPath) override
| Remove a link to another object. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (const std::string &updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
StatusCode | updateObject (const std::string &parentPath, const std::string &updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *pParent, const std::string &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, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
| Retrieve registry entry from store. More...
DataObject * | handleDataFault (IRegistry *pReg, const std::string &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 1363 of file TsDataSvc.cpp.

1364 {
1365 setDataLoader( 0 ).ignore();
1366 resetPreLoad().ignore();
1367 clearStore().ignore();
1368 }
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:219
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1252
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:118
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109

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

1221 {
1222 LoadItems::iterator i = std::find( m_preLoads.begin(), m_preLoads.end(), item );
1223 if ( i == m_preLoads.end() ) {
1224 m_preLoads.push_back( item );
1225 }
1226 return StatusCode::SUCCESS;
1227 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
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 | ( | const std::string & | itemPath | ) |
| override

Add an item to the preload list.

Definition at line 1230 of file TsDataSvc.cpp.

1231 {
1232 return addPreLoadItem( DataStoreItem( itemPath, 1 ) );
1233 }
TsDataSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: TsDataSvc.cpp:1220
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

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

119 {
120 if ( checkRoot() ) {
121 m_root->release();
122 m_root = 0;
123 return SUCCESS;
124 }
125 return INVALID_ROOT;
126 }
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 | ( | const std::string & | sub_tree_path | ) |
| override

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

Definition at line 78 of file TsDataSvc.cpp.

79 {
80 DataObject* pObject = 0;
81 StatusCode status = findObject( sub_tree_path, pObject );
82 if ( status.isSuccess() ) {
83 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
84 if ( 0 != node_entry ) {
85 RegEntry* parent = node_entry->parentEntry();
86 if ( 0 != parent ) {
87 parent->remove( node_entry );
88 return StatusCode::SUCCESS;
89 }
90 return INVALID_PARENT;
91 }
92 return INVALID_OBJECT;
93 }
94 return status;
95 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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

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

Definition at line 100 of file TsDataSvc.cpp.

101 {
102 if ( checkRoot() ) {
103 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
104 if ( 0 != entry ) {
105 RegEntry* parent = entry->parentEntry();
106 if ( 0 != parent ) {
107 parent->remove( entry );
108 return SUCCESS;
109 }
110 return INVALID_PARENT;
111 }
112 return INVALID_OBJECT;
113 }
114 return INVALID_ROOT;
115 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

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

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

Definition at line 1355 of file TsDataSvc.cpp.

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

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

Service initialization.

Service initialisation.

Definition at line 1335 of file TsDataSvc.cpp.

1336 {
1337 // Nothing to do: just call base class initialisation
1338 setDataLoader( 0 ).ignore();
1339 resetPreLoad().ignore();
1340 clearStore().ignore();
1341 if ( m_incidentSvc ) {
1342 m_incidentSvc->release();
1343 m_incidentSvc = 0;
1344 }
1345 return Service::finalize();
1346 }
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:219
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1252
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:118
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109

StatusCode TsDataSvc::findObject | ( | const std::string & | fullPath,
|  | DataObject *& | pObject
| ) |  |
| override

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

Definition at line 938 of file TsDataSvc.cpp.

939 {
940 STD_LOCK_GUARD_MACRO
941 pObject = 0;
942 if ( checkRoot() ) {
943 if ( path.length() == 0 || path == m_rootName ) {
944 pObject = m_root->object();
945 return ( 0 == pObject ) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
946 } else if ( path[0] != SEPARATOR ) {
947 return findObject( m_rootName, path, pObject );
948 }
949 return findObject( (IRegistry*)0, path, pObject );
950 }
951 return INVALID_ROOT;
952 }
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::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
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::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::findObject | ( | IRegistry * | pDirectory,
|  | const std::string & | 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 919 of file TsDataSvc.cpp.

920 {
921 STD_LOCK_GUARD_MACRO
922 pObject = 0;
923 IRegistry* pReg = ( 0 == pRegistry ) ? m_root : pRegistry;
924 RegEntry* root_entry = CAST_REGENTRY( RegEntry*, pReg );
925 if ( 0 != root_entry ) {
926 if ( path.length() > 0 ) {
927 pReg = root_entry->find( path );
928 }
929 if ( 0 == pReg ) {
930 return INVALID_OBJ_PATH;
931 }
932 pObject = pReg->object();
933 }
934 return ( 0 == pObject ) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
935 }
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::string::length
T length(T...args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
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 | ( | const std::string & | parentPath,
|  | const std::string & | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 955 of file TsDataSvc.cpp.

956 {
957 DataObject* parent = 0;
958 StatusCode status = findObject( parentPath, parent );
959 if ( status.isSuccess() ) {
960 status = findObject( parent, objectPath, pObject );
961 }
962 return status;
963 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::findObject | ( | const std::string & | 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 966 of file TsDataSvc.cpp.

967 {
968 return findObject( parentPath, itemToPath( item ), pObject );
969 }
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::findObject | ( | DataObject * | parentObj,
|  | const std::string & | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 978 of file TsDataSvc.cpp.

979 {
980 IRegistry* pDir = ( 0 == parentObj ) ? 0 : parentObj->registry();
981 return findObject( pDir, path, pObject );
982 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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

973 {
974 return findObject( parentObj, itemToPath( item ), pObject );
975 }
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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

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

Definition at line 1360 of file TsDataSvc.cpp.

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

DataObject * TsDataSvc::handleDataFault | ( | IRegistry * | pReg,
|  | const std::string & | 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 651 of file TsDataSvc.cpp.

652 {
653 if ( m_enableFaultHdlr ) {
654 IRegistry* pLeaf = 0;
655 if ( pReg && path.length() == 0 ) {
656 DataIncident incident( name(), m_faultName, pReg->identifier() );
657 m_incidentSvc->fireIncident( incident );
658 return pReg->object();
659 } else if ( pReg ) {
660 std::string p = pReg->identifier();
661 if ( path[0] != SEPARATOR ) p += SEPARATOR;
662 p += path;
663 DataIncident incident( name(), m_faultName, p );
664 m_incidentSvc->fireIncident( incident );
665 pLeaf = m_root->findLeaf( p );
666 } else {
667 std::string p = m_root->identifier();
668 if ( path[0] != SEPARATOR ) p += SEPARATOR;
669 p += path;
670 DataIncident incident( name(), m_faultName, p );
671 m_incidentSvc->fireIncident( incident );
672 pLeaf = m_root->findLeaf( p );
673 }
674 if ( pLeaf ) {
675 return pLeaf->object();
676 }
677 }
678 return 0;
679 }
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
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.
std::string::length
T length(T...args)
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 181 of file TsDataSvc.cpp.

182 {
183 if ( 0 != pRootObj ) {
184 m_root = new RegEntry( root_path );
185 m_root->makeHard( pRootObj );
186 m_root->setDataSvc( this );
187 // No done with GaudiHive. preLoad().ignore();
188 }
189 return SUCCESS;
190 }
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:67
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
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 207 of file TsDataSvc.cpp.

208 {
209 if ( 0 != pRootAddr ) {
210 m_root = new RegEntry( std::move( root_path ) );
211 m_root->makeHard( pRootAddr );
212 m_root->setDataSvc( this );
213 // Not done with GaudiHive. preLoad().ignore();
214 }
215 return SUCCESS;
216 }
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:67
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 1292 of file TsDataSvc.cpp.

1293 {
1294 // Nothing to do: just call base class initialisation
1295 StatusCode sc = Service::initialize();
1296 if ( !sc.isSuccess() ) {
1297 return sc;
1298 }
1299 sc = service( "IncidentSvc", m_incidentSvc, true );
1300 if ( UNLIKELY( !sc.isSuccess() ) ) {
1301 error() << "Failed to access incident service." << endmsg;
1302 }
1303 return sc;
1304 }
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:75
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:28
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,
|  | const std::string & | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 1075 of file TsDataSvc.cpp.

1076 {
1077 STD_LOCK_GUARD_MACRO
1078 if ( checkRoot() ) {
1079 try {
1080 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
1081 if ( 0 != from_entry ) {
1082 // First check if both objects are already registered to the store
1083 RegEntry* to_entry = m_root->findLeaf( to );
1084 if ( 0 == to_entry ) {
1085 return INVALID_OBJECT;
1086 } else {
1087 std::string::size_type sep = objPath.rfind( SEPARATOR );
1088 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1089 DataObject* pO = 0;
1090 std::string fromPath( objPath, 0, sep );
1091 StatusCode sc = retrieveObject( from, fromPath, pO );
1092 if ( sc.isSuccess() ) {
1093 std::string toPath( objPath, sep, objPath.length() );
1094 sc = linkObject( pO->registry(), toPath, to );
1095 }
1096 return sc;
1097 }
1098 // Now register the soft link
1099 StatusCode status = from_entry->add( objPath, to, true );
1100 return status.isSuccess() ? IDataProviderSvc_NO_ERROR : DOUBL_OBJ_PATH;
1101 }
1102 }
1103 } catch ( ... ) {
1104 }
1105 return INVALID_PARENT;
1106 }
1107 return INVALID_ROOT;
1108 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
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:75
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:207
std::string::rfind
T rfind(T...args)
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
std::string
STL class.
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1075
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:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::length
T length(T...args)
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:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

StatusCode TsDataSvc::linkObject | ( | const std::string & | fromPath,
|  | const std::string & | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 1127 of file TsDataSvc.cpp.

1128 {
1129 STD_LOCK_GUARD_MACRO
1130 DataObject* pO = 0;
1131 StatusCode status = retrieveObject( from, pO );
1132 if ( status.isSuccess() ) {
1133 return linkObject( pO->registry(), objPath, to );
1134 }
1135 return status;
1136 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1075
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

StatusCode TsDataSvc::linkObject | ( | DataObject * | from,
|  | const std::string & | objPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 1139 of file TsDataSvc.cpp.

1140 {
1141 STD_LOCK_GUARD_MACRO
1142 if ( 0 != from ) {
1143 IRegistry* from_entry = from->registry();
1144 if ( 0 != from_entry ) {
1145 return linkObject( from_entry, objPath, to );
1146 }
1147 }
1148 return INVALID_PARENT;
1149 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1075
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 | ( | const std::string & | fullPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 1111 of file TsDataSvc.cpp.

1112 {
1113 STD_LOCK_GUARD_MACRO
1114 if ( fullPath.length() > 0 ) {
1115 if ( fullPath[0] != SEPARATOR ) {
1116 return linkObject( m_rootName, fullPath, to );
1117 }
1118 std::string::size_type sep = fullPath.rfind( SEPARATOR );
1119 std::string objPath( fullPath, sep, fullPath.length() );
1120 std::string fromPath( fullPath, 0, sep );
1121 return linkObject( fromPath, objPath, to );
1122 }
1123 return INVALID_OBJ_PATH;
1124 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
std::string::rfind
T rfind(T...args)
std::string
STL class.
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1075
std::string::length
T length(T...args)
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 684 of file TsDataSvc.cpp.

685 {
686 IConversionSvc* pLoader = getDataLoader( pRegistry );
687 return loadObject( pLoader, pRegistry );
688 }
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:1360
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:684

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

694 {
695 STD_LOCK_GUARD_MACRO
696 StatusCode status = INVALID_OBJ_ADDR;
697 DataObject* pObject = 0;
698 if ( 0 == pLoader ) { // Precondition: Data loader must be present
699 if ( handleDataFault( pRegistry ) != 0 )
700 return SUCCESS;
701 else
702 return NO_DATA_LOADER;
703 }
704 if ( 0 == pRegistry ) { // Precondition: Directory must be valid
705 if ( handleDataFault( pRegistry ) != 0 )
706 return SUCCESS;
707 else
708 return INVALID_OBJ_ADDR;
709 }
710
711 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
712
713 if ( m_enableAccessHdlr ) {
714 // Fire data access incident
715 DataIncident incident( name(), m_accessName, pRegistry->identifier() );
716 m_incidentSvc->fireIncident( incident );
717 }
718 if ( m_inhibitPathes.size() > 0 ) {
719 const std::string& ident = pRegistry->identifier();
720 std::vector<std::string>::iterator inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
721 if ( inhibit != m_inhibitPathes.end() ) {
722 return NO_ACCESS;
723 }
724 }
725 IOpaqueAddress* pAddress = pRegistry->address();
726 if ( 0 == pAddress ) { // Precondition:
727 return INVALID_OBJ_ADDR; // Address must be valid
728 }
729 try {
730 status = pLoader->createObj( pAddress, pObject ); // Call data loader
731 if ( status.isSuccess() ) {
732
733 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
734
735 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
736 pEntry->setObject( pObject );
737
738 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
739 status = pLoader->fillObjRefs( pAddress, pObject );
740 }
741 } catch ( const GaudiException& exc ) {
742 if ( handleDataFault( pRegistry ) != 0 ) {
743 return SUCCESS;
744 }
745 throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
746 exc );
747 } catch ( const std::exception& x ) {
748 if ( handleDataFault( pRegistry ) != 0 ) {
749 return SUCCESS;
750 }
751 throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
752 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
753 name(), StatusCode::FAILURE );
754 } catch ( ... ) {
755 if ( handleDataFault( pRegistry ) != 0 ) {
756 return SUCCESS;
757 }
758 throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
759 }
760 if ( !status.isSuccess() ) {
761 if ( handleDataFault( pRegistry ) != 0 ) {
762 return StatusCode::SUCCESS;
763 }
764 }
765 ON_VERBOSE if ( status.isSuccess() )
766 {
767 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
768 }
769 return status;
770 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
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.
StatusCode::FAILURE
Definition: StatusCode.h:31
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
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
std::string
STL class.
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:73
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:70
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:79
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:651
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.
std::vector
STL class.
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
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h: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 255 of file TsDataSvc.cpp.

256 {
257 STD_LOCK_GUARD_MACRO
258 if ( pObject ) {
259 return objectLeaves( pObject->registry(), leaves );
260 }
261 return INVALID_OBJECT;
262 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: TsDataSvc.cpp:255
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 267 of file TsDataSvc.cpp.

268 {
269 STD_LOCK_GUARD_MACRO
270 if ( checkRoot() ) {
271 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
272 if ( node_entry ) {
273 std::copy( node_entry->leaves().begin(), node_entry->leaves().end(), back_inserter( leaves ) );
274 // leaves = node_entry->leaves();
275 return StatusCode::SUCCESS;
276 }
277 return INVALID_OBJECT;
278 }
279 return INVALID_ROOT;
280 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::copy
T copy(T...args)
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)
std::back_inserter
T back_inserter(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:65

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

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

Definition at line 231 of file TsDataSvc.cpp.

232 {
233 STD_LOCK_GUARD_MACRO
234 if ( pObject ) {
235 return objectParent( pObject->registry(), refpParent );
236 }
237 return INVALID_OBJECT;
238 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:231

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

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

Definition at line 240 of file TsDataSvc.cpp.

241 {
242 STD_LOCK_GUARD_MACRO
243 if ( checkRoot() ) {
244 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
245 if ( node_entry ) {
246 refpParent = node_entry->parent();
247 return StatusCode::SUCCESS;
248 }
249 return INVALID_OBJECT;
250 }
251 return INVALID_ROOT;
252 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
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:65

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

1260 {
1261 // unused: StatusCode sc = StatusCode::FAILURE;
1262 if ( 0 != pObject && depth++ < load_depth ) {
1263 RegEntry* dir = CAST_REGENTRY( RegEntry*, pObject->registry() );
1264 if ( 0 != dir ) {
1265 for ( RegEntry::Iterator i = dir->begin(); i != dir->end(); i++ ) {
1266 DataObject* pObj = 0;
1267 StatusCode status = retrieveObject( pObject, ( *i )->name(), pObj );
1268 if ( status.isSuccess() && depth < load_depth ) {
1269 preLoad( depth, load_depth, pObj ).ignore();
1270 }
1271 }
1272 }
1273 }
1274 return StatusCode::SUCCESS;
1275 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1278
DataSvcHelpers::RegistryEntry::begin
virtual Iterator begin() const
Return starting point for container iteration.
Definition: RegistryEntry.h:136
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataSvcHelpers::RegistryEntry::Iterator
Store::const_iterator Iterator
Iterator definition.
Definition: RegistryEntry.h:47
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:109
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
DataSvcHelpers::RegistryEntry::end
virtual Iterator end() const
Return end elemtn if the container.
Definition: RegistryEntry.h:138

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

load all preload items of the list

Definition at line 1278 of file TsDataSvc.cpp.

1279 {
1280 DataObject* pObj = 0;
1281 for ( LoadItems::iterator i = m_preLoads.begin(); i != m_preLoads.end(); i++ ) {
1282 StatusCode sc = retrieveObject( ( *i ).path(), pObj );
1283 int load_depth = ( *i ).depth();
1284 if ( sc.isSuccess() && load_depth > 1 ) {
1285 preLoad( 1, load_depth, pObj ).ignore();
1286 }
1287 }
1288 return StatusCode::SUCCESS;
1289 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
std::vector::end
T end(T...args)
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1278
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
std::vector::begin
T begin(T...args)
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29

StatusCode TsDataSvc::registerAddress | ( | const std::string & | fullPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 283 of file TsDataSvc.cpp.

284 {
285 if ( fullPath.length() > 0 ) {
286 if ( fullPath[0] != SEPARATOR ) {
287 return registerAddress( m_root, fullPath, pAddress );
288 }
289 IRegistry* pRegistry = 0;
290 return registerAddress( pRegistry, fullPath, pAddress );
291 }
292 return INVALID_OBJ_PATH;
293 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
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
std::string::length
T length(T...args)
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:283

StatusCode TsDataSvc::registerAddress | ( | DataObject * | parentObj,
|  | const std::string & | objectPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 296 of file TsDataSvc.cpp.

297 {
298 IRegistry* pRegistry = ( 0 == parentObj ) ? 0 : parentObj->registry();
299 return registerAddress( pRegistry, objectPath, pAddress );
300 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:283

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

IDataManagerSvc: Register object address with the data store.

Definition at line 303 of file TsDataSvc.cpp.

304 {
305 if ( checkRoot() ) {
306 if ( objPath.length() > 0 ) {
307 if ( 0 == parentObj ) {
308 if ( objPath[0] != SEPARATOR ) {
309 return registerAddress( m_root, objPath, pAddress );
310 }
311 std::string::size_type sep = objPath.find( SEPARATOR, 1 );
312 if ( sep != std::string::npos ) {
313 std::string p_path( objPath, 0, sep );
314 if ( p_path == m_rootName ) {
315 std::string o_path( objPath, sep, objPath.length() );
316 return registerAddress( m_root, o_path, pAddress );
317 }
318 }
319 return INVALID_PARENT;
320 }
321 if ( objPath[0] != SEPARATOR ) {
322 std::string path;
323 path = SEPARATOR;
324 path += objPath;
325 return registerAddress( parentObj, path, pAddress );
326 }
327 RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
328 if ( 0 != par_entry ) {
329 std::string::size_type sep = objPath.rfind( SEPARATOR );
330 if ( sep > 0 && sep != std::string::npos ) {
331 std::string p_path( objPath, 0, sep );
332 std::string o_path( objPath, sep, objPath.length() );
333 RegEntry* p_entry = par_entry->findLeaf( p_path );
334 // Create default object leafs if the
335 // intermediate nodes are not present
336 if ( 0 == p_entry && m_forceLeaves ) {
337 DataObject* pLeaf = createDefaultObject();
338 StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
339 if ( !sc.isSuccess() ) {
340 delete pLeaf;
341 }
342 p_entry = par_entry->findLeaf( p_path );
343 }
344 if ( 0 != p_entry ) {
345 return registerAddress( p_entry, o_path, pAddress );
346 }
347 return INVALID_PARENT;
348 }
349 StatusCode status = par_entry->add( objPath, pAddress );
350 if ( status.isSuccess() ) {
351 return status;
352 }
353 return DOUBL_OBJ_PATH;
354 }
355 return INVALID_PARENT;
356 }
357 return INVALID_OBJ_PATH;
358 }
359 return INVALID_ROOT;
360 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
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:75
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:207
std::string
STL class.
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:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1355
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:283
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:29
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::registerObject | ( | const std::string & | fullPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 430 of file TsDataSvc.cpp.

431 {
432 return registerObject( 0, fullPath, pObject );
433 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430

StatusCode TsDataSvc::registerObject | ( | const std::string & | parentPath,
|  | const std::string & | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 436 of file TsDataSvc.cpp.

437 {
438 DataObject* pO = 0;
439 StatusCode status = retrieveObject( parentPath, pO );
440 if ( !status.isSuccess() && m_forceLeaves ) {
441 pO = createDefaultObject();
442 status = registerObject( parentPath, pO );
443 if ( !status.isSuccess() ) {
444 pO->release();
445 }
446 }
447 if ( status.isSuccess() ) {
448 status = registerObject( pO, objPath, pObject );
449 }
450 return status;
451 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
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:1355
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430
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:29

StatusCode TsDataSvc::registerObject | ( | const std::string & | parentPath,
|  | int | item,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 454 of file TsDataSvc.cpp.

455 {
456 return registerObject( parentPath, itemToPath( item ), pObject );
457 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430

StatusCode TsDataSvc::registerObject | ( | DataObject * | parentObj,
|  | const std::string & | objPath,
|  | DataObject * | pObject
| ) |  |
| override

Register object with the data store.

Definition at line 466 of file TsDataSvc.cpp.

467 {
468 if ( checkRoot() ) {
469 if ( 0 == parentObj ) {
470 if ( objPath.length() > 0 ) {
471 if ( objPath[0] == SEPARATOR ) {
472 std::string::size_type sep = objPath.find( SEPARATOR, 1 );
473 if ( sep != std::string::npos ) {
474 std::string p_path( objPath, 0, sep );
475 std::string o_path( objPath, sep, objPath.length() );
476 return registerObject( p_path, o_path, pObject );
477 }
478 } else {
479 return registerObject( m_rootName, objPath, pObject );
480 }
481 }
482 return INVALID_OBJ_PATH;
483 }
484 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, parentObj->registry() );
485 if ( 0 != node_entry ) {
486 StatusCode status = INVALID_PARENT;
487 std::string::size_type sep = objPath.find( SEPARATOR, 1 );
488 if ( sep != std::string::npos ) {
489 std::string p_path( objPath, 0, sep );
490 std::string o_path( objPath, sep, objPath.length() );
491 RegEntry* par_entry = node_entry->findLeaf( p_path );
492 // Create default object leafs if the
493 // intermediate nodes are not present
494 if ( 0 == par_entry && m_forceLeaves ) {
495 DataObject* pLeaf = createDefaultObject();
496 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
497 if ( !sc.isSuccess() ) {
498 delete pLeaf;
499 }
500 par_entry = node_entry->findLeaf( p_path );
501 } else if ( 0 != par_entry && par_entry->object() == 0 ) {
502 status = retrieveEntry( node_entry, p_path, par_entry );
503 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
504 DataObject* pLeaf = createDefaultObject();
505 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
506 if ( !sc.isSuccess() ) {
507 delete pLeaf;
508 }
509 par_entry = node_entry->findLeaf( p_path );
510 }
511 }
512 node_entry = par_entry;
513 if ( 0 != node_entry ) {
514 DataObject* obj = node_entry->object();
515 if ( 0 != obj ) {
516 status = registerObject( obj, o_path, pObject );
517 }
518 }
519 } else {
520 RegEntry* leaf = node_entry->findLeaf( objPath );
521 if ( 0 == leaf ) {
522 status = node_entry->add( objPath, pObject );
523 } else {
524 DataObject* obj = leaf->object();
525 if ( 0 == obj ) {
526 if ( 0 == pObject ) {
527 error() << "registerObject: trying to register null DataObject" << endmsg;
528 return StatusCode::FAILURE;
529 } else {
530 pObject->setRegistry( leaf );
531 }
532 leaf->setAddress( 0 );
533 leaf->setObject( pObject );
534 status = StatusCode::SUCCESS;
535 } else {
536 status = DOUBL_OBJ_PATH;
537 }
538 }
539 }
540 return status;
541 }
542 return INVALID_PARENT;
543 }
544 return INVALID_ROOT;
545 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
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::FAILURE
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:207
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:117
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
std::string
STL class.
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:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(T...args)
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1355
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430
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
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:773
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 460 of file TsDataSvc.cpp.

461 {
462 return registerObject( parentObj, itemToPath( item ), pObject );
463 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:430

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

Service initialization.

Service reinitialization.

Definition at line 1307 of file TsDataSvc.cpp.

1308 {
1309 StatusCode sc;
1310 // the finalize part is copied here
1311 setDataLoader( 0 ).ignore();
1312 resetPreLoad().ignore();
1313 clearStore().ignore();
1314 if ( m_incidentSvc ) {
1315 m_incidentSvc->release();
1316 m_incidentSvc = 0;
1317 }
1318 // re-initialize the base class
1319 sc = Service::reinitialize();
1320 if ( UNLIKELY( !sc.isSuccess() ) ) {
1321 error() << "Unable to reinitialize base class" << endmsg;
1322 return sc;
1323 }
1324 // the initialize part is copied here
1325 sc = service( "IncidentSvc", m_incidentSvc, true );
1326 if ( UNLIKELY( !sc.isSuccess() ) ) {
1327 error() << "Failed to access incident service." << endmsg;
1328 return sc;
1329 }
1330 // return
1331 return StatusCode::SUCCESS;
1332 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
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:219
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1252
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:28
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:118
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109
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 1236 of file TsDataSvc.cpp.

1237 {
1238 LoadItems::iterator i = std::remove( m_preLoads.begin(), m_preLoads.end(), item );
1239 if ( i != m_preLoads.end() ) {
1240 m_preLoads.erase( i, m_preLoads.end() );
1241 }
1242 return StatusCode::SUCCESS;
1243 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
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 | ( | const std::string & | itemPath | ) |
| override

Add an item to the preload list.

Definition at line 1246 of file TsDataSvc.cpp.

1247 {
1248 return removePreLoadItem( DataStoreItem( itemPath, 1 ) );
1249 }
TsDataSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: TsDataSvc.cpp:1236
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

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

Clear the preload list.

Definition at line 1252 of file TsDataSvc.cpp.

1253 {
1254 m_preLoads.erase( m_preLoads.begin(), m_preLoads.end() );
1255 return StatusCode::SUCCESS;
1256 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::vector::end
T end(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::retrieveEntry | ( | DataSvcHelpers::RegistryEntry * | pNode,
|  | const std::string & | path,
|  | DataSvcHelpers::RegistryEntry *& | pEntry
| ) |  |
| protected

Retrieve registry entry from store.

Definition at line 773 of file TsDataSvc.cpp.

774 {
775 STD_LOCK_GUARD_MACRO
776 std::string::size_type sep = path.find( SEPARATOR, 1 );
777 StatusCode status = StatusCode( INVALID_ROOT, true );
778 pEntry = 0;
779 // A.Valassi 16.08.2001 avoid core dump if store is empty
780 if ( checkRoot() ) {
781 if ( 0 == parentObj ) {
782 if ( path.length() == 0 || path == m_rootName ) {
783 return retrieveEntry( m_root, "", pEntry );
784 } else if ( path[0] != SEPARATOR ) {
785 return retrieveEntry( m_root, path, pEntry );
786 } else if ( sep != std::string::npos ) {
787 if ( m_root->object() == 0 ) {
788 RegEntry* r = 0;
789 status = retrieveEntry( m_root, "", r );
790 if ( !status.isSuccess() ) {
791 return status;
792 }
793 }
794 std::string o_path( path, sep, path.length() );
795 return retrieveEntry( m_root, o_path, pEntry );
796 }
797 return INVALID_OBJ_PATH;
798 }
799 if ( sep != std::string::npos ) { // the string contains a separator (after pos 0)
800 std::string p_path( path, 0, sep );
801 std::string o_path( path, sep, path.length() );
802 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
803 status = loadObject( parentObj );
804 if ( !status.isSuccess() ) {
805 return status;
806 }
807 }
808 RegEntry* root_entry = parentObj->findLeaf( p_path );
809 if ( !root_entry && m_enableFaultHdlr ) {
810 // If not even the parent is there, an incident
811 // to load the parent must be fired...
812 handleDataFault( parentObj, p_path );
813 root_entry = parentObj->findLeaf( p_path );
814 }
815 if ( root_entry ) {
816 DataObject* pO = root_entry->object();
817 if ( 0 == pO ) {
818 // Object is not loaded: load the object if at all possible
819 status = loadObject( root_entry );
820 if ( !status.isSuccess() ) {
821 return status;
822 }
823 }
824 if ( root_entry->isSoft() ) {
825 root_entry = CAST_REGENTRY( RegEntry*, pO->registry() );
826 }
827 return retrieveEntry( root_entry, o_path, pEntry );
828 }
829 return status;
830 } else if ( path.length() == 0 ) {
831 pEntry = parentObj;
832 } else {
833 if ( !parentObj->object() ) { // if the parent object has not been loaded yet, load it now
834 status = loadObject( parentObj );
835 if ( !status.isSuccess() ) {
836 return status;
837 }
838 }
839 // last leave in search: find leaf and load
840 pEntry = parentObj->findLeaf( path );
841 // If no registry entry was found, trigger incident for action-on-demand
842 if ( !pEntry && m_enableFaultHdlr ) {
843 handleDataFault( parentObj, path );
844 pEntry = ( 0 == path.length() ) ? parentObj : parentObj->findLeaf( path );
845 }
846 }
847 // Check results and return
848 if ( 0 == pEntry ) {
849 status = INVALID_OBJ_PATH;
850 } else if ( 0 == pEntry->object() ) {
851 status = loadObject( pEntry );
852 } else if ( m_enableAccessHdlr ) {
853 // Fire data access incident
854 // I do not know if this is a good idea....
855 // This fires too often!
856 //
857 // DataIncident incident(name(), m_accessName, pEntry->identifier());
858 // m_incidentSvc->fireIncident(incident);
859 status = SUCCESS;
860 } else {
861 status = SUCCESS;
862 }
863 }
864 return status;
865 }
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:75
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
std::string
STL class.
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:28
TsDataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: TsDataSvc.h:79
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:651
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(T...args)
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:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:684
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:773
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,
|  | const std::string & | path,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 868 of file TsDataSvc.cpp.

869 {
870 STD_LOCK_GUARD_MACRO
871 pObject = 0;
872 RegEntry *result = 0, *parent = CAST_REGENTRY( RegEntry *, pRegistry );
873 StatusCode status = retrieveEntry( parent, path, result );
874 if ( status.isSuccess() ) {
875 pObject = result->object();
876 }
877 return status;
878 }
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
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:65
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:773

StatusCode TsDataSvc::retrieveObject | ( | const std::string & | fullPath,
|  | DataObject *& | pObject
| ) |  |
| override

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

Definition at line 881 of file TsDataSvc.cpp.

882 {
883 IRegistry* nullDir = 0;
884 return retrieveObject( nullDir, fullPath, pObject );
885 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
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 | ( | const std::string & | parentPath,
|  | const std::string & | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

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

Definition at line 888 of file TsDataSvc.cpp.

890 {
891 DataObject* parent = 0;
892 StatusCode status = retrieveObject( parentPath, parent );
893 if ( status.isSuccess() ) {
894 status = retrieveObject( parent, objectPath, pObject );
895 }
896 return status;
897 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29

StatusCode TsDataSvc::retrieveObject | ( | const std::string & | 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 900 of file TsDataSvc.cpp.

901 {
902 return retrieveObject( parentPath, itemToPath( item ), pObject );
903 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868

StatusCode TsDataSvc::retrieveObject | ( | DataObject * | parentObj,
|  | const std::string & | objPath,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Definition at line 906 of file TsDataSvc.cpp.

907 {
908 IRegistry* pRegistry = ( 0 == parentObj ) ? 0 : parentObj->registry();
909 return retrieveObject( pRegistry, path, pObject );
910 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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 913 of file TsDataSvc.cpp.

914 {
915 return retrieveObject( parentObj, itemToPath( item ), pObject );
916 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868

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

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 1349 of file TsDataSvc.cpp.

1349 { 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 1352 of file TsDataSvc.cpp.

1352 { 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 219 of file TsDataSvc.cpp.

220 {
221 if ( 0 != pDataLoader ) pDataLoader->addRef();
222 if ( 0 != m_dataLoader ) m_dataLoader->release();
223 if ( 0 != pDataLoader ) {
224 pDataLoader->setDataProvider( dpsvc == nullptr ? this : dpsvc ).ignore();
225 }
226 m_dataLoader = pDataLoader;
227 return SUCCESS;
228 }
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 170 of file TsDataSvc.cpp.

171 {
172 clearStore().ignore();
173 return i_setRoot( std::move( root_path ), pRootObj );
174 }
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:181
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:118
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109

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

197 {
198 clearStore().ignore();
199 return i_setRoot( std::move( root_path ), pRootAddr );
200 }
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:181
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:118
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109

StatusCode TsDataSvc::traverseSubTree | ( | const std::string & | 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 131 of file TsDataSvc.cpp.

132 {
133 STD_LOCK_GUARD_MACRO
134 DataObject* pO = 0;
135 StatusCode status = findObject( sub_tree_path, pO );
136 if ( status.isSuccess() ) {
137 status = traverseSubTree( pO, pAgent );
138 }
139 return status;
140 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
TsDataSvc::traverseSubTree
StatusCode traverseSubTree(const std::string &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:131
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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

144 {
145 STD_LOCK_GUARD_MACRO
146 if ( checkRoot() ) {
147 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
148 if ( 0 != entry ) {
149 return entry->traverseTree( pAgent );
150 }
151 return INVALID_OBJECT;
152 }
153 return INVALID_ROOT;
154 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:300
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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:65

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

158 {
159 STD_LOCK_GUARD_MACRO
160 if ( checkRoot() ) {
161 return m_root->traverseTree( pAgent );
162 }
163 return INVALID_ROOT;
164 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:300
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,
|  | const std::string & | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1152 of file TsDataSvc.cpp.

1153 {
1154 STD_LOCK_GUARD_MACRO
1155 if ( checkRoot() ) {
1156 try {
1157 RegEntry* from_entry = CAST_REGENTRY( RegEntry*, from );
1158 if ( 0 != from_entry ) {
1159 std::string::size_type sep = objPath.rfind( SEPARATOR );
1160 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1161 DataObject* pO = 0;
1162 std::string fromPath( objPath, 0, sep );
1163 StatusCode sc = findObject( from, fromPath, pO );
1164 if ( sc.isSuccess() ) {
1165 std::string toPath( objPath, sep, objPath.length() );
1166 sc = unlinkObject( pO->registry(), toPath );
1167 }
1168 return sc;
1169 }
1170 StatusCode status = from_entry->remove( objPath );
1171 if ( status.isSuccess() ) {
1172 return status;
1173 }
1174 return INVALID_OBJ_PATH;
1175 }
1176 } catch ( ... ) {
1177 }
1178 return INVALID_PARENT;
1179 }
1180 return INVALID_ROOT;
1181 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1152
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
std::string::rfind
T rfind(T...args)
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::length
T length(T...args)
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:29
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::unlinkObject | ( | const std::string & | fromPath,
|  | const std::string & | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1199 of file TsDataSvc.cpp.

1200 {
1201 DataObject* pObject = 0;
1202 StatusCode status = findObject( from, pObject );
1203 if ( status.isSuccess() ) {
1204 status = unlinkObject( pObject->registry(), objPath );
1205 }
1206 return status;
1207 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1152
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::unlinkObject | ( | DataObject * | fromObj,
|  | const std::string & | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1210 of file TsDataSvc.cpp.

1211 {
1212 if ( checkRoot() ) {
1213 IRegistry* from_entry = m_root->findLeaf( from );
1214 return unlinkObject( from_entry, objPath );
1215 }
1216 return INVALID_ROOT;
1217 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1152
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
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335

StatusCode TsDataSvc::unlinkObject | ( | const std::string & | fullPath | ) |
| override

Remove a link to another object.

Definition at line 1184 of file TsDataSvc.cpp.

1185 {
1186 if ( fullPath.length() > 0 ) {
1187 if ( fullPath[0] != SEPARATOR ) {
1188 return unlinkObject( m_rootName, fullPath );
1189 }
1190 std::string::size_type sep = fullPath.rfind( SEPARATOR );
1191 std::string objPath( fullPath, sep, fullPath.length() );
1192 std::string fromPath( fullPath, 0, sep );
1193 return unlinkObject( fromPath, objPath );
1194 }
1195 return INVALID_OBJ_PATH;
1196 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1152
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
std::string::rfind
T rfind(T...args)
std::string
STL class.
std::string::length
T length(T...args)
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::unregisterAddress | ( | const std::string & | fullPath | ) |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 363 of file TsDataSvc.cpp.

364 {
365 if ( fullPath.length() > 0 ) {
366 IRegistry* pRegistry = 0;
367 if ( fullPath[0] != SEPARATOR ) {
368 return unregisterAddress( m_root, fullPath );
369 }
370 return unregisterAddress( pRegistry, fullPath );
371 }
372 return INVALID_OBJ_PATH;
373 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:363
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
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
std::string::length
T length(T...args)

StatusCode TsDataSvc::unregisterAddress | ( | DataObject * | pParent,
|  | const std::string & | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 376 of file TsDataSvc.cpp.

377 {
378 IRegistry* pRegistry = ( 0 == pParent ) ? 0 : pParent->registry();
379 return unregisterAddress( pRegistry, objPath );
380 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:363
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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,
|  | const std::string & | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 383 of file TsDataSvc.cpp.

384 {
385 if ( checkRoot() ) {
386 if ( objPath.length() > 0 ) {
387 if ( 0 == pParent ) {
388 if ( objPath[0] != SEPARATOR ) {
389 return unregisterAddress( m_root, objPath );
390 }
391 std::string::size_type sep = objPath.find( SEPARATOR, 1 );
392 if ( sep != std::string::npos ) {
393 std::string p_path( objPath, 0, sep );
394 if ( p_path == m_rootName ) {
395 std::string o_path( objPath, sep, objPath.length() );
396 return unregisterAddress( m_root, o_path );
397 }
398 }
399 return INVALID_PARENT;
400 }
401 if ( objPath[0] != SEPARATOR ) {
402 std::string path;
403 path = SEPARATOR;
404 path += objPath;
405 return unregisterAddress( pParent, path );
406 }
407 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
408 if ( 0 != node_entry ) {
409 RegEntry* leaf_entry = node_entry->findLeaf( objPath );
410 if ( 0 != leaf_entry ) {
411 std::string::size_type sep = objPath.rfind( SEPARATOR );
412 if ( sep > 0 && sep != std::string::npos ) {
413 std::string path = objPath.substr( sep );
414 return unregisterAddress( leaf_entry->parent(), path );
415 }
416 StatusCode status = node_entry->remove( objPath );
417 if ( status.isSuccess() ) {
418 return status;
419 }
420 }
421 }
422 return INVALID_PARENT;
423 }
424 return INVALID_OBJ_PATH;
425 }
426 return INVALID_ROOT;
427 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:363
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
std::string::rfind
T rfind(T...args)
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
std::string
STL class.
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:28
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(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
std::string::substr
T substr(T...args)
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: TsDataSvc.h:71

StatusCode TsDataSvc::unregisterObject | ( | const std::string & | fullPath | ) |
| override

Unregister object from the data store.

Definition at line 548 of file TsDataSvc.cpp.

549 {
550 DataObject* pObject = 0;
551 StatusCode status = findObject( fullPath, pObject );
552 if ( status.isSuccess() ) {
553 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
554 if ( 0 != pEntry ) {
555 if ( pEntry->isEmpty() ) {
556 RegEntry* pParent = pEntry->parentEntry();
557 if ( 0 != pParent ) {
558 if ( 0 != pObject ) {
559 pObject->addRef();
560 }
561 pParent->remove( pEntry );
562 return StatusCode::SUCCESS;
563 }
564 return INVALID_PARENT;
565 }
566 return DIR_NOT_EMPTY;
567 }
568 return INVALID_ROOT;
569 }
570 return status;
571 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
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
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::unregisterObject | ( | const std::string & | parentPath,
|  | const std::string & | objectPath
| ) |  |
| override

Unregister object from the data store.

Definition at line 574 of file TsDataSvc.cpp.

575 {
576 DataObject* pO = 0;
577 StatusCode status = findObject( parentPath, pO );
578 if ( status.isSuccess() ) {
579 status = unregisterObject( pO, objPath );
580 }
581 return status;
582 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:548
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::unregisterObject | ( | const std::string & | parentPath,
|  | int | item
| ) |  |
| override

Unregister object from the data store.

Definition at line 585 of file TsDataSvc.cpp.

586 {
587 return unregisterObject( parentPath, itemToPath( item ) );
588 }
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:548

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

Unregister object from the data store.

Definition at line 591 of file TsDataSvc.cpp.

592 {
593 if ( checkRoot() ) {
594 RegEntry* entry = m_root->findLeaf( pObject );
595 if ( 0 != entry ) {
596 RegEntry* parent = entry->parentEntry();
597 if ( 0 != parent ) {
598 if ( entry->isEmpty() ) {
599 if ( 0 != entry->object() ) {
600 entry->object()->addRef();
601 }
602 if ( 0 != parent ) {
603 parent->remove( entry );
604 }
605 return SUCCESS;
606 }
607 return INVALID_PARENT;
608 }
609 return DIR_NOT_EMPTY;
610 }
611 return INVALID_OBJECT;
612 }
613 return INVALID_ROOT;
614 }
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::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
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

StatusCode TsDataSvc::unregisterObject | ( | DataObject * | pObject,
|  | const std::string & | objectPath
| ) |  |
| override

Unregister object from the data store.

Definition at line 617 of file TsDataSvc.cpp.

618 {
619 if ( checkRoot() ) {
620 try {
621 RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
622 if ( 0 != parent ) {
623 RegEntry* entry = parent->findLeaf( objectPath );
624 if ( 0 != entry ) {
625 if ( entry->isEmpty() ) {
626 if ( 0 != entry->object() ) {
627 entry->object()->addRef();
628 }
629 parent->remove( entry );
630 return SUCCESS;
631 }
632 return DIR_NOT_EMPTY;
633 }
634 return INVALID_OBJECT;
635 }
636 } catch ( ... ) {
637 }
638 return INVALID_PARENT;
639 }
640 return INVALID_ROOT;
641 }
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::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
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
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:65

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

Unregister object from the data store.

Definition at line 644 of file TsDataSvc.cpp.

645 {
646 return unregisterObject( pParentObj, itemToPath( item ) );
647 }
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:548

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

Update object identified by its directory entry.

Update object.

Definition at line 996 of file TsDataSvc.cpp.

997 {
998 if ( 0 == pRegistry ) { // Precondition:
999 return INVALID_OBJ_ADDR; // Addres must be valid
1000 }
1001 DataObject* toUpdate = pRegistry->object();
1002 if ( 0 == toUpdate ) { // Try first to load
1003 return loadObject( pRegistry );
1004 }
1005 return updateObject( toUpdate );
1006 }
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:996
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:684

StatusCode TsDataSvc::updateObject | ( | const std::string & | updatePath | ) |
| override

Update object.

Definition at line 985 of file TsDataSvc.cpp.

986 {
987 DataObject* pO = 0;
988 StatusCode status = findObject( updatePath, pO );
989 if ( status.isSuccess() ) {
990 return updateObject( pO );
991 }
992 return retrieveObject( updatePath, pO );
993 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:868
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:996
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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

Update object.

Definition at line 1009 of file TsDataSvc.cpp.

1010 {
1011 STD_LOCK_GUARD_MACRO
1012 StatusCode status = INVALID_OBJ_ADDR;
1013 if ( 0 == toUpdate ) { // Precondition:
1014 return INVALID_OBJECT; // Address must be valid
1015 }
1016 IRegistry* pRegistry = toUpdate->registry(); // Precondition:
1017 if ( 0 == pRegistry ) { // Need valid registry
1018 return INVALID_OBJECT;
1019 }
1020 IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
1021 if ( 0 == pAddress ) { // Need valid address
1022 return INVALID_OBJ_ADDR;
1023 }
1024 IConversionSvc* pLoader = getDataLoader( pRegistry );
1025 if ( 0 == pLoader ) { // Precondition:
1026 return NO_DATA_LOADER; // Data loader must be present
1027 }
1028 if ( m_inhibitPathes.size() > 0 ) {
1029 const std::string& ident = pRegistry->identifier();
1030 std::vector<std::string>::iterator inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), ident );
1031 if ( inhibit != m_inhibitPathes.end() ) {
1032 return NO_ACCESS;
1033 }
1034 }
1035 try {
1036 status = pLoader->updateObj( pAddress, toUpdate ); // Call data loader
1037 if ( status.isSuccess() ) {
1038 status = pLoader->updateObjRefs( pAddress, toUpdate );
1039 }
1040 } catch ( const GaudiException& exc ) {
1041 throw GaudiException( "GaudiException in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE, exc );
1042 } catch ( const std::exception& x ) {
1043 throw GaudiException( "std::exception in updateObject() " + pRegistry->name() + ": " +
1044 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
1045 name(), StatusCode::FAILURE );
1046 } catch ( ... ) {
1047 throw GaudiException( "UNKN exception in updateObject() " + pRegistry->name(), name(), StatusCode::FAILURE );
1048 }
1049 return status;
1050 }
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
StatusCode::FAILURE
Definition: StatusCode.h:31
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:329
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:1360
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
std::string
STL class.
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:28
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)
std::vector
STL class.
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 | ( | const std::string & | parentPath,
|  | const std::string & | updatePath
| ) |  |
| override

Update object.

Definition at line 1053 of file TsDataSvc.cpp.

1054 {
1055 DataObject* pParent = 0;
1056 StatusCode status = findObject( parentPath, pParent );
1057 if ( status.isSuccess() ) {
1058 status = updateObject( pParent, updatePath );
1059 }
1060 return status;
1061 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:996
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

StatusCode TsDataSvc::updateObject | ( | DataObject * | pParent,
|  | const std::string & | updatePath
| ) |  |
| override

Update object.

Definition at line 1064 of file TsDataSvc.cpp.

1065 {
1066 DataObject* pObject = 0;
1067 StatusCode status = findObject( parent, updatePath, pObject );
1068 if ( status.isSuccess() ) {
1069 status = updateObject( pObject );
1070 }
1071 return status;
1072 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:996
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:938

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