| The Gaudi Framework v27r1

- 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 CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
CLID | rootCLID () const override
| IDataManagerSvc: Accessor for root event CLID. More...
const std::string & | rootName () const override
| IDataManagerSvc: Accessor for root event name. More...
StatusCode | registerAddress (const std::string &fullPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress) override
| IDataManagerSvc: Register object address with the data store. More...
StatusCode | unregisterAddress (const std::string &fullPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (DataObject *pParent, const std::string &objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | unregisterAddress (IRegistry *pParent, const std::string &objPath) override
| IDataManagerSvc: Unregister object address from the data store. More...
StatusCode | objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
StatusCode | objectParent (const DataObject *pObject, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
| IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
StatusCode | clearSubTree (const std::string &sub_tree_path) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
StatusCode | clearSubTree (DataObject *pObject) override
| IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
StatusCode | clearStore () override
| IDataManagerSvc: Remove all data objects in the data store. More...
StatusCode | traverseSubTree (const std::string &sub_tree_path, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
StatusCode | traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
StatusCode | traverseTree (IDataStoreAgent *pAgent) override
| IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
StatusCode | setRoot (std::string root_name, DataObject *pRootObj) override
| Initialize data store for new event by giving new event path and root object. More...
virtual StatusCode | i_setRoot (std::string root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object. More...
StatusCode | setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
| Initialize data store for new event by giving new event path and address of root object. More...
virtual StatusCode | i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object. More...
StatusCode | setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
| IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider. More...
StatusCode | addPreLoadItem (const DataStoreItem &item) override
| Add an item to the preload list. More...
StatusCode | addPreLoadItem (const std::string &itemPath) override
| Add an item to the preload list. More...
StatusCode | removePreLoadItem (const DataStoreItem &item) override
| Remove an item from the preload list. More...
StatusCode | removePreLoadItem (const std::string &itemPath) override
| Add an item to the preload list. More...
StatusCode | resetPreLoad () override
| Clear the preload list. More...
virtual StatusCode | preLoad (int depth, int load_depth, DataObject *pObject)
| Execute one level of preloading and recursively load until the final level is reached. More...
StatusCode | preLoad () override
| load all preload items of the list More...
StatusCode | registerObject (const std::string &fullPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (const std::string &parentPath, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, const std::string &objPath, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | registerObject (DataObject *parentObj, int item, DataObject *pObject) override
| Register object with the data store. More...
StatusCode | unregisterObject (const std::string &fullPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (const std::string &parentPath, const std::string &objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (const std::string &parentPath, int item) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, const std::string &objectPath) override
| Unregister object from the data store. More...
StatusCode | unregisterObject (DataObject *pObject, int item) override
| Unregister object from the data store. More...
StatusCode | retrieveObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (const std::string &fullPath, DataObject *&pObject) override
| Retrieve object identified by its full path from the data store. More...
StatusCode | retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (const std::string &parentPath, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | retrieveObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Retrieve object from data store. More...
StatusCode | findObject (const std::string &fullPath, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
| Find object identified by its full path in the data store. More...
StatusCode | findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (const std::string &parentPath, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | findObject (DataObject *parentObj, int item, DataObject *&pObject) override
| Find object in the data store. More...
StatusCode | linkObject (IRegistry *from, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (DataObject *from, const std::string &objPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | linkObject (const std::string &fullPath, DataObject *to) override
| Add a link to another object. More...
StatusCode | unlinkObject (IRegistry *from, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (const std::string &fromPath, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (DataObject *fromObj, const std::string &objPath) override
| Remove a link to another object. More...
StatusCode | unlinkObject (const std::string &fullPath) override
| Remove a link to another object. More...
StatusCode | updateObject (IRegistry *pDirectory) override
| Update object identified by its directory entry. More...
StatusCode | updateObject (const std::string &updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *toUpdate) override
| Update object. More...
StatusCode | updateObject (const std::string &parentPath, const std::string &updatePath) override
| Update object. More...
StatusCode | updateObject (DataObject *pParent, const std::string &updatePath) override
| Update object. More...
StatusCode | initialize () override
| Service initialization. More...
StatusCode | reinitialize () override
| Service initialization. More...
StatusCode | finalize () override
| Service initialization. More...
| DataSvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor. 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...
StatusCode | setProperty (const Property &p) override
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value 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 >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Private tool. More...
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Public 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 CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
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 output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

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

## Protected Attributes
CLID | m_rootCLID = 110
| Integer Property corresponding to CLID of root entry. More...
std::string | m_rootName = "/Event"
| Name of root event. More...
SmartIF< IConversionSvc > | m_dataLoader = nullptr
| Pointer to data loader service. More...
SmartIF< IIncidentSvc > | m_incidentSvc = nullptr
| Pointer to incident service. More...
LoadItems | m_preLoads
| Items to be pre-loaded. More...
bool | m_forceLeaves = false
| Allow forced creation of default leaves on registerObject. More...
bool | m_enableAccessHdlr = false
| Flag to enable interrupts on data access requests. More...
bool | m_enableFaultHdlr = false
| Flag to enable interrupts on data creation requests. 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...
std::vector< std::string > | m_inhibitPathes
| Property for the inhibited leaves. More...
std::string | m_accessName = "DataAccess"
| Name of the data access incident. More...
std::string | m_faultName = "DataFault"
| Name of the data fault incident. More...
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel = MSG::NIL
| Service output level. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. 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 43 of file DataSvc.h.

## Member Typedef Documentation

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

Define set of load items.

Definition at line 49 of file DataSvc.h.

## Constructor & Destructor Documentation

DataSvc::DataSvc | ( | const std::string & | name,
|  | ISvcLocator * | svc
| ) |  |

Standard Constructor.

Definition at line 1220 of file DataSvc.cpp.

1221 : base_class(name,svc)
1222 {
1223 declareProperty("RootCLID", m_rootCLID);
1224 declareProperty("RootName", m_rootName);
1225 declareProperty("ForceLeaves", m_forceLeaves);
1226 declareProperty("InhibitPathes", m_inhibitPathes);
1227 declareProperty("DataFaultName", m_faultName);
1228 declareProperty("DataAccessName", m_accessName);
1229 declareProperty("EnableFaultHandler", m_enableFaultHdlr);
1230 declareProperty("EnableAccessHandler", m_enableAccessHdlr);
1231 }
DataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:65
DataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:67
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
DataSvc::m_accessName
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:75
extends< Service, IDataProviderSvc, IDataManagerSvc >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
DataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:63
DataSvc::m_faultName
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:77
DataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:73
DataSvc::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:53
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215

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

Standard Destructor.

Definition at line 1234 of file DataSvc.cpp.

1234 {
1235 setDataLoader(nullptr).ignore();
1236 resetPreLoad().ignore();
1237 clearStore().ignore();
1238 }
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:202
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114

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 1090 of file DataSvc.cpp.

1090 {
1091 auto i = std::find(std::begin(m_preLoads), std::end(m_preLoads), item);
1092 if ( i == std::end(m_preLoads) ) {
1093 m_preLoads.push_back(item);
1094 }
1095 return StatusCode::SUCCESS;
1096 }
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:61
std::end
T end(T...args)
std::vector::push_back
T push_back(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::find
T find(T...args)
std::begin
T begin(T...args)
ana.i
list i
Definition: ana.py:128

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

Add an item to the preload list.

Definition at line 1099 of file DataSvc.cpp.

1099 {
1100 return addPreLoadItem( DataStoreItem(itemPath,1) );
1101 }
DataSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: DataSvc.cpp:1090
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

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

Check if root path is valid.

Definition at line 390 of file DataSvc.h.

390 {
391 return 0 != m_root;
392 }
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69

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

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 114 of file DataSvc.cpp.

114 {
115 if ( checkRoot() ) {
116 m_root->release();
117 m_root = nullptr;
118 return SUCCESS;
119 }
120 return INVALID_ROOT;
121 }
DataSvcHelpers::RegistryEntry::release
unsigned long release() override
IInterface implementation: Reference the object.
Definition: RegistryEntry.cpp:69
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51

StatusCode DataSvc::clearSubTree | ( | const std::string & | sub_tree_path | ) |
| override

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

Definition at line 76 of file DataSvc.cpp.

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

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

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

Definition at line 97 of file DataSvc.cpp.

97 {
98 if ( checkRoot() ) {
99 RegEntry* entry = CAST_REGENTRY(RegEntry*,pObject->registry());
100 if ( entry ) {
101 RegEntry* parent = entry->parentEntry();
102 if ( parent ) {
103 parent->remove(entry);
104 return SUCCESS;
105 }
106 return INVALID_PARENT;
107 }
108 return INVALID_OBJECT;
109 }
110 return INVALID_ROOT;
111 }
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36

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

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

Definition at line 1208 of file DataSvc.cpp.

1208 {
1209 return new DataObject();
1210 }
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:50

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

Service initialization.

Service initialisation.

Definition at line 1188 of file DataSvc.cpp.

1188 {
1189 // Nothing to do: just call base class initialisation
1190 setDataLoader(nullptr).ignore();
1191 resetPreLoad().ignore();
1192 clearStore().ignore();
1193 m_incidentSvc.reset();
1194 return Service::finalize();
1195 }
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
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:202
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:59
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114

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

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

Definition at line 828 of file DataSvc.cpp.

829 {
830 pObject = nullptr;
831 if ( checkRoot() ) {
832 if ( path.empty() || path == m_rootName ) {
833 pObject = m_root->object();
834 return !pObject ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
835 }
836 else if ( path.front() != SEPARATOR ) {
837 return findObject(m_rootName, path, pObject);
838 }
839 return findObject((IRegistry*)nullptr, path, pObject);
840 }
841 return INVALID_ROOT;
842 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134

StatusCode DataSvc::findObject | ( | IRegistry * | pDirectory,
|  | const std::string & | path,
|  | DataObject *& | pObject
| ) |  |
| override

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

Retrieve object identified by its directory from the data store.

Definition at line 813 of file DataSvc.cpp.

815 {
816 pObject = nullptr;
817 IRegistry* pReg = ( pRegistry ? pRegistry : m_root );
818 RegEntry* root_entry = CAST_REGENTRY(RegEntry*, pReg);
819 if ( root_entry ) {
820 if ( !path.empty() ) pReg = root_entry->find(path);
821 if ( !pReg ) return INVALID_OBJ_PATH;
822 pObject = pReg->object();
823 }
824 return (!pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
825 }
std::string::empty
T empty(T...args)
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
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.
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
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:170

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

Find object in the data store.

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

Definition at line 845 of file DataSvc.cpp.

847 {
848 DataObject* parent = nullptr;
849 StatusCode status = findObject(parentPath, parent);
850 return status.isSuccess() ? findObject (parent, objectPath, pObject)
851 : status;
852 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Find object in the data store.

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

Definition at line 855 of file DataSvc.cpp.

856 {
857 return findObject(parentPath, itemToPath(item), pObject);
858 }
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Find object in the data store.

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

Definition at line 868 of file DataSvc.cpp.

870 {
871 IRegistry* pDir = ( parentObj ? parentObj->registry() : nullptr );
872 return findObject(pDir, path, pObject);
873 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191

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 861 of file DataSvc.cpp.

863 {
864 return findObject(parentObj, itemToPath(item), pObject);
865 }
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

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

Reimplemented in NTupleSvc.

Definition at line 1215 of file DataSvc.cpp.

1215 {
1216 return m_dataLoader.get();
1217 }
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
DataSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:57

DataObject * DataSvc::handleDataFault | ( | IRegistry * | pReg,
|  | const std::string & | path = `""`
| ) |  |
| protected

Invoke data fault handling if enabled.

Parameters

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

Returns
  Object corresponding to the specified leaf

Definition at line 546 of file DataSvc.cpp.

546 {
547 return i_handleDataFault(pReg,path);
548 }
DataSvc::i_handleDataFault
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:550

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

Definition at line 550 of file DataSvc.cpp.

551 {
552 if ( m_enableFaultHdlr ) {
553 IRegistry* pLeaf = nullptr;
554 if ( pReg && path.empty() ) {
555 DataIncident incident(name(), m_faultName, pReg->identifier());
556 m_incidentSvc->fireIncident(incident);
557 return pReg->object();
558 }
559 if ( pReg ) {
560 std::string p = pReg->identifier();
561 if (path.front() != SEPARATOR ) p += SEPARATOR;
562 p.append(path.data(),path.size());
563 DataIncident incident(name(), m_faultName, p);
564 m_incidentSvc->fireIncident(incident);
565 pLeaf = m_root->findLeaf(p);
566 } else {
567 std::string p = m_root->identifier();
568 if (path.front() != SEPARATOR ) p += SEPARATOR;
569 p.append(path.data(),path.size());
570 DataIncident incident(name(), m_faultName, p);
571 m_incidentSvc->fireIncident(incident);
572 pLeaf = m_root->findLeaf(p);
573 }
574 if ( pLeaf ) {
575 return pLeaf->object();
576 }
577 }
578 return nullptr;
579 }
std::string::empty
T empty(T...args)
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
DataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:67
std::string::front
T front(T...args)
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
std::string
STL class.
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
std::string::data
T data(T...args)
std::string::append
T append(T...args)
DataSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:59
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:126
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvc::m_faultName
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:77
std::string::size
T size(T...args)
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataIncident
Data service incident class.

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

Definition at line 673 of file DataSvc.cpp.

675 {
676 // A.Valassi 16.08.2001 avoid core dump if store is empty
677 if ( !checkRoot() ) return StatusCode(INVALID_ROOT,true);
678
679 static const auto empty = boost::string_ref{};
680 auto sep = find(path,SEPARATOR,1);
681 pEntry = nullptr;
682
683 if ( !parentObj ) {
684 if ( path.empty() || path == m_rootName ) {
685 parentObj = m_root;
686 path = empty;
687 } else if ( path.front() != SEPARATOR ) {
688 parentObj = m_root;
689 } else if ( sep != boost::string_ref::npos ) {
690 if ( !m_root->object() ) {
691 RegEntry* r = nullptr;
692 auto status = i_retrieveEntry(m_root, empty, r);
693 if ( !status.isSuccess() ) return status;
694 }
695 parentObj = m_root;
696 path = path.substr(sep);
697 } else {
698 return INVALID_OBJ_PATH;
699 }
700 sep = find(path,SEPARATOR,1);
701 }
702
703 StatusCode status = StatusCode(INVALID_ROOT,true);
704 if ( sep != boost::string_ref::npos ) { // the string contains a separator (after pos 0)
705 if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
706 status = loadObject(parentObj);
707 if ( !status.isSuccess() ) return status;
708 }
709 auto p_path = path.substr(0,sep);
710 RegEntry* root_entry = parentObj->findLeaf(p_path);
711 if ( !root_entry && m_enableFaultHdlr ) {
712 // If not even the parent is there, an incident
713 // to load the parent must be fired...
714 i_handleDataFault(parentObj, p_path);
715 root_entry = parentObj->findLeaf(p_path);
716 }
717 if ( root_entry ) {
718 DataObject* pO = root_entry->object();
719 if ( !pO ) {
720 // Object is not loaded: load the object if at all possible
721 status = loadObject(root_entry);
722 if ( !status.isSuccess() ) return status;
723 }
724 if ( root_entry->isSoft() ) {
725 root_entry = CAST_REGENTRY(RegEntry*,pO->registry());
726 }
727 return i_retrieveEntry(root_entry, path.substr(sep), pEntry);
728 }
729 return status;
730 } else if ( path.empty() ) {
731 pEntry = parentObj;
732 } else {
733 if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
734 status = loadObject(parentObj);
735 if ( !status.isSuccess() ) return status;
736 }
737 // last leave in search: find leaf and load
738 pEntry = parentObj->findLeaf(path);
739 // If no registry entry was found, trigger incident for action-on-demand
740 if ( !pEntry && m_enableFaultHdlr ) {
741 i_handleDataFault(parentObj, path);
742 pEntry = (path.empty() ? parentObj : parentObj->findLeaf(path) );
743 }
744 }
745
746 // Check results and return
747 if ( !pEntry ) return INVALID_OBJ_PATH;
748 if ( !pEntry->object() ) return loadObject(pEntry);
749
750 if ( m_enableAccessHdlr ) {
751 // Fire data access incident
752 // I do not know if this is a good idea....
753 // This fires too often!
754 //
755 //DataIncident incident(name(), m_accessName, pEntry->identifier());
756 //m_incidentSvc->fireIncident(incident);
757 return SUCCESS;
758 }
759 return SUCCESS;
760 }
DataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:65
std::string::empty
T empty(T...args)
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
DataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:67
std::string::front
T front(T...args)
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
DataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:584
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::i_handleDataFault
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:550
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvcHelpers::RegistryEntry::isSoft
virtual bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:146
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
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:63
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
std::string::substr
T substr(T...args)
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 164 of file DataSvc.cpp.

165 {
166 if ( pRootObj ) {
167 m_root = new RegEntry(std::move(root_path));
168 m_root->makeHard(pRootObj);
169 m_root->setDataSvc(this);
170 // No done with GaudiHive. preLoad().ignore();
171 }
172 return SUCCESS;
173 }
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
std::move
T move(T...args)
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:65
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:98

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 190 of file DataSvc.cpp.

191 {
192 if ( pRootAddr ) {
193 m_root = new RegEntry(std::move(root_path));
194 m_root->makeHard(pRootAddr);
195 m_root->setDataSvc(this);
196 // Not done with GaudiHive. preLoad().ignore();
197 }
198 return SUCCESS;
199 }
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
std::move
T move(T...args)
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:65
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:98

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

Service initialization.

Definition at line 1153 of file DataSvc.cpp.

1153 {
1154 // Nothing to do: just call base class initialisation
1155 StatusCode sc = Service::initialize();
1156 if ( UNLIKELY(!sc.isSuccess()) ) return sc;
1157 m_incidentSvc = service("IncidentSvc", true);
1158 if ( UNLIKELY(!m_incidentSvc) ) {
1159 error() << "Failed to access incident service." << endmsg;
1160 }
1161 return sc;
1162 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
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:59
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:144
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Add a link to another object.

Definition at line 966 of file DataSvc.cpp.

967 {
968 if ( checkRoot() ) {
969 try {
970 RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
971 if ( from_entry ) {
972 // First check if both objects are already registered to the store
973 RegEntry* to_entry = m_root->findLeaf(to);
974 if ( !to_entry ) {
975 return INVALID_OBJECT;
976 }
977 std::string::size_type sep = objPath.rfind(SEPARATOR);
978 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
979 DataObject* pO = nullptr;
980 StatusCode sc = retrieveObject(from, objPath.substr(0,sep), pO);
981 if ( sc.isSuccess() ) {
982 sc = linkObject(pO->registry(), objPath.substr(sep), to);
983 }
984 return sc;
985 }
986 // Now register the soft link
987 StatusCode status = from_entry->add( objPath, to, true);
988 return status.isSuccess() ? IDataProviderSvc_NO_ERROR : DOUBL_OBJ_PATH;
989 }
990 }
991 catch (...) {
992 }
993 return INVALID_PARENT;
994 }
995 return INVALID_ROOT;
996 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
std::string::rfind
T rfind(T...args)
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
merge_files.sc
int sc
Definition: merge_files.py:167
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::substr
T substr(T...args)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Add a link to another object.

Definition at line 1012 of file DataSvc.cpp.

1014 {
1015 DataObject* pO = nullptr;
1016 StatusCode status = retrieveObject(from, pO);
1017 return status.isSuccess() ? linkObject(pO->registry(), objPath, to)
1018 : status;
1019 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Add a link to another object.

Definition at line 1022 of file DataSvc.cpp.

1024 {
1025 if ( from ) {
1026 IRegistry* from_entry = from->registry();
1027 if ( from_entry ) {
1028 return linkObject( from_entry, objPath, to);
1029 }
1030 }
1031 return INVALID_PARENT;
1032 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966

StatusCode DataSvc::linkObject | ( | const std::string & | fullPath,
|  | DataObject * | to
| ) |  |
| override

Add a link to another object.

Definition at line 999 of file DataSvc.cpp.

1000 {
1001 if ( !fullPath.empty() ) {
1002 if ( fullPath.front() != SEPARATOR ) {
1003 return linkObject(m_rootName, fullPath, to);
1004 }
1005 auto sep = fullPath.rfind(SEPARATOR);
1006 return linkObject( fullPath.substr( 0, sep), fullPath.substr(sep), to);
1007 }
1008 return INVALID_OBJ_PATH;
1009 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
std::string::rfind
T rfind(T...args)
DataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
std::string::substr
T substr(T...args)

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

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

Definition at line 584 of file DataSvc.cpp.

584 {
585 IConversionSvc* pLoader = getDataLoader(pRegistry);
586 return loadObject(pLoader, pRegistry);
587 }
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:584
DataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:1215

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

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

Definition at line 592 of file DataSvc.cpp.

592 {
593 StatusCode status = INVALID_OBJ_ADDR;
594 DataObject* pObject = nullptr;
595 if ( !pLoader ) { // Precondition: Data loader must be present
596 return handleDataFault(pRegistry) ? StatusCode{SUCCESS} : NO_DATA_LOADER;
597 }
598 if ( !pRegistry ) { // Precondition: Directory must be valid
599 return handleDataFault(pRegistry) ? StatusCode{SUCCESS} : INVALID_OBJ_ADDR;
600 }
601
602 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
603
604 if ( m_enableAccessHdlr ) {
605 // Fire data access incident
606 DataIncident incident(name(), m_accessName, pRegistry->identifier());
607 m_incidentSvc->fireIncident(incident);
608 }
609 if ( !m_inhibitPathes.empty() ) {
610 auto inhibit = std::find(m_inhibitPathes.begin(), m_inhibitPathes.end(),
611 pRegistry->identifier());
612 if ( inhibit != m_inhibitPathes.end() ) {
613 return NO_ACCESS;
614 }
615 }
616 IOpaqueAddress* pAddress = pRegistry->address();
617 if ( !pAddress ) { // Precondition:
618 return INVALID_OBJ_ADDR; // Address must be valid
619 }
620 try {
621 status = pLoader->createObj(pAddress, pObject); // Call data loader
622 if ( status.isSuccess() ) {
623
624 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
625
626 RegEntry *pEntry = CAST_REGENTRY(RegEntry*,pRegistry);
627 pEntry->setObject(pObject);
628
629 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
630 status = pLoader->fillObjRefs(pAddress, pObject);
631 }
632 }
633 catch( const GaudiException& exc ) {
634 if ( handleDataFault(pRegistry) ) {
635 return SUCCESS;
636 }
637 throw GaudiException("GaudiException in loadObject() " + pRegistry->identifier(),
638 name(), StatusCode::FAILURE, exc);
639 }
640 catch( const std::exception& x) {
641 if ( handleDataFault(pRegistry) ) {
642 return SUCCESS;
643 }
644 throw GaudiException("std::exception in loadObject() " + pRegistry->identifier() +
645 ": " + System::typeinfoName(typeid(x)) + ", " + x.what(),
646 name(), StatusCode::FAILURE);
647 }
648 catch(...) {
649 if ( handleDataFault(pRegistry) ) {
650 return SUCCESS;
651 }
652 throw GaudiException("UNKN exception in loadObject() " + pRegistry->identifier(),
653 name(), StatusCode::FAILURE);
654 }
655 if ( !status.isSuccess() ) {
656 if ( handleDataFault(pRegistry) ) {
657 return StatusCode::SUCCESS;
658 }
659 }
660 ON_VERBOSE if ( status.isSuccess() ) {
661 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
662 }
663 return status;
664 }
VERMSG
#define VERMSG
Definition: DataSvc.cpp:71
DataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:65
std::vector::empty
T empty(T...args)
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
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:297
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:130
DataSvc::m_accessName
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:75
std::vector::end
T end(T...args)
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
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:122
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:59
std::exception
STL class.
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
DataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:546
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
std::vector::begin
T begin(T...args)
DataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:73
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:68
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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 225 of file DataSvc.cpp.

226 {
227 if ( !pObject ) return INVALID_OBJECT;
228 return objectLeaves(pObject->registry(), leaves);
229 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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:225

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 234 of file DataSvc.cpp.

235 {
236 if ( !checkRoot() ) return INVALID_ROOT;
237 const RegEntry* node_entry = CAST_REGENTRY(const RegEntry*,pRegistry);
238 if ( !node_entry ) return INVALID_OBJECT;
239 leaves = node_entry->leaves();
240 return StatusCode::SUCCESS;
241 }
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:150
StatusCode::SUCCESS
Definition: StatusCode.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
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 209 of file DataSvc.cpp.

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

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

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

Definition at line 215 of file DataSvc.cpp.

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

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 1122 of file DataSvc.cpp.

1122 {
1123 //unused: StatusCode sc = StatusCode::FAILURE;
1124 if ( pObject && depth++ < load_depth ) {
1125 RegEntry* dir = CAST_REGENTRY(RegEntry*,pObject->registry());
1126 if ( dir ) {
1127 for (const auto& i : *dir) {
1128 DataObject *pObj = nullptr;
1129 StatusCode status = retrieveObject(pObject, i->name(), pObj);
1130 if ( status.isSuccess() && depth < load_depth ) {
1131 preLoad(depth, load_depth, pObj).ignore();
1132 }
1133 }
1134 }
1135 }
1136 return StatusCode::SUCCESS;
1137 }
DataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: DataSvc.cpp:1140
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ana.i
list i
Definition: ana.py:128

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

load all preload items of the list

Definition at line 1140 of file DataSvc.cpp.

1140 {
1141 DataObject* pObj = nullptr;
1142 for (const auto& i : m_preLoads ) {
1143 StatusCode sc = retrieveObject( i.path(), pObj);
1144 int load_depth = i.depth();
1145 if ( sc.isSuccess() && load_depth > 1 ) {
1146 preLoad(1, load_depth, pObj).ignore();
1147 }
1148 }
1149 return StatusCode::SUCCESS;
1150 }
DataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: DataSvc.cpp:1140
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:61
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ana.i
list i
Definition: ana.py:128

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

IDataManagerSvc: Register object address with the data store.

Definition at line 244 of file DataSvc.cpp.

245 {
246 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
247 return registerAddress( fullPath.front() != SEPARATOR ? m_root : nullptr,
248 fullPath, pAddress);
249 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
DataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244

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

IDataManagerSvc: Register object address with the data store.

Definition at line 252 of file DataSvc.cpp.

254 {
255 IRegistry* pRegistry = ( parentObj ? parentObj->registry() : nullptr );
256 return registerAddress(pRegistry, objectPath, pAddress);
257 }
DataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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,
|  | const std::string & | objectPath,
|  | IOpaqueAddress * | pAddress
| ) |  |
| override

IDataManagerSvc: Register object address with the data store.

Definition at line 260 of file DataSvc.cpp.

262 {
263 if ( !checkRoot() ) return INVALID_ROOT;
264 if ( objPath.empty() ) return INVALID_OBJ_PATH;
265
266 if ( !parentObj ) {
267 if ( objPath.front() != SEPARATOR ) {
268 return registerAddress(m_root, objPath, pAddress);
269 }
270 std::string::size_type sep = objPath.find(SEPARATOR,1);
271 if ( sep == std::string::npos ) {
272 return INVALID_PARENT;
273 }
274 if ( objPath.compare(0,sep,m_rootName) == 0 ) {
275 return registerAddress(m_root, objPath.substr(sep), pAddress);
276 }
277 }
278 if ( objPath.front() != SEPARATOR ) {
279 return registerAddress(parentObj, char(SEPARATOR)+objPath, pAddress);
280 }
281 RegEntry* par_entry = CAST_REGENTRY(RegEntry*,parentObj);
282 if ( !par_entry ) return INVALID_PARENT;
283
284 std::string::size_type sep = objPath.rfind(SEPARATOR);
285 if ( sep > 0 && sep != std::string::npos ) {
286 auto p_path = objPath.substr( 0, sep);
287 auto o_path = objPath.substr( sep );
288 RegEntry* p_entry = par_entry->findLeaf(p_path);
289 // Create default object leafs if the
290 // intermediate nodes are not present
291 if ( !p_entry && m_forceLeaves ) {
292 DataObject *pLeaf = createDefaultObject();
293 StatusCode sc = registerObject(par_entry->identifier(),
294 p_path,
295 pLeaf);
296 if ( sc.isFailure() ) delete pLeaf;
297 p_entry = par_entry->findLeaf(p_path);
298 }
299 if ( !p_entry ) return INVALID_PARENT;
300 return registerAddress(p_entry, o_path, pAddress);
301 }
302 StatusCode status = par_entry->add(objPath, pAddress);
303 return status.isSuccess() ? status : DOUBL_OBJ_PATH;
304 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
merge_files.sc
int sc
Definition: merge_files.py:167
DataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:126
DataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:63
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1208

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

Register object with the data store.

Definition at line 356 of file DataSvc.cpp.

357 {
358 return registerObject(nullptr, fullPath, pObject);
359 }
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356

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

Register object with the data store.

Definition at line 363 of file DataSvc.cpp.

365 {
366 DataObject* pO = nullptr;
367 StatusCode status = retrieveObject(parentPath, pO);
368 if ( !status.isSuccess() && m_forceLeaves ) {
369 pO = createDefaultObject();
370 status = registerObject(parentPath, pO);
371 if ( !status.isSuccess() ) pO->release();
372 }
373 if ( status.isFailure() ) return status;
374 return registerObject(pO, objPath, pObject);
375 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
DataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:63
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
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:1208

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

Register object with the data store.

Definition at line 378 of file DataSvc.cpp.

380 {
381 return registerObject(parentPath, itemToPath(item), pObject);
382 }
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Register object with the data store.

Definition at line 392 of file DataSvc.cpp.

394 {
395 if ( !checkRoot() ) return INVALID_ROOT;
396
397 if ( !parentObj ) {
398 if ( !objPath.empty() ) {
399 if ( objPath.front() == SEPARATOR ) {
400 auto sep = objPath.find(SEPARATOR,1);
401 if ( sep != std::string::npos ) {
402 return registerObject(objPath.substr( 0, sep), objPath.substr( sep ), pObject);
403 }
404 } else {
405 return registerObject(m_rootName, objPath, pObject);
406 }
407 }
408 return INVALID_OBJ_PATH;
409 }
410 RegEntry* node_entry = CAST_REGENTRY(RegEntry*,parentObj->registry());
411 if ( node_entry ) {
412 StatusCode status = INVALID_PARENT;
413 auto sep = objPath.find(SEPARATOR,1);
414 if ( sep != std::string::npos ) {
415 auto p_path = objPath.substr( 0, sep );
416 auto o_path = objPath.substr( sep );
417 RegEntry* par_entry = node_entry->findLeaf(p_path);
418 // Create default object leafs if the
419 // intermediate nodes are not present
420 if ( !par_entry && m_forceLeaves ) {
421 DataObject *pLeaf = createDefaultObject();
422 StatusCode sc = registerObject(parentObj, p_path, pLeaf);
423 if ( ! sc.isSuccess() ) delete pLeaf;
424 par_entry = node_entry->findLeaf(p_path);
425 }
426 else if ( par_entry && !par_entry->object() ) {
427 status = i_retrieveEntry( node_entry, p_path, par_entry);
428 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
429 DataObject *pLeaf = createDefaultObject();
430 StatusCode sc = registerObject(parentObj, p_path, pLeaf);
431 if ( ! sc.isSuccess() ) delete pLeaf;
432 par_entry = node_entry->findLeaf(p_path);
433 }
434 }
435 node_entry = par_entry;
436 if ( node_entry ) {
437 DataObject* obj = node_entry->object();
438 if ( obj ) {
439 status = registerObject( obj, o_path, pObject );
440 }
441 }
442 }
443 else {
444 RegEntry* leaf = node_entry->findLeaf(objPath);
445 if ( !leaf ) {
446 status = node_entry->add( objPath, pObject );
447 }
448 else {
449 DataObject* obj = leaf->object();
450 if ( !obj ) {
451 if ( !pObject ) {
452 error() << "registerObject: trying to register null DataObject" << endmsg;
453 return StatusCode::FAILURE;
454 }
455 pObject->setRegistry(leaf);
456 leaf->setAddress(nullptr);
457 leaf->setObject(pObject);
458 status = StatusCode::SUCCESS;
459 }
460 else {
461 status = DOUBL_OBJ_PATH;
462 }
463 }
464 }
465 return status;
466 }
467 return INVALID_PARENT;
468 }
std::string::empty
T empty(T...args)
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
merge_files.sc
int sc
Definition: merge_files.py:167
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:112
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:122
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:138
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:63
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
std::string::substr
T substr(T...args)
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:1208
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Register object with the data store.

Definition at line 385 of file DataSvc.cpp.

387 {
388 return registerObject(parentObj, itemToPath(item), pObject);
389 }
DataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Service initialization.

Service reinitialization.

Definition at line 1165 of file DataSvc.cpp.

1165 {
1166 // the finalize part is copied here
1167 setDataLoader(nullptr).ignore();
1168 resetPreLoad().ignore();
1169 clearStore().ignore();
1170 m_incidentSvc.reset();
1171 // re-initialize the base class
1172 StatusCode sc = Service::reinitialize();
1173 if ( UNLIKELY(!sc.isSuccess()) ) {
1174 error() << "Unable to reinitialize base class" << endmsg;
1175 return sc;
1176 }
1177 // the initialize part is copied here
1178 m_incidentSvc = service("IncidentSvc", true);
1179 if ( UNLIKELY(!m_incidentSvc) ) {
1180 error() << "Failed to access incident service." << endmsg;
1181 return StatusCode::FAILURE;
1182 }
1183 // return
1184 return StatusCode::SUCCESS;
1185 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
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:202
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:59
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:282
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:144
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114

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

Remove an item from the preload list.

Definition at line 1104 of file DataSvc.cpp.

1104 {
1105 m_preLoads.erase(std::remove(std::begin(m_preLoads), std::end(m_preLoads), item),
1106 std::end(m_preLoads));
1107 return StatusCode::SUCCESS;
1108 }
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:61
std::end
T end(T...args)
std::remove
T remove(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::vector::erase
T erase(T...args)
std::begin
T begin(T...args)

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

Add an item to the preload list.

Definition at line 1111 of file DataSvc.cpp.

1111 {
1112 return removePreLoadItem( DataStoreItem(itemPath,1) );
1113 }
DataSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: DataSvc.cpp:1104
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

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

Clear the preload list.

Definition at line 1116 of file DataSvc.cpp.

1116 {
1117 m_preLoads.erase(std::begin(m_preLoads), std::end(m_preLoads));
1118 return StatusCode::SUCCESS;
1119 }
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:61
std::end
T end(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::vector::erase
T erase(T...args)
std::begin
T begin(T...args)

StatusCode DataSvc::retrieveEntry | ( | DataSvcHelpers::RegistryEntry * | pNode,
|  | const std::string & | path,
|  | DataSvcHelpers::RegistryEntry *& | pEntry
| ) |  |
| protected

Retrieve registry entry from store.

Definition at line 667 of file DataSvc.cpp.

669 {
670 return i_retrieveEntry(parentObj,path,pEntry);
671 }
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673

StatusCode DataSvc::retrieveObject | ( | IRegistry * | pDirectory,
|  | const std::string & | path,
|  | DataObject *& | pObject
| ) |  |
| override

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 763 of file DataSvc.cpp.

765 {
766 pObject = nullptr;
767 RegEntry *result = nullptr, *parent = CAST_REGENTRY(RegEntry*,pRegistry);
768 StatusCode status = i_retrieveEntry(parent, path, result);
769 if ( status.isSuccess() ) pObject = result->object();
770 return status;
771 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvc::i_retrieveEntry
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
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:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134

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

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

Definition at line 774 of file DataSvc.cpp.

775 {
776 IRegistry* nullDir = nullptr;
777 return retrieveObject(nullDir, fullPath, pObject);
778 }
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, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763

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

Retrieve object from data store.

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

Definition at line 781 of file DataSvc.cpp.

783 {
784 DataObject* parent = nullptr;
785 StatusCode status = retrieveObject(parentPath, parent);
786 return status.isSuccess() ? retrieveObject (parent, objectPath, pObject)
787 : status;
788 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Retrieve object from data store.

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

Definition at line 791 of file DataSvc.cpp.

793 {
794 return retrieveObject(parentPath, itemToPath(item), pObject);
795 }
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Retrieve object from data store.

Definition at line 798 of file DataSvc.cpp.

800 {
801 IRegistry* pRegistry = (parentObj ? parentObj->registry() : nullptr);
802 return retrieveObject(pRegistry, path, pObject);
803 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191

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

Retrieve object from data store.

Retrieve registry entry from store.

Definition at line 806 of file DataSvc.cpp.

808 {
809 return retrieveObject(parentObj, itemToPath(item), pObject);
810 }
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 1198 of file DataSvc.cpp.

1198 {
1199 return( (CLID)m_rootCLID );
1200 }
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
DataSvc::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:53

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1203 of file DataSvc.cpp.

1203 {
1204 return m_rootName;
1205 }
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55

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 202 of file DataSvc.cpp.

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

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 153 of file DataSvc.cpp.

154 {
155 clearStore().ignore();
156 return i_setRoot (std::move(root_path), pRootObj);
157 }
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:164
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114

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 179 of file DataSvc.cpp.

180 {
181 clearStore().ignore();
182 return i_setRoot (std::move(root_path), pRootAddr);
183 }
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:164
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114

StatusCode DataSvc::traverseSubTree | ( | const std::string & | sub_tree_path,
|  | IDataStoreAgent * | pAgent
| ) |  |
| override

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

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

Definition at line 126 of file DataSvc.cpp.

127 {
128 DataObject* pO = nullptr;
129 StatusCode status = findObject(sub_tree_path, pO);
130 if ( status.isFailure() ) return status;
131 return traverseSubTree(pO, pAgent);
132 }
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvc::traverseSubTree
StatusCode traverseSubTree(const std::string &sub_tree_path, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: DataSvc.cpp:126
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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 135 of file DataSvc.cpp.

136 {
137 if ( !checkRoot() ) return INVALID_ROOT;
138 RegEntry* entry = CAST_REGENTRY(RegEntry*,pObject->registry());
139 if ( !entry ) return INVALID_OBJECT;
140 return entry->traverseTree(pAgent);
141 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:285
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
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 144 of file DataSvc.cpp.

144 {
145 if ( !checkRoot() ) return INVALID_ROOT;
146 return m_root->traverseTree(pAgent);
147 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:285
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69

StatusCode DataSvc::unlinkObject | ( | IRegistry * | from,
|  | const std::string & | objPath
| ) |  |
| override

Remove a link to another object.

Definition at line 1035 of file DataSvc.cpp.

1036 {
1037 if ( checkRoot() ) {
1038 try {
1039 RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1040 if ( from_entry ) {
1041 std::string::size_type sep = objPath.rfind(SEPARATOR);
1042 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1043 DataObject* pO = nullptr;
1044 StatusCode sc = findObject(from, objPath.substr(0,sep), pO);
1045 if ( sc.isSuccess() ) {
1046 sc = unlinkObject(pO->registry(), objPath.substr(sep));
1047 }
1048 return sc;
1049 }
1050 StatusCode status = from_entry->remove( objPath );
1051 if ( status.isSuccess() ) return status;
1052 return INVALID_OBJ_PATH;
1053 }
1054 }
1055 catch (...) {
1056 }
1057 return INVALID_PARENT;
1058 }
1059 return INVALID_ROOT;
1060 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string::rfind
T rfind(T...args)
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
merge_files.sc
int sc
Definition: merge_files.py:167
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
std::string::substr
T substr(T...args)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Remove a link to another object.

Definition at line 1073 of file DataSvc.cpp.

1074 {
1075 DataObject* pObject = nullptr;
1076 StatusCode status = findObject(from, pObject);
1077 return status.isSuccess() ? unlinkObject(pObject->registry(), objPath)
1078 : status;
1079 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Remove a link to another object.

Definition at line 1082 of file DataSvc.cpp.

1083 {
1084 if ( !checkRoot() ) return INVALID_ROOT;
1085 IRegistry* from_entry = m_root->findLeaf(from);
1086 return unlinkObject(from_entry, objPath);
1087 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035

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

Remove a link to another object.

Definition at line 1063 of file DataSvc.cpp.

1063 {
1064 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
1065 if ( fullPath.front() != SEPARATOR ) {
1066 return unlinkObject(m_rootName, fullPath);
1067 }
1068 auto sep = fullPath.rfind(SEPARATOR);
1069 return unlinkObject(fullPath.substr(0,sep), fullPath.substr(sep));
1070 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
std::string::rfind
T rfind(T...args)
DataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
std::string::substr
T substr(T...args)

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 307 of file DataSvc.cpp.

307 {
308 if ( fullPath.empty() ) return INVALID_OBJ_PATH;
309 return unregisterAddress( fullPath.front() != SEPARATOR ? m_root : nullptr,
310 fullPath );
311 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
DataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 314 of file DataSvc.cpp.

315 {
316 return unregisterAddress( pParent ? pParent->registry() : nullptr,
317 objPath);
318 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307

StatusCode DataSvc::unregisterAddress | ( | IRegistry * | pParent,
|  | const std::string & | objPath
| ) |  |
| override

IDataManagerSvc: Unregister object address from the data store.

Definition at line 321 of file DataSvc.cpp.

322 {
323 if ( !checkRoot() ) return INVALID_ROOT;
324 if ( objPath.empty() ) return INVALID_OBJ_PATH;
325
326 if ( !pParent ) {
327 if ( objPath.front() != SEPARATOR ) {
328 return unregisterAddress(m_root, objPath);
329 }
330 std::string::size_type sep = objPath.find(SEPARATOR,1);
331 if ( sep != std::string::npos &&
332 objPath.compare( 0, sep, m_rootName) == 0 ) {
333 return unregisterAddress(m_root, objPath.substr(sep));
334 }
335 return INVALID_PARENT;
336 }
337 if ( objPath.front() != SEPARATOR ) {
338 return unregisterAddress(pParent, char(SEPARATOR)+objPath);
339 }
340 RegEntry* node_entry = CAST_REGENTRY(RegEntry*,pParent);
341 if ( node_entry ) {
342 RegEntry* leaf_entry = node_entry->findLeaf(objPath);
343 if ( leaf_entry ) {
344 std::string::size_type sep = objPath.rfind(SEPARATOR);
345 if ( sep > 0 && sep != std::string::npos ) {
346 return unregisterAddress(leaf_entry->parent(), objPath.substr(sep));
347 }
348 StatusCode status = node_entry->remove(objPath);
349 if ( status.isSuccess() ) return status;
350 }
351 }
352 return INVALID_PARENT;
353 }
std::string::empty
T empty(T...args)
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: DataSvc.h:55
std::string::rfind
T rfind(T...args)
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:142
std::string::substr
T substr(T...args)
std::string::compare
T compare(T...args)

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

Unregister object from the data store.

Definition at line 471 of file DataSvc.cpp.

471 {
472 DataObject* pObject = nullptr;
473 StatusCode status = findObject(fullPath, pObject);
474 if ( status.isFailure() ) return status;
475 RegEntry* pEntry = CAST_REGENTRY(RegEntry*,pObject->registry());
476 if ( !pEntry ) return INVALID_ROOT;
477 if ( !pEntry->isEmpty() ) return DIR_NOT_EMPTY;
478 RegEntry* pParent = pEntry->parentEntry();
479 if ( !pParent ) return INVALID_PARENT;
480 if ( pObject ) pObject->addRef();
481 pParent->remove(pEntry);
482 return StatusCode::SUCCESS;
483 }
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Unregister object from the data store.

Definition at line 486 of file DataSvc.cpp.

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

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

Unregister object from the data store.

Definition at line 494 of file DataSvc.cpp.

494 {
495 return unregisterObject(parentPath, itemToPath(item));
496 }
DataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Unregister object from the data store.

Definition at line 499 of file DataSvc.cpp.

499 {
500 if ( !checkRoot() ) return INVALID_ROOT;
501 RegEntry* entry = m_root->findLeaf(pObject);
502 if ( !entry ) return INVALID_OBJECT;
503 RegEntry* parent = entry->parentEntry();
504 if ( !parent ) return INVALID_PARENT;
505 if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
506 if ( entry->object() ) entry->object()->addRef();
507 if ( parent ) parent->remove(entry);
508 return SUCCESS;
509 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:69
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134

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

Unregister object from the data store.

Definition at line 512 of file DataSvc.cpp.

513 {
514 if ( checkRoot() ) {
515 try {
516 RegEntry* parent = CAST_REGENTRY(RegEntry*,pParentObj->registry());
517 if ( parent ) {
518 RegEntry* entry = parent->findLeaf(objectPath);
519 if ( entry ) {
520 if ( entry->isEmpty() ) {
521 if ( entry->object() ) {
522 entry->object()->addRef();
523 }
524 parent->remove(entry);
525 return SUCCESS;
526 }
527 return DIR_NOT_EMPTY;
528 }
529 return INVALID_OBJECT;
530 }
531 }
532 catch(...) {
533 }
534 return INVALID_PARENT;
535 }
536 return INVALID_ROOT;
537 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134

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

Unregister object from the data store.

Definition at line 540 of file DataSvc.cpp.

540 {
541 return unregisterObject(pParentObj, itemToPath(item));
542 }
DataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Update object identified by its directory entry.

Update object.

Definition at line 884 of file DataSvc.cpp.

884 {
885 if ( !pRegistry ) { // Precondition:
886 return INVALID_OBJ_ADDR; // Addres must be valid
887 }
888 DataObject* toUpdate = pRegistry->object();
889 if ( !toUpdate ) { // Try first to load
890 return loadObject(pRegistry);
891 }
892 return updateObject(toUpdate);
893 }
DataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:584
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Update object.

Definition at line 876 of file DataSvc.cpp.

876 {
877 DataObject* pO = nullptr;
878 StatusCode status = findObject(updatePath, pO);
879 return status.isSuccess() ? updateObject(pO)
880 : retrieveObject(updatePath, pO);
881 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Update object.

Definition at line 896 of file DataSvc.cpp.

896 {
897 StatusCode status = INVALID_OBJ_ADDR;
898 if ( !toUpdate ) { // Precondition:
899 return INVALID_OBJECT; // Address must be valid
900 }
901 IRegistry* pRegistry = toUpdate->registry(); // Precondition:
902 if ( !pRegistry ) { // Need valid registry
903 return INVALID_OBJECT;
904 }
905 IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
906 if ( !pAddress ) { // Need valid address
907 return INVALID_OBJ_ADDR;
908 }
909 IConversionSvc* pLoader = getDataLoader(pRegistry);
910 if ( !pLoader ) { // Precondition:
911 return NO_DATA_LOADER; // Data loader must be present
912 }
913 if ( !m_inhibitPathes.empty() ) {
914 auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(),
915 pRegistry->identifier());
916 if ( inhibit != m_inhibitPathes.end() ) {
917 return NO_ACCESS;
918 }
919 }
920 try {
921 status = pLoader->updateObj(pAddress, toUpdate); // Call data loader
922 if ( status.isSuccess() ) {
923 status = pLoader->updateObjRefs(pAddress, toUpdate);
924 }
925 }
926 catch( const GaudiException& exc ) {
927 throw GaudiException("GaudiException in updateObject() " +
928 pRegistry->name(),
929 name(),
930 StatusCode::FAILURE, exc);
931 }
932 catch( const std::exception& x) {
933 throw GaudiException("std::exception in updateObject() " +
934 pRegistry->name() + ": " +
935 System::typeinfoName(typeid(x)) + ", " +
936 x.what(),
937 name(), StatusCode::FAILURE);
938 }
939 catch(...) {
940 throw GaudiException("UNKN exception in updateObject() " +
941 pRegistry->name(),
942 name(), StatusCode::FAILURE);
943 }
944 return status;
945 }
std::vector::empty
T empty(T...args)
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
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:297
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::vector::end
T end(T...args)
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
StatusCode::FAILURE
Definition: StatusCode.h:29
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.
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
DataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:73
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
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:1215

StatusCode DataSvc::updateObject | ( | const std::string & | parentPath,
|  | const std::string & | updatePath
| ) |  |
| override

Update object.

Definition at line 948 of file DataSvc.cpp.

949 {
950 DataObject* pParent = nullptr;
951 StatusCode status = findObject(parentPath, pParent);
952 return status.isSuccess() ? updateObject( pParent, updatePath)
953 : status;
954 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Update object.

Definition at line 957 of file DataSvc.cpp.

958 {
959 DataObject* pObject = nullptr;
960 StatusCode status = findObject(parent, updatePath, pObject);
961 return status.isSuccess() ? updateObject(pObject)
962 : status;
963 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
DataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

## Member Data Documentation

std::string DataSvc::m_accessName = "DataAccess"
| protected

Name of the data access incident.

Definition at line 75 of file DataSvc.h.

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

Pointer to data loader service.

Definition at line 57 of file DataSvc.h.

bool DataSvc::m_enableAccessHdlr = false
| protected

Flag to enable interrupts on data access requests.

Definition at line 65 of file DataSvc.h.

bool DataSvc::m_enableFaultHdlr = false
| protected

Flag to enable interrupts on data creation requests.

Definition at line 67 of file DataSvc.h.

std::string DataSvc::m_faultName = "DataFault"
| protected

Name of the data fault incident.

Definition at line 77 of file DataSvc.h.

bool DataSvc::m_forceLeaves = false
| protected

Allow forced creation of default leaves on registerObject.

Definition at line 63 of file DataSvc.h.

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

Pointer to incident service.

Definition at line 59 of file DataSvc.h.

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

Map with object paths to be inhibited from loading.

Definition at line 71 of file DataSvc.h.

std::vector<std::string> DataSvc::m_inhibitPathes
| protected

Property for the inhibited leaves.

Definition at line 73 of file DataSvc.h.

LoadItems DataSvc::m_preLoads
| protected

Items to be pre-loaded.

Definition at line 61 of file DataSvc.h.

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

Pointer to root entry.

Definition at line 69 of file DataSvc.h.

CLID DataSvc::m_rootCLID = 110
| protected

Integer Property corresponding to CLID of root entry.

Definition at line 53 of file DataSvc.h.

std::string DataSvc::m_rootName = "/Event"
| protected

Name of root event.

Definition at line 55 of file DataSvc.h.

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

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