DataSvc Class Reference

Data service base class. More...

#include <GaudiKernel/DataSvc.h>

Inheritance diagram for DataSvc:
Collaboration diagram for DataSvc:

Public Types

typedef std::vector< DataStoreItemLoadItems
 Define set of load items. More...
 
typedef std::vector< DataStoreItemLoadItems
 Define set of load items. More...
 
- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
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 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...
 
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...
 
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< BASE, Interfaces >
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...
 
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 extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

bool checkRoot ()
 Check if root path is valid. More...
 
virtual IConversionSvcgetDataLoader (IRegistry *pReg)
 Retrieve customizable data loader according to registry entry to be retrieved. More...
 
virtual DataObjectcreateDefaultObject () 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...
 
DataObjecthandleDataFault (IRegistry *pReg, const std::string &path="")
 Invoke data fault handling if enabled. More...
 
bool checkRoot ()
 Check if root path is valid. More...
 
virtual IConversionSvcgetDataLoader (IRegistry *pReg)
 Retrieve customizable data loader according to registry entry to be retrieved. More...
 
virtual DataObjectcreateDefaultObject () 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...
 
DataObjecthandleDataFault (IRegistry *pReg, const std::string &path="")
 Invoke data fault handling if enabled. 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< IConversionSvcm_dataLoader = nullptr
 Pointer to data loader service. More...
 
SmartIF< IIncidentSvcm_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::RegistryEntrym_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...
 

Private Member Functions

 DataSvc (const DataSvc &)=delete
 Fake copy constructor (never implemented). More...
 
DataSvcoperator= (const DataSvc &)=delete
 Fake assignment operator (never implemented). More...
 
StatusCode i_retrieveEntry (DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
 
DataObjecti_handleDataFault (IRegistry *pReg, boost::string_ref path=boost::string_ref{})
 
 DataSvc (const DataSvc &)=delete
 Fake copy constructor (never implemented). More...
 
DataSvcoperator= (const DataSvc &)=delete
 Fake assignment operator (never implemented). More...
 
StatusCode i_retrieveEntry (DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
 
DataObjecti_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 47 of file DataSvc.h.

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

Define set of load items.

Definition at line 47 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 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:63
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:65
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:73
extends base_class
Typedef to this class.
Definition: extends.h:14
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:71
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:61
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:75
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:51
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 }
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
void ignore() const
Definition: StatusCode.h:108
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114
DataSvc::DataSvc ( const DataSvc )
privatedelete

Fake copy constructor (never implemented).

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

Standard Constructor.

DataSvc::~DataSvc ( )
override

Standard Destructor.

DataSvc::DataSvc ( const DataSvc )
privatedelete

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 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:59
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
list i
Definition: ana.py:128
StatusCode DataSvc::addPreLoadItem ( const DataStoreItem item)
override

Add an item to the preload list.

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 }
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: DataSvc.cpp:1090
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode DataSvc::addPreLoadItem ( const std::string &  itemPath)
override

Add an item to the preload list.

bool DataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 388 of file DataSvc.h.

388  {
389  return 0 != m_root;
390  }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
bool DataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 388 of file DataSvc.h.

388  {
389  return 0 != m_root;
390  }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
StatusCode DataSvc::clearStore ( )
override

IDataManagerSvc: Remove all data objects in the data store.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
unsigned long release() override
IInterface implementation: Reference the object.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
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.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
virtual long remove(const std::string &name)
Remove an entry from the store.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
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.

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 }
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
virtual long remove(const std::string &name)
Remove an entry from the store.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * DataSvc::createDefaultObject ( ) const
protectedvirtual

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 }
virtual DataObject* DataSvc::createDefaultObject ( ) const
protectedvirtual

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

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 }
StatusCode finalize() override
Definition: Service.cpp:188
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
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:57
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
void ignore() const
Definition: StatusCode.h:108
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114
StatusCode DataSvc::finalize ( )
override

Service initialization.

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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
list path
Definition: __init__.py:15
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataObject * object() const override
Retrive object behind the link.
StatusCode DataSvc::findObject ( const std::string &  fullPath,
DataObject *&  pObject 
)
override

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

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

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

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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
list path
Definition: __init__.py:15
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual DataObject * object() const =0
Retrieve object behind the link.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
StatusCode DataSvc::findObject ( const std::string &  parentPath,
const std::string &  objPath,
DataObject *&  pObject 
)
override

Find object in the data store.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
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.

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 }
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
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.

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 }
list path
Definition: __init__.py:15
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode DataSvc::findObject ( DataObject parentObj,
int  item,
DataObject *&  pObject 
)
override

Find object in the data store.

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 }
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
tuple item
print s1,s2
Definition: ana.py:146
IConversionSvc * DataSvc::getDataLoader ( IRegistry pReg)
protectedvirtual

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

Definition at line 1215 of file DataSvc.cpp.

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

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

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 }
list path
Definition: __init__.py:15
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:550
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
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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
constexpr char SEPARATOR
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:65
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:57
list path
Definition: __init__.py:15
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const std::string & identifier() const override
Full identifier (or key)
virtual DataObject * object() const =0
Retrieve object behind the link.
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:75
virtual const id_type & identifier() const =0
Full identifier (or key)
Data service incident class.
DataObject* DataSvc::i_handleDataFault ( IRegistry pReg,
boost::string_ref  path = boost::string_ref{} 
)
private
StatusCode DataSvc::i_retrieveEntry ( DataSvcHelpers::RegistryEntry parentObj,
boost::string_ref  path,
DataSvcHelpers::RegistryEntry *&  pEntry 
)
private
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 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:63
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
constexpr char SEPARATOR
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:65
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
list path
Definition: __init__.py:15
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:584
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:550
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual bool isSoft() const
Is the link soft or hard.
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * object() const override
Retrive object behind the link.
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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:65
void makeHard(DataObject *pObject)
Initialize link as hard link.
virtual StatusCode DataSvc::i_setRoot ( std::string  root_name,
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

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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:65
void makeHard(DataObject *pObject)
Initialize link as hard link.
virtual 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

StatusCode DataSvc::initialize ( )
override

Service initialization.

Definition at line 1153 of file DataSvc.cpp.

1153  {
1154  // Nothing to do: just call base class initialisation
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 }
StatusCode initialize() override
Definition: Service.cpp:63
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:57
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define UNLIKELY(x)
Definition: Kernel.h:126
StatusCode DataSvc::initialize ( )
override

Service initialization.

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

Add a link to another object.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
constexpr char SEPARATOR
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
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.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
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.

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 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
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.

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 }
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:966
StatusCode DataSvc::loadObject ( IRegistry pNode)
protectedvirtual

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 }
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:584
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:1215
virtual StatusCode DataSvc::loadObject ( IRegistry pNode)
protectedvirtual

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

virtual StatusCode DataSvc::loadObject ( IConversionSvc pLoader,
IRegistry pNode 
)
protectedvirtual

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

StatusCode DataSvc::loadObject ( IConversionSvc pLoader,
IRegistry pNode 
)
protectedvirtual

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(),
647  }
648  catch(...) {
649  if ( handleDataFault(pRegistry) ) {
650  return SUCCESS;
651  }
652  throw GaudiException("UNKN exception in loadObject() " + pRegistry->identifier(),
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 }
#define VERMSG
Definition: DataSvc.cpp:71
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:63
Define general base for Gaudi exception.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:57
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:73
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:71
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
void setObject(DataObject *obj)
Set/Update object address.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:546
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
Data service incident class.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
#define ON_VERBOSE
Definition: DataSvc.cpp:68
StatusCode DataSvc::objectLeaves ( const DataObject pObject,
std::vector< IRegistry * > &  refLeaves 
)
override

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

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 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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 }
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
const Store & leaves() const
Access the leaves of the object.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
StatusCode DataSvc::objectLeaves ( const IRegistry pRegistry,
std::vector< IRegistry * > &  refLeaves 
)
override

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

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 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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 DataObject pObject,
IRegistry *&  refpParent 
)
override

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

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

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

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 }
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
virtual IRegistry * parent() const
Pointer to parent directory entry.
DataSvc& DataSvc::operator= ( const DataSvc )
privatedelete

Fake assignment operator (never implemented).

DataSvc& DataSvc::operator= ( const DataSvc )
privatedelete

Fake assignment operator (never implemented).

virtual 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.

Parameters
depthcurrent level of loading from requested parent
load_depthmaximum level of object loading
pObjectpointer to next level root object
Returns
Status code indicating success or failure.
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
depthcurrent level of loading from requested parent
load_depthmaximum level of object loading
pObjectpointer 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 }
StatusCode preLoad() override
load all preload items of the list
Definition: DataSvc.cpp:1140
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
void ignore() const
Definition: StatusCode.h:108
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
list i
Definition: ana.py:128
StatusCode DataSvc::preLoad ( )
override

load all preload items of the list

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 }
StatusCode preLoad() override
load all preload items of the list
Definition: DataSvc.cpp:1140
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:59
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
void ignore() const
Definition: StatusCode.h:108
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
list i
Definition: ana.py:128
StatusCode DataSvc::registerAddress ( const std::string &  fullPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
constexpr char SEPARATOR
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 }
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode DataSvc::registerAddress ( DataObject parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
constexpr char SEPARATOR
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
const std::string & identifier() const override
Full identifier (or key)
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:61
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1208
StatusCode DataSvc::registerAddress ( IRegistry parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
override

IDataManagerSvc: Register object address with the data store.

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

Register object with the data store.

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 }
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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:61
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
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,
const std::string &  objPath,
DataObject pObject 
)
override

Register object with the data store.

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 }
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
tuple item
print s1,s2
Definition: ana.py:146
StatusCode DataSvc::registerObject ( const std::string &  parentPath,
int  item,
DataObject pObject 
)
override

Register object with the data store.

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 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
constexpr char SEPARATOR
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
void setObject(DataObject *obj)
Set/Update object address.
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
IOpaqueAddress * address() const override
Retrieve opaque storage address.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:61
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * object() const override
Retrive object behind the link.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1208
StatusCode DataSvc::registerObject ( DataObject parentObj,
const std::string &  objPath,
DataObject pObject 
)
override

Register object with the data store.

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 }
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
tuple item
print s1,s2
Definition: ana.py:146
StatusCode DataSvc::registerObject ( DataObject parentObj,
int  item,
DataObject pObject 
)
override

Register object with the data store.

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
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 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
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
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:57
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode reinitialize() override
Definition: Service.cpp:283
#define UNLIKELY(x)
Definition: Kernel.h:126
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
void ignore() const
Definition: StatusCode.h:108
StatusCode resetPreLoad() override
Clear the preload list.
Definition: DataSvc.cpp:1116
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114
StatusCode DataSvc::reinitialize ( )
override

Service initialization.

StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
override

Remove an item from the preload list.

StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
override

Remove an item from the preload list.

Definition at line 1104 of file DataSvc.cpp.

1104  {
1106  std::end(m_preLoads));
1107  return StatusCode::SUCCESS;
1108 }
def remove(file, logdir)
Definition: install.py:153
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:59
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
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 }
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: DataSvc.cpp:1104
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode DataSvc::removePreLoadItem ( const std::string &  itemPath)
override

Add an item to the preload list.

StatusCode DataSvc::resetPreLoad ( )
override

Clear the preload list.

StatusCode DataSvc::resetPreLoad ( )
override

Clear the preload list.

Definition at line 1116 of file DataSvc.cpp.

1116  {
1118  return StatusCode::SUCCESS;
1119 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:59
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
StatusCode DataSvc::retrieveEntry ( DataSvcHelpers::RegistryEntry pNode,
const std::string &  path,
DataSvcHelpers::RegistryEntry *&  pEntry 
)
protected

Retrieve registry entry from store.

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 }
list path
Definition: __init__.py:15
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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
list path
Definition: __init__.py:15
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:673
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * object() const override
Retrive object behind the link.
StatusCode DataSvc::retrieveObject ( IRegistry pDirectory,
const std::string &  path,
DataObject *&  pObject 
)
override

Retrieve object from data store.

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 }
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
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 &  fullPath,
DataObject *&  pObject 
)
override

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

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
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,
const std::string &  objPath,
DataObject *&  pObject 
)
override

Retrieve object from data store.

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 }
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
tuple item
print s1,s2
Definition: ana.py:146
StatusCode DataSvc::retrieveObject ( const std::string &  parentPath,
int  item,
DataObject *&  pObject 
)
override

Retrieve object from data store.

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 }
list path
Definition: __init__.py:15
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
StatusCode DataSvc::retrieveObject ( DataObject parentObj,
const std::string &  objPath,
DataObject *&  pObject 
)
override

Retrieve object from data store.

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

Retrieve object from data store.

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 }
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
tuple item
print s1,s2
Definition: ana.py:146
CLID DataSvc::rootCLID ( ) const
override

IDataManagerSvc: Accessor for root event CLID.

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 m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:51
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
const std::string & DataSvc::rootName ( ) const
override

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1203 of file DataSvc.cpp.

1203  {
1204  return m_rootName;
1205 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
const std::string& DataSvc::rootName ( ) const
override

IDataManagerSvc: Accessor for root event name.

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

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

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 }
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:55
void ignore() const
Definition: StatusCode.h:108
StatusCode DataSvc::setRoot ( std::string  root_name,
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

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 }
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
void ignore() const
Definition: StatusCode.h:108
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 }
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
void ignore() const
Definition: StatusCode.h:108
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

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 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
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
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
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.

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

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

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 }
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
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.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
StatusCode DataSvc::unlinkObject ( IRegistry from,
const std::string &  objPath 
)
override

Remove a link to another object.

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 }
constexpr char SEPARATOR
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
virtual long remove(const std::string &name)
Remove an entry from the store.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
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.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
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.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
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.

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 }
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1035
StatusCode DataSvc::unregisterAddress ( const std::string &  fullPath)
override

IDataManagerSvc: Unregister object address from the data store.

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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
constexpr char SEPARATOR
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.

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 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
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 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
constexpr char SEPARATOR
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_rootName
Name of root event.
Definition: DataSvc.h:53
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
virtual long remove(const std::string &name)
Remove an entry from the store.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
virtual IRegistry * parent() const
Pointer to parent directory entry.
StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
const std::string &  objPath 
)
override

IDataManagerSvc: Unregister object address from the data store.

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

Unregister object from the data store.

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 }
virtual long remove(const std::string &name)
Remove an entry from the store.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
virtual bool isEmpty() const
Simple check if the Container is empty.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
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 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
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.

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

Unregister object from the data store.

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 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
tuple item
print s1,s2
Definition: ana.py:146
StatusCode DataSvc::unregisterObject ( DataObject pObject)
override

Unregister object from the data store.

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 * m_root
Pointer to root entry.
Definition: DataSvc.h:67
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * object() const override
Retrive object behind the link.
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 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:388
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
virtual bool isEmpty() const
Simple check if the Container is empty.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject * object() const override
Retrive object behind the link.
StatusCode DataSvc::unregisterObject ( DataObject pObject,
const std::string &  objectPath 
)
override

Unregister object from the data store.

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

Unregister object from the data store.

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 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
tuple item
print s1,s2
Definition: ana.py:146
StatusCode DataSvc::updateObject ( IRegistry pDirectory)
override

Update object identified by its directory entry.

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 }
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:584
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
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.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
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(),
938  }
939  catch(...) {
940  throw GaudiException("UNKN exception in updateObject() " +
941  pRegistry->name(),
943  }
944  return status;
945 }
Define general base for Gaudi exception.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
virtual const name_type & name() const =0
Name of the directory (or key)
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:71
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual const id_type & identifier() const =0
Full identifier (or key)
Opaque address interface definition.
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:1215
StatusCode DataSvc::updateObject ( DataObject toUpdate)
override

Update object.

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

Update object.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
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.

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 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:884
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 73 of file DataSvc.h.

SmartIF< IConversionSvc > DataSvc::m_dataLoader = nullptr
protected

Pointer to data loader service.

Definition at line 55 of file DataSvc.h.

bool DataSvc::m_enableAccessHdlr = false
protected

Flag to enable interrupts on data access requests.

Definition at line 63 of file DataSvc.h.

bool DataSvc::m_enableFaultHdlr = false
protected

Flag to enable interrupts on data creation requests.

Definition at line 65 of file DataSvc.h.

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

Name of the data fault incident.

Definition at line 75 of file DataSvc.h.

bool DataSvc::m_forceLeaves = false
protected

Allow forced creation of default leaves on registerObject.

Definition at line 61 of file DataSvc.h.

SmartIF< IIncidentSvc > DataSvc::m_incidentSvc = nullptr
protected

Pointer to incident service.

Definition at line 57 of file DataSvc.h.

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

Map with object paths to be inhibited from loading.

Definition at line 69 of file DataSvc.h.

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

Property for the inhibited leaves.

Definition at line 71 of file DataSvc.h.

LoadItems DataSvc::m_preLoads
protected

Items to be pre-loaded.

Definition at line 59 of file DataSvc.h.

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

Pointer to root entry.

Definition at line 67 of file DataSvc.h.

CLID DataSvc::m_rootCLID = 110
protected

Integer Property corresponding to CLID of root entry.

Definition at line 51 of file DataSvc.h.

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

Name of root event.

Definition at line 53 of file DataSvc.h.


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