| The Gaudi Framework v30r0 (c919700c)

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

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

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

Data service base class. More...

`#include <GaudiKernel/DataSvc.h>`

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

## Public Types
typedef std::vector< DataStoreItem > | LoadItems
| Define set of load items. More...
Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
CLID | rootCLID () const override
| IDataManagerSvc: Accessor for root event CLID. More...
const std::string & | rootName () const override
| IDataManagerSvc: Accessor for root event name. More...
StatusCode | registerAddress (boost::string_ref fullPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (DataObject *parentObj, boost::string_ref objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (IRegistry *parentObj, boost::string_ref objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | unregisterAddress (boost::string_ref fullPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (DataObject *pParent, boost::string_ref objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (IRegistry *pParent, boost::string_ref objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectParent (const DataObject *pObject, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | clearSubTree (boost::string_ref sub_tree_path) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
StatusCode | clearSubTree (DataObject *pObject) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
StatusCode | clearStore () override
| IDataManagerSvc: Remove all data objects in the data store. More...
StatusCode | traverseSubTree (boost::string_ref sub_tree_path, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
StatusCode | traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
StatusCode | traverseTree (IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
StatusCode | setRoot (std::string root_name, DataObject *pRootObj) override
| Initialize data store for new event by giving new event path and root object. More...
virtual StatusCode | i_setRoot (std::string root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object. More...
StatusCode | setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
| Initialize data store for new event by giving new event path and address of root object. More...
virtual StatusCode | i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object. More...
StatusCode | setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
| IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider. More...
StatusCode | addPreLoadItem (const DataStoreItem &item) override
| Add an item to the preload list. More...
StatusCode | addPreLoadItem (std::string itemPath) override
| Add an item to the preload list. More...
StatusCode | removePreLoadItem (const DataStoreItem &item) override
| Remove an item from the preload list. More...
StatusCode | removePreLoadItem (std::string itemPath) override
| Add an item to the preload list. More...
StatusCode | resetPreLoad () override
| Clear the preload list. More...
virtual StatusCode | preLoad (int depth, int load_depth, DataObject *pObject)
| Execute one level of preloading and recursively load until the final level is reached. More...
StatusCode | preLoad () override
| load all preload items of the list More...
StatusCode | registerObject (boost::string_ref fullPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (boost::string_ref parentPath, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, boost::string_ref objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | unregisterObject (boost::string_ref fullPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (boost::string_ref parentPath, boost::string_ref objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (boost::string_ref parentPath, int item) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, boost::string_ref objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, int item) override
| Unregister object from the data store. More...
StatusCode | retrieveObject (IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (boost::string_ref fullPath, DataObject *&pObject) override
| Retrieve object identified by its full path from the data store. More...
StatusCode | retrieveObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (boost::string_ref parentPath, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, boost::string_ref objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | findObject (boost::string_ref fullPath, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (boost::string_ref parentPath, boost::string_ref objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (boost::string_ref parentPath, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, boost::string_ref objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | linkObject (IRegistry *from, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (boost::string_ref fromPath, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (DataObject *from, boost::string_ref objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (boost::string_ref fullPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | unlinkObject (IRegistry *from, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (boost::string_ref fromPath, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (DataObject *fromObj, boost::string_ref objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (boost::string_ref fullPath) override
| Remove a link to another object. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (boost::string_ref updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
StatusCode | updateObject (boost::string_ref parentPath, boost::string_ref updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *pParent, boost::string_ref updatePath) override
| Update object. More...
StatusCode | initialize () override
| Service initialization. More...
StatusCode | reinitialize () override
| Service initialization. More...
StatusCode | finalize () override
| Service initialization. More...
| ~DataSvc () override
| Standard Destructor. More...
Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
bool | checkRoot ()
| Check if root path is valid. More...
virtual IConversionSvc * | getDataLoader (IRegistry *pReg)
| Retrieve customizable data loader according to registry entry to be retrieved. More...
virtual DataObject * | createDefaultObject () const
| Create default objects in case forced creation of leaves is requested. More...
virtual StatusCode | loadObject (IRegistry *pNode)
| Invoke Persistency service to create transient object from its persistent representation. More...
virtual StatusCode | loadObject (IConversionSvc *pLoader, IRegistry *pNode)
| Invoke Persistency service to create transient object from its persistent representation. More...
StatusCode | retrieveEntry (DataSvcHelpers::RegistryEntry *pNode, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
| Retrieve registry entry from store. More...
DataObject * | handleDataFault (IRegistry *pReg, boost::string_ref path="")
| Invoke data fault handling if enabled. More...
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging ()
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
SmartIF< IConversionSvc > | m_dataLoader = nullptr
| Pointer to data loader service. More...
SmartIF< 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...
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
| DataSvc (const DataSvc &)=delete
| Fake copy constructor (never implemented). More...
DataSvc & | operator= (const DataSvc &)=delete
| Fake assignment operator (never implemented). More...
StatusCode | i_retrieveEntry (DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
DataObject * | i_handleDataFault (IRegistry *pReg, boost::string_ref path=boost::string_ref{})

## Detailed Description

Data service base class.

A data service manages the transient data stores and implements the IDataProviderSvc and IDataManagerSvc interfaces.

Author
  Markus Frank
  Sebastien Ponce

Version
  1.0

Definition at line 44 of file DataSvc.h.

## Member Typedef Documentation

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

Define set of load items.

Definition at line 48 of file DataSvc.h.

## Constructor & Destructor Documentation

DataSvc::~DataSvc | ( |  | ) |
| override

Standard Destructor.

Definition at line 1148 of file DataSvc.cpp.

1149 {
1150 setDataLoader( nullptr ).ignore();
1151 resetPreLoad().ignore();
1152 clearStore().ignore();
1153 }
DataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: DataSvc.cpp:199
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1046
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:112

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

Fake copy constructor (never implemented).

## Member Function Documentation

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

Add an item to the preload list.

Definition at line 1019 of file DataSvc.cpp.

1020 {
1021 auto i = std::find( begin( m_preLoads ), end( m_preLoads ), item );
1022 if ( i == end( m_preLoads ) ) m_preLoads.push_back( item );
1023 return StatusCode::SUCCESS;
1024 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:70
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
std::vector::push_back
T push_back(T...args)
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
std::find
T find(T...args)

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

Add an item to the preload list.

Definition at line 1027 of file DataSvc.cpp.

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

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

Check if root path is valid.

Definition at line 321 of file DataSvc.h.

321 { return 0 != m_root; }
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72

StatusCode DataSvc::clearStore | ( |  | ) |
| override

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 112 of file DataSvc.cpp.

113 {
114 if ( !checkRoot() ) return INVALID_ROOT;
115 m_root->release();
116 m_root = nullptr;
117 return SUCCESS;
118 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvcHelpers::RegistryEntry::release
unsigned long release() override
IInterface implementation: Reference the object.
Definition: RegistryEntry.cpp:68
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72

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

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

Definition at line 84 of file DataSvc.cpp.

85 {
86 DataObject* pObject = nullptr;
87 StatusCode status = findObject( sub_tree_path, pObject );
88 if ( !status.isSuccess() ) return status;
89 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
90 if ( !node_entry ) return INVALID_OBJECT;
91 RegEntry* parent = node_entry->parentEntry();
92 if ( !parent ) return INVALID_PARENT;
93 parent->remove( node_entry );
94 return StatusCode::SUCCESS;
95 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:795

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

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

Definition at line 100 of file DataSvc.cpp.

101 {
102 if ( !checkRoot() ) return INVALID_ROOT;
103 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
104 if ( !entry ) return INVALID_OBJECT;
105 RegEntry* parent = entry->parentEntry();
106 if ( !parent ) return INVALID_PARENT;
107 parent->remove( entry );
108 return SUCCESS;
109 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154

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

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

Definition at line 1140 of file DataSvc.cpp.

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

StatusCode DataSvc::finalize | ( |  | ) |
| override

Service initialization.

Service initialisation.

Definition at line 1123 of file DataSvc.cpp.

1124 {
1125 // Nothing to do: just call base class initialisation
1126 setDataLoader( nullptr ).ignore();
1127 resetPreLoad().ignore();
1128 clearStore().ignore();
1129 m_incidentSvc.reset();
1130 return Service::finalize();
1131 }
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
DataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: DataSvc.cpp:199
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1046
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:112

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

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

Definition at line 795 of file DataSvc.cpp.

796 {
797 pObject = nullptr;
798 if ( !checkRoot() ) return INVALID_ROOT;
799 if ( path.empty() || path == m_rootName.value() ) {
800 pObject = m_root->object();
801 return !pObject ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
802 }
803 return ( path.front() != SEPARATOR ) ? findObject( m_rootName.value(), path, pObject )
804 : findObject( static_cast<IRegistry*>( nullptr ), path, pObject );
805 }
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
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:57
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
DataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:795

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

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

Retrieve object identified by its directory from the data store.

Definition at line 781 of file DataSvc.cpp.

782 {
783 pObject = nullptr;
784 IRegistry* pReg = ( pRegistry ? pRegistry : m_root );
785 RegEntry* root_entry = CAST_REGENTRY( RegEntry*, pReg );
786 if ( root_entry ) {
787 if ( !path.empty() ) pReg = root_entry->find( path );
788 if ( !pReg ) return INVALID_OBJ_PATH;
789 pObject = pReg->object();
790 }
791 return ( !pObject ) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
792 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
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
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:140

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

Find object in the data store.

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

Definition at line 808 of file DataSvc.cpp.

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

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

Find object in the data store.

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

Definition at line 816 of file DataSvc.cpp.

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

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

Find object in the data store.

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

Definition at line 828 of file DataSvc.cpp.

829 {
830 IRegistry* pDir = ( parentObj ? parentObj->registry() : nullptr );
831 return findObject( pDir, path, pObject );
832 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:795

StatusCode DataSvc::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 822 of file DataSvc.cpp.

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

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

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

Reimplemented in NTupleSvc.

Definition at line 1145 of file DataSvc.cpp.

1145 { return m_dataLoader.get(); }
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
DataSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:52

DataObject * DataSvc::handleDataFault | ( | IRegistry * | pReg,
|  | boost::string_ref | path = `""`
| ) |  |
| protected

Invoke data fault handling if enabled.

Parameters

  pReg | [IN] Pointer to missing registry entry
  path | [IN] Sub-path of requested object from pReg

Returns
  Object corresponding to the specified leaf

Definition at line 523 of file DataSvc.cpp.

524 {
525 return i_handleDataFault( pReg, path );
526 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataSvc::i_handleDataFault
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:528

DataObject * DataSvc::i_handleDataFault | ( | IRegistry * | pReg,
|  | boost::string_ref | path = `boost::string_ref{}`
| ) |  |
| private

Definition at line 528 of file DataSvc.cpp.

529 {
530 if ( m_enableFaultHdlr ) {
531 IRegistry* pLeaf = nullptr;
532 if ( pReg && path.empty() ) {
533 DataIncident incident( name(), m_faultName, pReg->identifier() );
534 m_incidentSvc->fireIncident( incident );
535 return pReg->object();
536 }
537 if ( pReg ) {
538 std::string p = pReg->identifier();
539 if ( path.front() != SEPARATOR ) p += SEPARATOR;
540 p.append( path.data(), path.size() );
541 DataIncident incident( name(), m_faultName, p );
542 m_incidentSvc->fireIncident( incident );
543 pLeaf = m_root->findLeaf( p );
544 } else {
545 std::string p = m_root->identifier();
546 if ( path.front() != SEPARATOR ) p += SEPARATOR;
547 p.append( path.data(), path.size() );
548 DataIncident incident( name(), m_faultName, p );
549 m_incidentSvc->fireIncident( incident );
550 pLeaf = m_root->findLeaf( p );
551 }
552 if ( pLeaf ) {
553 return pLeaf->object();
554 }
555 }
556 return nullptr;
557 }
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
DataSvc::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: DataSvc.h:61
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
std::string
STL class.
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
DataSvc::m_faultName
Gaudi::Property< std::string > m_faultName
Definition: DataSvc.h:63
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
std::string::append
T append(T...args)
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:118
DataIncident
Data service incident class.

StatusCode DataSvc::i_retrieveEntry | ( | DataSvcHelpers::RegistryEntry * | parentObj,
|  | boost::string_ref | path,
|  | DataSvcHelpers::RegistryEntry *& | pEntry
| ) |  |
| private

Definition at line 648 of file DataSvc.cpp.

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

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

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

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

Definition at line 161 of file DataSvc.cpp.

162 {
163 if ( pRootObj ) {
164 m_root = new RegEntry( std::move( root_path ) );
165 m_root->makeHard( pRootObj );
166 m_root->setDataSvc( this );
167 // No done with GaudiHive. preLoad().ignore();
168 }
169 return SUCCESS;
170 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
std::move
T move(T...args)
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:73
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:101

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

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

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

Definition at line 187 of file DataSvc.cpp.

188 {
189 if ( pRootAddr ) {
190 m_root = new RegEntry( std::move( root_path ) );
191 m_root->makeHard( pRootAddr );
192 m_root->setDataSvc( this );
193 // Not done with GaudiHive. preLoad().ignore();
194 }
195 return SUCCESS;
196 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
std::move
T move(T...args)
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:73
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:101

StatusCode DataSvc::initialize | ( |  | ) |
| override

Service initialization.

Definition at line 1086 of file DataSvc.cpp.

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

Add a link to another object.

Definition at line 914 of file DataSvc.cpp.

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

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

Add a link to another object.

Definition at line 950 of file DataSvc.cpp.

951 {
952 DataObject* pO = nullptr;
953 StatusCode status = retrieveObject( from, pO );
954 return status.isSuccess() ? linkObject( pO->registry(), objPath, to ) : status;
955 }
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:914
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:737
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Add a link to another object.

Definition at line 958 of file DataSvc.cpp.

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

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

Add a link to another object.

Definition at line 939 of file DataSvc.cpp.

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

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

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

Definition at line 562 of file DataSvc.cpp.

563 {
564 IConversionSvc* pLoader = getDataLoader( pRegistry );
565 return loadObject( pLoader, pRegistry );
566 }
IConversionSvc
Definition: IConversionSvc.h:37
DataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:562
DataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:1145

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

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

Definition at line 571 of file DataSvc.cpp.

572 {
573 StatusCode status = INVALID_OBJ_ADDR;
574 DataObject* pObject = nullptr;
575 if ( !pLoader ) { // Precondition: Data loader must be present
576 return handleDataFault( pRegistry ) ? StatusCode{SUCCESS} : NO_DATA_LOADER;
577 }
578 if ( !pRegistry ) { // Precondition: Directory must be valid
579 return handleDataFault( pRegistry ) ? StatusCode{SUCCESS} : INVALID_OBJ_ADDR;
580 }
581
582 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
583
584 if ( m_enableAccessHdlr ) {
585 // Fire data access incident
586 DataIncident incident( name(), m_accessName, pRegistry->identifier() );
587 m_incidentSvc->fireIncident( incident );
588 }
589 if ( !m_inhibitPathes.empty() ) {
590 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(), pRegistry->identifier() );
591 if ( inhibit != m_inhibitPathes.end() ) {
592 return NO_ACCESS;
593 }
594 }
595 IOpaqueAddress* pAddress = pRegistry->address();
596 if ( !pAddress ) { // Precondition:
597 return INVALID_OBJ_ADDR; // Address must be valid
598 }
599 try {
600 status = pLoader->createObj( pAddress, pObject ); // Call data loader
601 if ( status.isSuccess() ) {
602
603 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
604
605 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pRegistry );
606 pEntry->setObject( pObject );
607
608 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
609 status = pLoader->fillObjRefs( pAddress, pObject );
610 }
611 } catch ( const GaudiException& exc ) {
612 if ( handleDataFault( pRegistry ) ) {
613 return SUCCESS;
614 }
615 throw GaudiException( "GaudiException in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE,
616 exc );
617 } catch ( const std::exception& x ) {
618 if ( handleDataFault( pRegistry ) ) {
619 return SUCCESS;
620 }
621 throw GaudiException( "std::exception in loadObject() " + pRegistry->identifier() + ": " +
622 System::typeinfoName( typeid( x ) ) + ", " + x.what(),
623 name(), StatusCode::FAILURE );
624 } catch ( ... ) {
625 if ( handleDataFault( pRegistry ) ) {
626 return SUCCESS;
627 }
628 throw GaudiException( "UNKN exception in loadObject() " + pRegistry->identifier(), name(), StatusCode::FAILURE );
629 }
630 if ( !status.isSuccess() ) {
631 if ( handleDataFault( pRegistry ) ) {
632 return StatusCode::SUCCESS;
633 }
634 }
635 ON_VERBOSE if ( status.isSuccess() )
636 {
637 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
638 }
639 return status;
640 }
VERMSG
#define VERMSG
Definition: DataSvc.cpp:79
StatusCode::SUCCESS
Definition: StatusCode.h:29
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
IConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
DataSvc::m_accessName
Gaudi::Property< std::string > m_accessName
Definition: DataSvc.h:67
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:118
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
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
std::exception
STL class.
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvc::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: DataSvc.h:59
std::find
T find(T...args)
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
DataSvc::m_enableAccessHdlr
Gaudi::Property< bool > m_enableAccessHdlr
Definition: DataSvc.h:65
StatusCode::FAILURE
Definition: StatusCode.h:29
DataIncident
Data service incident class.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ON_VERBOSE
#define ON_VERBOSE
Definition: DataSvc.cpp:76
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
DataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, boost::string_ref path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:523

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

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

IDataManagerSvc: Explore an object identified by its pointer.

Definition at line 223 of file DataSvc.cpp.

224 {
225 if ( !pObject ) return INVALID_OBJECT;
226 return objectLeaves( pObject->registry(), leaves );
227 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvc::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: DataSvc.cpp:223

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

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

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

Definition at line 232 of file DataSvc.cpp.

233 {
234 if ( !checkRoot() ) return INVALID_ROOT;
235 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
236 if ( !node_entry ) return INVALID_OBJECT;
237 leaves = node_entry->leaves();
238 return StatusCode::SUCCESS;
239 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:130
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36

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

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

Definition at line 207 of file DataSvc.cpp.

208 {
209 if ( !pObject ) return INVALID_OBJECT;
210 return objectParent( pObject->registry(), refpParent );
211 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
Definition: DataSvc.cpp:207

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

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

Definition at line 213 of file DataSvc.cpp.

214 {
215 if ( !checkRoot() ) return INVALID_ROOT;
216 const RegEntry* node_entry = CAST_REGENTRY( const RegEntry*, pRegistry );
217 if ( !node_entry ) return INVALID_OBJECT;
218 refpParent = node_entry->parent();
219 return StatusCode::SUCCESS;
220 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
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

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

Fake assignment operator (never implemented).

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

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

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

Parameters

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

Returns
  Status code indicating success or failure.

Definition at line 1053 of file DataSvc.cpp.

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

StatusCode DataSvc::preLoad | ( |  | ) |
| override

load all preload items of the list

Definition at line 1072 of file DataSvc.cpp.

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

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

IDataManagerSvc: Register object address with the data store.

Definition at line 242 of file DataSvc.cpp.

243 {
244 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
245 return registerAddress( fullPath.front() != SEPARATOR ? m_root : nullptr, fullPath, pAddress );
246 }
DataSvc::registerAddress
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:242
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72

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

IDataManagerSvc: Register object address with the data store.

Definition at line 249 of file DataSvc.cpp.

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

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

IDataManagerSvc: Register object address with the data store.

Definition at line 256 of file DataSvc.cpp.

257 {
258 if ( !checkRoot() ) return INVALID_ROOT;
259 if ( objPath.empty() ) return INVALID_OBJ_PATH;
260
261 if ( !parentObj ) {
262 if ( objPath.front() != SEPARATOR ) {
263 return registerAddress( m_root, objPath, pAddress );
264 }
265 auto sep = find( objPath, SEPARATOR, 1 );
266 if ( sep == boost::string_ref::npos || objPath.substr( 0, sep ) != m_rootName.value() ) {
267 return INVALID_PARENT;
268 }
269 return registerAddress( m_root, objPath.substr( sep ), pAddress );
270 }
271 if ( objPath.front() != SEPARATOR ) {
272 return registerAddress( parentObj, char( SEPARATOR ) + objPath, pAddress );
273 }
274 RegEntry* par_entry = CAST_REGENTRY( RegEntry*, parentObj );
275 if ( !par_entry ) return INVALID_PARENT;
276
277 auto sep = objPath.rfind( SEPARATOR );
278 if ( sep > 0 && sep != boost::string_ref::npos ) {
279 auto p_path = objPath.substr( 0, sep );
280 auto o_path = objPath.substr( sep );
281 RegEntry* p_entry = par_entry->findLeaf( p_path );
282 // Create default object leafs if the
283 // intermediate nodes are not present
284 if ( !p_entry && m_forceLeaves ) {
285 DataObject* pLeaf = createDefaultObject();
286 StatusCode sc = registerObject( par_entry->identifier(), p_path, pLeaf );
287 if ( sc.isFailure() ) delete pLeaf;
288 p_entry = par_entry->findLeaf( p_path );
289 }
290 if ( !p_entry ) return INVALID_PARENT;
291 return registerAddress( p_entry, o_path, pAddress );
292 }
293 StatusCode status = par_entry->add( to_string( objPath ), pAddress );
294 return status.isSuccess() ? status : DOUBL_OBJ_PATH;
295 }
DataSvc::registerAddress
StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:242
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:57
DataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: DataSvc.h:58
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::add
virtual StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:208
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:118
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1140

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

Register object with the data store.

Definition at line 343 of file DataSvc.cpp.

344 {
345 return registerObject( nullptr, fullPath, pObject );
346 }
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343

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

Register object with the data store.

Definition at line 349 of file DataSvc.cpp.

350 {
351 DataObject* pO = nullptr;
352 StatusCode status = retrieveObject( parentPath, pO );
353 if ( !status.isSuccess() && m_forceLeaves ) {
354 pO = createDefaultObject();
355 status = registerObject( parentPath, pO );
356 if ( !status.isSuccess() ) pO->release();
357 }
358 return status.isSuccess() ? registerObject( pO, objPath, pObject ) : status;
359 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: DataSvc.h:58
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:51
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:737
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1140

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

Register object with the data store.

Definition at line 362 of file DataSvc.cpp.

363 {
364 return registerObject( parentPath, itemToPath( item ), pObject );
365 }
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343

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

Register object with the data store.

Definition at line 374 of file DataSvc.cpp.

375 {
376 if ( !checkRoot() ) return INVALID_ROOT;
377
378 if ( !parentObj ) {
379 if ( !objPath.empty() ) {
380 if ( objPath.front() != SEPARATOR ) {
381 return registerObject( m_rootName.value(), objPath, pObject );
382 }
383 auto sep = find( objPath, SEPARATOR, 1 );
384 if ( sep != boost::string_ref::npos ) {
385 return registerObject( objPath.substr( 0, sep ), objPath.substr( sep ), pObject );
386 }
387 }
388 return INVALID_OBJ_PATH;
389 }
390 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, parentObj->registry() );
391 if ( node_entry ) {
392 StatusCode status = INVALID_PARENT;
393 auto sep = find( objPath, SEPARATOR, 1 );
394 if ( sep != boost::string_ref::npos ) {
395 auto p_path = objPath.substr( 0, sep );
396 auto o_path = objPath.substr( sep );
397 RegEntry* par_entry = node_entry->findLeaf( p_path );
398 // Create default object leafs if the
399 // intermediate nodes are not present
400 if ( !par_entry && m_forceLeaves ) {
401 DataObject* pLeaf = createDefaultObject();
402 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
403 if ( !sc.isSuccess() ) delete pLeaf;
404 par_entry = node_entry->findLeaf( p_path );
405 } else if ( par_entry && !par_entry->object() ) {
406 status = i_retrieveEntry( node_entry, p_path, par_entry );
407 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
408 DataObject* pLeaf = createDefaultObject();
409 StatusCode sc = registerObject( parentObj, p_path, pLeaf );
410 if ( !sc.isSuccess() ) delete pLeaf;
411 par_entry = node_entry->findLeaf( p_path );
412 }
413 }
414 node_entry = par_entry;
415 if ( node_entry ) {
416 DataObject* obj = node_entry->object();
417 if ( obj ) status = registerObject( obj, o_path, pObject );
418 }
419 } else {
420 RegEntry* leaf = node_entry->findLeaf( objPath );
421 if ( !leaf ) {
422 status = node_entry->add( to_string( objPath ), pObject );
423 } else {
424 DataObject* obj = leaf->object();
425 if ( !obj ) {
426 if ( !pObject ) {
427 error() << "registerObject: trying to register null DataObject" << endmsg;
428 return StatusCode::FAILURE;
429 }
430 pObject->setRegistry( leaf );
431 leaf->setAddress( nullptr );
432 leaf->setObject( pObject );
433 status = StatusCode::SUCCESS;
434 } else {
435 status = DOUBL_OBJ_PATH;
436 }
437 }
438 }
439 return status;
440 }
441 return INVALID_PARENT;
442 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
to_string
string to_string(const T &value)
Definition: mergesort.cpp:37
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:57
DataSvc::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: DataSvc.h:58
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:71
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:117
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:128
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:648
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:124
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::add
virtual StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:208
StatusCode::FAILURE
Definition: StatusCode.h:29
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1140
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

Register object with the data store.

Definition at line 368 of file DataSvc.cpp.

369 {
370 return registerObject( parentObj, itemToPath( item ), pObject );
371 }
DataSvc::registerObject
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:343

StatusCode DataSvc::reinitialize | ( |  | ) |
| override

Service initialization.

Service reinitialization.

Definition at line 1099 of file DataSvc.cpp.

1100 {
1101 // the finalize part is copied here
1102 setDataLoader( nullptr ).ignore();
1103 resetPreLoad().ignore();
1104 clearStore().ignore();
1105 m_incidentSvc.reset();
1106 // re-initialize the base class
1107 StatusCode sc = Service::reinitialize();
1108 if ( UNLIKELY( !sc.isSuccess() ) ) {
1109 error() << "Unable to reinitialize base class" << endmsg;
1110 return sc;
1111 }
1112 // the initialize part is copied here
1113 m_incidentSvc = service( "IncidentSvc", true );
1114 if ( UNLIKELY( !m_incidentSvc ) ) {
1115 error() << "Failed to access incident service." << endmsg;
1116 return StatusCode::FAILURE;
1117 }
1118 // return
1119 return StatusCode::SUCCESS;
1120 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: DataSvc.cpp:199
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:250
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
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1046
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:112

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

Remove an item from the preload list.

Definition at line 1033 of file DataSvc.cpp.

1034 {
1035 m_preLoads.erase( std::remove( begin( m_preLoads ), end( m_preLoads ), item ), end( m_preLoads ) );
1036 return StatusCode::SUCCESS;
1037 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:70
std::remove
T remove(T...args)
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
std::vector::erase
T erase(T...args)
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64

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

Add an item to the preload list.

Definition at line 1040 of file DataSvc.cpp.

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

StatusCode DataSvc::resetPreLoad | ( |  | ) |
| override

Clear the preload list.

Definition at line 1046 of file DataSvc.cpp.

1047 {
1048 m_preLoads.erase( begin( m_preLoads ), end( m_preLoads ) );
1049 return StatusCode::SUCCESS;
1050 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:70
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
std::vector::erase
T erase(T...args)
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64

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

Retrieve registry entry from store.

Definition at line 643 of file DataSvc.cpp.

644 {
645 return i_retrieveEntry( parentObj, path, pEntry );
646 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:648

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

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 737 of file DataSvc.cpp.

738 {
739 pObject = nullptr;
740 RegEntry *result = nullptr, *parent = CAST_REGENTRY( RegEntry *, pRegistry );
741 StatusCode status = i_retrieveEntry( parent, path, result );
742 if ( status.isSuccess() ) pObject = result->object();
743 return status;
744 }
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:648
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36

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

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

Definition at line 747 of file DataSvc.cpp.

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

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

Retrieve object from data store.

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

Definition at line 754 of file DataSvc.cpp.

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

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

Retrieve object from data store.

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

Definition at line 762 of file DataSvc.cpp.

763 {
764 return retrieveObject( parentPath, itemToPath( item ), pObject );
765 }
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:737

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

Retrieve object from data store.

Definition at line 768 of file DataSvc.cpp.

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

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

Retrieve object from data store.

Retrieve registry entry from store.

Definition at line 775 of file DataSvc.cpp.

776 {
777 return retrieveObject( parentObj, itemToPath( item ), pObject );
778 }
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:737

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

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 1134 of file DataSvc.cpp.

1134 { return (CLID)m_rootCLID; }
DataSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: DataSvc.h:56
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1137 of file DataSvc.cpp.

1137 { return m_rootName; }
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:57

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

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

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 199 of file DataSvc.cpp.

200 {
201 m_dataLoader = pDataLoader;
202 if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this ).ignore();
203 return SUCCESS;
204 }
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
IConverter::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
DataSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:52
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84

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

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

Takes care to clear the store before reinitializing it

Definition at line 150 of file DataSvc.cpp.

151 {
152 clearStore().ignore();
153 return i_setRoot( std::move( root_path ), pRootObj );
154 }
std::move
T move(T...args)
DataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:161
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:112

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

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

Takes care to clear the store before reinitializing it

Definition at line 176 of file DataSvc.cpp.

177 {
178 clearStore().ignore();
179 return i_setRoot( std::move( root_path ), pRootAddr );
180 }
std::move
T move(T...args)
DataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:161
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:84
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:112

StatusCode DataSvc::traverseSubTree | ( | boost::string_ref | sub_tree_path,
|  | IDataStoreAgent * | pAgent
| ) |  |
| override

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

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

Definition at line 123 of file DataSvc.cpp.

124 {
125 DataObject* pO = nullptr;
126 StatusCode status = findObject( sub_tree_path, pO );
127 return status.isSuccess() ? traverseSubTree( pO, pAgent ) : status;
128 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::traverseSubTree
StatusCode traverseSubTree(boost::string_ref sub_tree_path, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: DataSvc.cpp:123
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:795

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

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

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

Definition at line 131 of file DataSvc.cpp.

132 {
133 if ( !checkRoot() ) return INVALID_ROOT;
134 RegEntry* entry = CAST_REGENTRY( RegEntry*, pObject->registry() );
135 if ( !entry ) return INVALID_OBJECT;
136 return entry->traverseTree( pAgent );
137 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:298
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36

StatusCode DataSvc::traverseTree | ( | IDataStoreAgent * | pAgent | ) |
| override

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

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

Definition at line 140 of file DataSvc.cpp.

141 {
142 if ( !checkRoot() ) return INVALID_ROOT;
143 return m_root->traverseTree( pAgent );
144 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:298
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72

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

Remove a link to another object.

Definition at line 970 of file DataSvc.cpp.

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

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

Remove a link to another object.

Definition at line 1003 of file DataSvc.cpp.

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

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

Remove a link to another object.

Definition at line 1011 of file DataSvc.cpp.

1012 {
1013 if ( !checkRoot() ) return INVALID_ROOT;
1014 IRegistry* from_entry = m_root->findLeaf( from );
1015 return unlinkObject( from_entry, objPath );
1016 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:970
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

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

Remove a link to another object.

Definition at line 992 of file DataSvc.cpp.

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

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 298 of file DataSvc.cpp.

299 {
300 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
301 return unregisterAddress( fullPath.front() != SEPARATOR ? m_root : nullptr, fullPath );
302 }
DataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:298
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 305 of file DataSvc.cpp.

306 {
307 return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
308 }
DataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:298
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 311 of file DataSvc.cpp.

312 {
313 if ( !checkRoot() ) return INVALID_ROOT;
314 if ( objPath.empty() ) return INVALID_OBJ_PATH;
315
316 if ( !pParent ) {
317 if ( objPath.front() != SEPARATOR ) return unregisterAddress( m_root, objPath );
318 auto sep = find( objPath, SEPARATOR, 1 );
319 if ( sep != boost::string_ref::npos && objPath.substr( 0, sep ) == m_rootName ) {
320 return unregisterAddress( m_root, objPath.substr( sep ) );
321 }
322 return INVALID_PARENT;
323 }
324 if ( objPath.front() != SEPARATOR ) {
325 return unregisterAddress( pParent, char( SEPARATOR ) + objPath );
326 }
327 RegEntry* node_entry = CAST_REGENTRY( RegEntry*, pParent );
328 if ( node_entry ) {
329 RegEntry* leaf_entry = node_entry->findLeaf( objPath );
330 if ( leaf_entry ) {
331 auto sep = objPath.rfind( SEPARATOR );
332 if ( sep > 0 && sep != boost::string_ref::npos ) {
333 return unregisterAddress( leaf_entry->parent(), objPath.substr( sep ) );
334 }
335 StatusCode status = node_entry->remove( objPath );
336 if ( status.isSuccess() ) return status;
337 }
338 }
339 return INVALID_PARENT;
340 }
DataSvc::unregisterAddress
StatusCode unregisterAddress(boost::string_ref fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:298
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
DataSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:57
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:72
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:126
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154

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

Unregister object from the data store.

Definition at line 445 of file DataSvc.cpp.

446 {
447 DataObject* pObject = nullptr;
448 StatusCode status = findObject( fullPath, pObject );
449 if ( status.isFailure() ) return status;
450 RegEntry* pEntry = CAST_REGENTRY( RegEntry*, pObject->registry() );
451 if ( !pEntry ) return INVALID_ROOT;
452 if ( !pEntry->isEmpty() ) return DIR_NOT_EMPTY;
453 RegEntry* pParent = pEntry->parentEntry();
454 if ( !pParent ) return INVALID_PARENT;
455 if ( pObject ) pObject->addRef();
456 pParent->remove( pEntry );
457 return StatusCode::SUCCESS;
458 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:59
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::findObject
StatusCode findObject(boost::string_ref fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:795

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

Unregister object from the data store.

Definition at line 461 of file DataSvc.cpp.

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

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

Unregister object from the data store.

Definition at line 469 of file DataSvc.cpp.

470 {
471 return unregisterObject( parentPath, itemToPath( item ) );
472 }
DataSvc::unregisterObject
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:445

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

Unregister object from the data store.

Definition at line 475 of file DataSvc.cpp.

476 {
477 if ( !checkRoot() ) return INVALID_ROOT;
478 RegEntry* entry = m_root->findLeaf( pObject );
479 if ( !entry ) return INVALID_OBJECT;
480 RegEntry* parent = entry->parentEntry();
481 if ( !parent ) return INVALID_PARENT;
482 if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
483 if ( entry->object() ) entry->object()->addRef();
484 if ( parent ) parent->remove( entry );
485 return SUCCESS;
486 }
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
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.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
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154

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

Unregister object from the data store.

Definition at line 489 of file DataSvc.cpp.

490 {
491 if ( checkRoot() ) {
492 try {
493 RegEntry* parent = CAST_REGENTRY( RegEntry*, pParentObj->registry() );
494 if ( parent ) {
495 RegEntry* entry = parent->findLeaf( objectPath );
496 if ( entry ) {
497 if ( entry->isEmpty() ) {
498 if ( entry->object() ) {
499 entry->object()->addRef();
500 }
501 parent->remove( entry );
502 return SUCCESS;
503 }
504 return DIR_NOT_EMPTY;
505 }
506 return INVALID_OBJECT;
507 }
508 } catch ( ... ) {
509 }
510 return INVALID_PARENT;
511 }
512 return INVALID_ROOT;
513 }
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
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
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
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:71
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::remove
virtual StatusCode remove(boost::string_ref name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:154

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

Unregister object from the data store.

Definition at line 516 of file DataSvc.cpp.

517 {
518 return unregisterObject( pParentObj, itemToPath( item ) );
519 }
DataSvc::unregisterObject
StatusCode unregisterObject(boost::string_ref fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:445

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

Update object identified by its directory entry.

Update object.

Definition at line 843 of file DataSvc.cpp.

844 {
845 if ( !pRegistry ) { // Precondition:
846 return INVALID_OBJ_ADDR; // Addres must be valid
847 }
848 DataObject* toUpdate = pRegistry->object();
849 if ( !toUpdate ) { // Try first to load
850 return loadObject( pRegistry );
851 }
852 return updateObject( toUpdate );
853 }
DataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:562
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:843
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Update object.

Definition at line 835 of file DataSvc.cpp.

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

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

Update object.

Definition at line 856 of file DataSvc.cpp.

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

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

Update object.

Definition at line 898 of file DataSvc.cpp.

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

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

Update object.

Definition at line 906 of file DataSvc.cpp.

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

## Member Data Documentation

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

Definition at line 67 of file DataSvc.h.

SmartIF<IConversionSvc> DataSvc::m_dataLoader = nullptr
| protected

Pointer to data loader service.

Definition at line 52 of file DataSvc.h.

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

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

Definition at line 65 of file DataSvc.h.

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

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

Definition at line 61 of file DataSvc.h.

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

Definition at line 63 of file DataSvc.h.

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

Definition at line 58 of file DataSvc.h.

SmartIF<IIncidentSvc> DataSvc::m_incidentSvc = nullptr
| protected

Pointer to incident service.

Definition at line 54 of file DataSvc.h.

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

Map with object paths to be inhibited from loading.

Definition at line 74 of file DataSvc.h.

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

Definition at line 59 of file DataSvc.h.

LoadItems DataSvc::m_preLoads
| protected

Items to be pre-loaded.

Definition at line 70 of file DataSvc.h.

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

Pointer to root entry.

Definition at line 72 of file DataSvc.h.

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

Definition at line 56 of file DataSvc.h.

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

Definition at line 57 of file DataSvc.h.

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

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