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 >
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 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...
 
virtual StatusCode registerAddress (const std::string &fullPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode unregisterAddress (const std::string &fullPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (DataObject *pParent, const std::string &objPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (IRegistry *pParent, const std::string &objPath)
 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) override
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service. More...
 
virtual StatusCode addPreLoadItem (const DataStoreItem &item)
 Add an item to the preload list. More...
 
virtual StatusCode addPreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode removePreLoadItem (const DataStoreItem &item)
 Remove an item from the preload list. More...
 
virtual StatusCode removePreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode resetPreLoad ()
 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...
 
virtual StatusCode preLoad ()
 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...
 
virtual StatusCode registerAddress (const std::string &fullPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode unregisterAddress (const std::string &fullPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (DataObject *pParent, const std::string &objPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (IRegistry *pParent, const std::string &objPath)
 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) override
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service. More...
 
virtual StatusCode addPreLoadItem (const DataStoreItem &item)
 Add an item to the preload list. More...
 
virtual StatusCode addPreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode removePreLoadItem (const DataStoreItem &item)
 Remove an item from the preload list. More...
 
virtual StatusCode removePreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode resetPreLoad ()
 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...
 
virtual StatusCode preLoad ()
 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 42 of file DataSvc.h.

Member Typedef Documentation

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

Define set of load items.

Definition at line 46 of file DataSvc.h.

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

Define set of load items.

Definition at line 46 of file DataSvc.h.

Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 1228 of file DataSvc.cpp.

1229 : base_class(name,svc)
1230 {
1231  declareProperty("RootCLID", m_rootCLID);
1232  declareProperty("RootName", m_rootName);
1233  declareProperty("ForceLeaves", m_forceLeaves);
1234  declareProperty("InhibitPathes", m_inhibitPathes);
1235  declareProperty("DataFaultName", m_faultName);
1236  declareProperty("DataAccessName", m_accessName);
1237  declareProperty("EnableFaultHandler", m_enableFaultHdlr);
1238  declareProperty("EnableAccessHandler", m_enableAccessHdlr);
1239 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:62
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:64
std::string m_rootName
Name of root event.
Definition: DataSvc.h:52
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:72
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:70
extends base_class
Typedef to this class.
Definition: extends.h:14
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:60
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:74
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:50
DataSvc::~DataSvc ( )
override

Standard Destructor.

Definition at line 1242 of file DataSvc.cpp.

1242  {
1243  setDataLoader(nullptr).ignore();
1244  resetPreLoad().ignore();
1245  clearStore().ignore();
1246 }
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1124
StatusCode setDataLoader(IConversionSvc *svc) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:202
void ignore() const
Definition: StatusCode.h:108
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)
virtual

Add an item to the preload list.

Definition at line 1098 of file DataSvc.cpp.

1098  {
1099  auto i = std::find(std::begin(m_preLoads), std::end(m_preLoads), item);
1100  if ( i == std::end(m_preLoads) ) {
1101  m_preLoads.push_back(item);
1102  }
1103  return StatusCode::SUCCESS;
1104 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:58
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
list i
Definition: ana.py:128
virtual StatusCode DataSvc::addPreLoadItem ( const DataStoreItem item)
virtual

Add an item to the preload list.

StatusCode DataSvc::addPreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

Definition at line 1107 of file DataSvc.cpp.

1107  {
1108  return addPreLoadItem( DataStoreItem(itemPath,1) );
1109 }
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
virtual StatusCode addPreLoadItem(const DataStoreItem &item)
Add an item to the preload list.
Definition: DataSvc.cpp:1098
virtual StatusCode DataSvc::addPreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

bool DataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 387 of file DataSvc.h.

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

Check if root path is valid.

Definition at line 387 of file DataSvc.h.

387  {
388  return 0 != m_root;
389  }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
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:66
unsigned long release() override
IInterface implementation: Reference the object.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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:87
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:833
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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:387
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:87
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
DataObject * DataSvc::createDefaultObject ( ) const
protectedvirtual

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

Definition at line 1216 of file DataSvc.cpp.

1216  {
1217  return new DataObject();
1218 }
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 1196 of file DataSvc.cpp.

1196  {
1197  // Nothing to do: just call base class initialisation
1198  setDataLoader(nullptr).ignore();
1199  resetPreLoad().ignore();
1200  clearStore().ignore();
1201  m_incidentSvc.reset();
1202  return Service::finalize();
1203 }
StatusCode finalize() override
Definition: Service.cpp:187
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:56
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1124
StatusCode setDataLoader(IConversionSvc *svc) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:202
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 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 833 of file DataSvc.cpp.

834  {
835  pObject = nullptr;
836  if ( checkRoot() ) {
837  if ( path.empty() || path == m_rootName ) {
838  pObject = m_root->object();
839  return !pObject ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
840  }
841  else if ( path.front() != SEPARATOR ) {
842  return findObject(m_rootName, path, pObject);
843  }
844  return findObject((IRegistry*)nullptr, path, pObject);
845  }
846  return INVALID_ROOT;
847 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:52
list path
Definition: __init__.py:15
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:833
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 818 of file DataSvc.cpp.

820  {
821  pObject = nullptr;
822  IRegistry* pReg = ( pRegistry ? pRegistry : m_root );
823  RegEntry* root_entry = CAST_REGENTRY(RegEntry*, pReg);
824  if ( root_entry ) {
825  if ( !path.empty() ) pReg = root_entry->find(path);
826  if ( !pReg ) return INVALID_OBJ_PATH;
827  pObject = pReg->object();
828  }
829  return (!pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
830 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
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:34
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 850 of file DataSvc.cpp.

852  {
853  DataObject* parent = nullptr;
854  StatusCode status = findObject(parentPath, parent);
855  return status.isSuccess() ? findObject (parent, objectPath, pObject)
856  : status;
857 }
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:833
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 860 of file DataSvc.cpp.

861  {
862  return findObject(parentPath, itemToPath(item), pObject);
863 }
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:833
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 873 of file DataSvc.cpp.

875  {
876  IRegistry* pDir = ( parentObj ? parentObj->registry() : nullptr );
877  return findObject(pDir, path, pObject);
878 }
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:833
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 866 of file DataSvc.cpp.

868  {
869  return findObject(parentObj, itemToPath(item), pObject);
870 }
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:833
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 1223 of file DataSvc.cpp.

1223  {
1224  return m_dataLoader.get();
1225 }
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:54
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 548 of file DataSvc.cpp.

548  {
549  return i_handleDataFault(pReg,path);
550 }
list path
Definition: __init__.py:15
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:552
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 552 of file DataSvc.cpp.

553 {
554  if ( m_enableFaultHdlr ) {
555  IRegistry* pLeaf = nullptr;
556  if ( pReg && path.empty() ) {
557  DataIncident incident(name(), m_faultName, pReg->identifier());
558  m_incidentSvc->fireIncident(incident);
559  return pReg->object();
560  }
561  else if ( pReg ) {
562  std::string p = pReg->identifier();
563  if (path.front() != SEPARATOR ) p += SEPARATOR;
564  p.append(path.data(),path.size());
565  DataIncident incident(name(), m_faultName, p);
566  m_incidentSvc->fireIncident(incident);
567  pLeaf = m_root->findLeaf(p);
568  }
569  else {
570  std::string p = m_root->identifier();
571  if (path.front() != SEPARATOR ) p += SEPARATOR;
572  p.append(path.data(),path.size());
573  DataIncident incident(name(), m_faultName, p);
574  m_incidentSvc->fireIncident(incident);
575  pLeaf = m_root->findLeaf(p);
576  }
577  if ( pLeaf ) {
578  return pLeaf->object();
579  }
580  }
581  return nullptr;
582 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
constexpr char SEPARATOR
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:64
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:56
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:74
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 678 of file DataSvc.cpp.

680  {
681  // A.Valassi 16.08.2001 avoid core dump if store is empty
682  if ( !checkRoot() ) return StatusCode(INVALID_ROOT,true);
683 
684  static const auto empty = boost::string_ref{};
685  auto sep = find(path,SEPARATOR,1);
686  pEntry = nullptr;
687 
688  if ( !parentObj ) {
689  if ( path.empty() || path == m_rootName ) {
690  parentObj = m_root;
691  path = empty;
692  } else if ( path.front() != SEPARATOR ) {
693  parentObj = m_root;
694  } else if ( sep != boost::string_ref::npos ) {
695  if ( !m_root->object() ) {
696  RegEntry* r = nullptr;
697  auto status = i_retrieveEntry(m_root, empty, r);
698  if ( !status.isSuccess() ) return status;
699  }
700  parentObj = m_root;
701  path = path.substr(sep);
702  } else {
703  return INVALID_OBJ_PATH;
704  }
705  sep = find(path,SEPARATOR,1);
706  }
707 
708  StatusCode status = StatusCode(INVALID_ROOT,true);
709  if ( sep != boost::string_ref::npos ) { // the string contains a separator (after pos 0)
710  if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
711  status = loadObject(parentObj);
712  if ( !status.isSuccess() ) return status;
713  }
714  auto p_path = path.substr(0,sep);
715  RegEntry* root_entry = parentObj->findLeaf(p_path);
716  if ( !root_entry && m_enableFaultHdlr ) {
717  // If not even the parent is there, an incident
718  // to load the parent must be fired...
719  i_handleDataFault(parentObj, p_path);
720  root_entry = parentObj->findLeaf(p_path);
721  }
722  if ( root_entry ) {
723  DataObject* pO = root_entry->object();
724  if ( !pO ) {
725  // Object is not loaded: load the object if at all possible
726  status = loadObject(root_entry);
727  if ( !status.isSuccess() ) return status;
728  }
729  if ( root_entry->isSoft() ) {
730  root_entry = CAST_REGENTRY(RegEntry*,pO->registry());
731  }
732  return i_retrieveEntry(root_entry, path.substr(sep), pEntry);
733  }
734  return status;
735  } else if ( path.empty() ) {
736  pEntry = parentObj;
737  } else {
738  if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
739  status = loadObject(parentObj);
740  if ( !status.isSuccess() ) return status;
741  }
742  // last leave in search: find leaf and load
743  pEntry = parentObj->findLeaf(path);
744  // If no registry entry was found, trigger incident for action-on-demand
745  if ( !pEntry && m_enableFaultHdlr ) {
746  i_handleDataFault(parentObj, path);
747  pEntry = (path.empty() ? parentObj : parentObj->findLeaf(path) );
748  }
749  }
750 
751  // Check results and return
752  if ( !pEntry ) return INVALID_OBJ_PATH;
753  if ( !pEntry->object() ) return loadObject(pEntry);
754 
755  if ( m_enableAccessHdlr ) {
756  // Fire data access incident
757  // I do not know if this is a good idea....
758  // This fires too often!
759  //
760  //DataIncident incident(name(), m_accessName, pEntry->identifier());
761  //m_incidentSvc->fireIncident(incident);
762  return SUCCESS;
763  }
764  return SUCCESS;
765 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:62
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
constexpr char SEPARATOR
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:64
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:52
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:587
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:552
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:678
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:34
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  preLoad().ignore();
171  }
172  return SUCCESS;
173 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1148
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:83
void ignore() const
Definition: StatusCode.h:108
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  preLoad().ignore();
197  }
198  return SUCCESS;
199 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1148
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:83
void ignore() const
Definition: StatusCode.h:108
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 1161 of file DataSvc.cpp.

1161  {
1162  // Nothing to do: just call base class initialisation
1164  if ( UNLIKELY(!sc.isSuccess()) ) return sc;
1165  m_incidentSvc = service("IncidentSvc", true);
1166  if ( UNLIKELY(!m_incidentSvc) ) {
1167  error() << "Failed to access incident service." << endmsg;
1168  }
1169  return sc;
1170 }
StatusCode initialize() override
Definition: Service.cpp:62
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:56
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 971 of file DataSvc.cpp.

972  {
973  if ( checkRoot() ) {
974  try {
975  RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
976  if ( from_entry ) {
977  // First check if both objects are already registered to the store
978  RegEntry* to_entry = m_root->findLeaf(to);
979  if ( !to_entry ) {
980  return INVALID_OBJECT;
981  }
982  else {
983  std::string::size_type sep = objPath.rfind(SEPARATOR);
984  if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
985  DataObject* pO = nullptr;
986  StatusCode sc = retrieveObject(from, objPath.substr(0,sep), pO);
987  if ( sc.isSuccess() ) {
988  sc = linkObject(pO->registry(), objPath.substr(sep), to);
989  }
990  return sc;
991  }
992  // Now register the soft link
993  StatusCode status = from_entry->add( objPath, to, true);
994  return status.isSuccess() ?
995  IDataProviderSvc_NO_ERROR : DOUBL_OBJ_PATH;
996  }
997  }
998  }
999  catch (...) {
1000  }
1001  return INVALID_PARENT;
1002  }
1003  return INVALID_ROOT;
1004 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
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:387
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:768
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:971
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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 1020 of file DataSvc.cpp.

1022  {
1023  DataObject* pO = nullptr;
1024  StatusCode status = retrieveObject(from, pO);
1025  return status.isSuccess() ? linkObject(pO->registry(), objPath, to)
1026  : status;
1027 }
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:768
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:971
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 1030 of file DataSvc.cpp.

1032  {
1033  if ( from ) {
1034  IRegistry* from_entry = from->registry();
1035  if ( from_entry ) {
1036  return linkObject( from_entry, objPath, to);
1037  }
1038  }
1039  return INVALID_PARENT;
1040 }
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:971
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 1007 of file DataSvc.cpp.

1008  {
1009  if ( !fullPath.empty() ) {
1010  if ( fullPath.front() != SEPARATOR ) {
1011  return linkObject(m_rootName, fullPath, to);
1012  }
1013  auto sep = fullPath.rfind(SEPARATOR);
1014  return linkObject( fullPath.substr( 0, sep), fullPath.substr(sep), to);
1015  }
1016  return INVALID_OBJ_PATH;
1017 }
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:52
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: DataSvc.cpp:971
StatusCode DataSvc::loadObject ( IRegistry pNode)
protectedvirtual

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

Definition at line 587 of file DataSvc.cpp.

587  {
588  IConversionSvc* pLoader = getDataLoader(pRegistry);
589  return loadObject(pLoader, pRegistry);
590 }
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:587
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: DataSvc.cpp:1223
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 595 of file DataSvc.cpp.

595  {
596  StatusCode status = INVALID_OBJ_ADDR;
597  DataObject* pObject = nullptr;
598  if ( !pLoader ) { // Precondition: Data loader must be present
599  if (handleDataFault(pRegistry)) return SUCCESS;
600  else return NO_DATA_LOADER;
601  }
602  if ( !pRegistry ) { // Precondition: Directory must be valid
603  if (handleDataFault(pRegistry)) return SUCCESS;
604  else return INVALID_OBJ_ADDR;
605  }
606 
607  VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
608 
609  if ( m_enableAccessHdlr ) {
610  // Fire data access incident
611  DataIncident incident(name(), m_accessName, pRegistry->identifier());
612  m_incidentSvc->fireIncident(incident);
613  }
614  if ( !m_inhibitPathes.empty() ) {
615  auto inhibit = std::find(m_inhibitPathes.begin(), m_inhibitPathes.end(),
616  pRegistry->identifier());
617  if ( inhibit != m_inhibitPathes.end() ) {
618  return NO_ACCESS;
619  }
620  }
621  IOpaqueAddress* pAddress = pRegistry->address();
622  if ( !pAddress ) { // Precondition:
623  return INVALID_OBJ_ADDR; // Address must be valid
624  }
625  try {
626  status = pLoader->createObj(pAddress, pObject); // Call data loader
627  if ( status.isSuccess() ) {
628 
629  VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
630 
631  RegEntry *pEntry = CAST_REGENTRY(RegEntry*,pRegistry);
632  pEntry->setObject(pObject);
633 
634  VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
635  status = pLoader->fillObjRefs(pAddress, pObject);
636  }
637  }
638  catch( const GaudiException& exc ) {
639  if ( handleDataFault(pRegistry) ) {
640  return SUCCESS;
641  }
642  throw GaudiException("GaudiException in loadObject() " + pRegistry->identifier(),
643  name(), StatusCode::FAILURE, exc);
644  }
645  catch( const std::exception& x) {
646  if ( handleDataFault(pRegistry) ) {
647  return SUCCESS;
648  }
649  throw GaudiException("std::exception in loadObject() " + pRegistry->identifier() +
650  ": " + System::typeinfoName(typeid(x)) + ", " + x.what(),
652  }
653  catch(...) {
654  if ( handleDataFault(pRegistry) ) {
655  return SUCCESS;
656  }
657  throw GaudiException("UNKN exception in loadObject() " + pRegistry->identifier(),
659  }
660  if ( !status.isSuccess() ) {
661  if ( handleDataFault(pRegistry) ) {
662  return StatusCode::SUCCESS;
663  }
664  }
665  ON_VERBOSE if ( status.isSuccess() ) {
666  verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
667  }
668  return status;
669 }
#define VERMSG
Definition: DataSvc.cpp:71
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:62
Define general base for Gaudi exception.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
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
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:56
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:72
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:70
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:34
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:548
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:387
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:34
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:387
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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 1130 of file DataSvc.cpp.

1130  {
1131  //unused: StatusCode sc = StatusCode::FAILURE;
1132  if ( pObject && depth++ < load_depth ) {
1133  RegEntry* dir = CAST_REGENTRY(RegEntry*,pObject->registry());
1134  if ( dir ) {
1135  for (const auto& i : *dir) {
1136  DataObject *pObj = nullptr;
1137  StatusCode status = retrieveObject(pObject, i->name(), pObj);
1138  if ( status.isSuccess() && depth < load_depth ) {
1139  preLoad(depth, load_depth, pObj).ignore();
1140  }
1141  }
1142  }
1143  }
1144  return StatusCode::SUCCESS;
1145 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1148
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:768
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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
virtual StatusCode DataSvc::preLoad ( )
virtual

load all preload items of the list

StatusCode DataSvc::preLoad ( )
virtual

load all preload items of the list

Definition at line 1148 of file DataSvc.cpp.

1148  {
1149  DataObject* pObj = nullptr;
1150  for (const auto& i : m_preLoads ) {
1151  StatusCode sc = retrieveObject( i.path(), pObj);
1152  int load_depth = i.depth();
1153  if ( sc.isSuccess() && load_depth > 1 ) {
1154  preLoad(1, load_depth, pObj).ignore();
1155  }
1156  }
1157  return StatusCode::SUCCESS;
1158 }
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:58
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1148
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:768
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
virtual StatusCode DataSvc::registerAddress ( const std::string &  fullPath,
IOpaqueAddress pAddress 
)
virtual

IDataManagerSvc: Register object address with the data store.

StatusCode DataSvc::registerAddress ( const std::string &  fullPath,
IOpaqueAddress pAddress 
)
virtual

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:66
constexpr char SEPARATOR
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:244
StatusCode DataSvc::registerAddress ( DataObject parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

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 }
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
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
virtual StatusCode DataSvc::registerAddress ( DataObject parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

IDataManagerSvc: Register object address with the data store.

StatusCode DataSvc::registerAddress ( IRegistry parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

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 ( 0 == 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:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
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:52
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:356
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
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:60
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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:1216
virtual StatusCode DataSvc::registerAddress ( IRegistry parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

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:768
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:60
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:1216
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 ( 0 == 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 ( 0 != par_entry && par_entry->object() == 0 ) {
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  else {
456  pObject->setRegistry(leaf);
457  }
458  leaf->setAddress(nullptr);
459  leaf->setObject(pObject);
460  status = StatusCode::SUCCESS;
461  }
462  else {
463  status = DOUBL_OBJ_PATH;
464  }
465  }
466  }
467  return status;
468  }
469  return INVALID_PARENT;
470 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
constexpr char SEPARATOR
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
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:52
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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:678
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:60
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
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:1216
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 1173 of file DataSvc.cpp.

1173  {
1174  // the finalize part is copied here
1175  setDataLoader(nullptr).ignore();
1176  resetPreLoad().ignore();
1177  clearStore().ignore();
1178  m_incidentSvc.reset();
1179  // re-initialize the base class
1181  if ( UNLIKELY(!sc.isSuccess()) ) {
1182  error() << "Unable to reinitialize base class" << endmsg;
1183  return sc;
1184  }
1185  // the initialize part is copied here
1186  m_incidentSvc = service("IncidentSvc", true);
1187  if ( UNLIKELY(!m_incidentSvc) ) {
1188  error() << "Failed to access incident service." << endmsg;
1189  return StatusCode::FAILURE;
1190  }
1191  // return
1192  return StatusCode::SUCCESS;
1193 }
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:56
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1124
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode setDataLoader(IConversionSvc *svc) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:202
StatusCode reinitialize() override
Definition: Service.cpp:282
#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 clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:114
StatusCode DataSvc::reinitialize ( )
override

Service initialization.

virtual StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
virtual

Remove an item from the preload list.

StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
virtual

Remove an item from the preload list.

Definition at line 1112 of file DataSvc.cpp.

1112  {
1114  std::end(m_preLoads));
1115  return StatusCode::SUCCESS;
1116 }
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:58
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
StatusCode DataSvc::removePreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

Definition at line 1119 of file DataSvc.cpp.

1119  {
1120  return removePreLoadItem( DataStoreItem(itemPath,1) );
1121 }
virtual StatusCode removePreLoadItem(const DataStoreItem &item)
Remove an item from the preload list.
Definition: DataSvc.cpp:1112
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
virtual StatusCode DataSvc::removePreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

virtual StatusCode DataSvc::resetPreLoad ( )
virtual

Clear the preload list.

StatusCode DataSvc::resetPreLoad ( )
virtual

Clear the preload list.

Definition at line 1124 of file DataSvc.cpp.

1124  {
1126  return StatusCode::SUCCESS;
1127 }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:58
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 672 of file DataSvc.cpp.

674  {
675  return i_retrieveEntry(parentObj,path,pEntry);
676 }
list path
Definition: __init__.py:15
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:678
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 768 of file DataSvc.cpp.

770  {
771  pObject = nullptr;
772  RegEntry *result = nullptr, *parent = CAST_REGENTRY(RegEntry*,pRegistry);
773  StatusCode status = i_retrieveEntry(parent, path, result);
774  if ( status.isSuccess() ) pObject = result->object();
775  return status;
776 }
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:678
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:34
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 779 of file DataSvc.cpp.

780  {
781  IRegistry* nullDir = nullptr;
782  return retrieveObject(nullDir, fullPath, pObject);
783 }
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:768
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 786 of file DataSvc.cpp.

788  {
789  DataObject* parent = nullptr;
790  StatusCode status = retrieveObject(parentPath, parent);
791  return status.isSuccess() ? retrieveObject (parent, objectPath, pObject)
792  : status;
793 }
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:768
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 796 of file DataSvc.cpp.

798  {
799  return retrieveObject(parentPath, itemToPath(item), pObject);
800 }
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:768
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 803 of file DataSvc.cpp.

805  {
806  IRegistry* pRegistry = (parentObj ? parentObj->registry() : nullptr);
807  return retrieveObject(pRegistry, path, pObject);
808 }
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:768
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 811 of file DataSvc.cpp.

813  {
814  return retrieveObject(parentObj, itemToPath(item), pObject);
815 }
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:768
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 1206 of file DataSvc.cpp.

1206  {
1207  return( (CLID)m_rootCLID );
1208 }
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:50
const std::string & DataSvc::rootName ( ) const
override

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1211 of file DataSvc.cpp.

1211  {
1212  return m_rootName;
1213 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:52
const std::string& DataSvc::rootName ( ) const
override

IDataManagerSvc: Accessor for root event name.

StatusCode DataSvc::setDataLoader ( IConversionSvc svc)
override

IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.

StatusCode DataSvc::setDataLoader ( IConversionSvc svc)
override

IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 202 of file DataSvc.cpp.

202  {
203  if ( pDataLoader ) pDataLoader->setDataProvider(this).ignore();
204  m_dataLoader = pDataLoader;
205  return SUCCESS;
206 }
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:54
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:833
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:387
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:34
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:66
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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 1043 of file DataSvc.cpp.

1044  {
1045  if ( checkRoot() ) {
1046  try {
1047  RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1048  if ( from_entry ) {
1049  std::string::size_type sep = objPath.rfind(SEPARATOR);
1050  if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1051  DataObject* pO = nullptr;
1052  StatusCode sc = findObject(from, objPath.substr(0,sep), pO);
1053  if ( sc.isSuccess() ) {
1054  sc = unlinkObject(pO->registry(), objPath.substr(sep));
1055  }
1056  return sc;
1057  }
1058  StatusCode status = from_entry->remove( objPath );
1059  if ( status.isSuccess() ) return status;
1060  return INVALID_OBJ_PATH;
1061  }
1062  }
1063  catch (...) {
1064  }
1065  return INVALID_PARENT;
1066  }
1067  return INVALID_ROOT;
1068 }
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:387
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:833
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1043
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 1081 of file DataSvc.cpp.

1082  {
1083  DataObject* pObject = nullptr;
1084  StatusCode status = findObject(from, pObject);
1085  return status.isSuccess() ? unlinkObject(pObject->registry(), objPath)
1086  : status;
1087 }
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:833
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1043
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 1090 of file DataSvc.cpp.

1091  {
1092  if ( !checkRoot() ) return INVALID_ROOT;
1093  IRegistry* from_entry = m_root->findLeaf(from);
1094  return unlinkObject(from_entry, objPath);
1095 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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:1043
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 1071 of file DataSvc.cpp.

1071  {
1072  if ( fullPath.empty() ) return INVALID_OBJ_PATH;
1073  if ( fullPath.front() != SEPARATOR ) {
1074  return unlinkObject(m_rootName, fullPath);
1075  }
1076  auto sep = fullPath.rfind(SEPARATOR);
1077  return unlinkObject(fullPath.substr(0,sep), fullPath.substr(sep));
1078 }
constexpr char SEPARATOR
std::string m_rootName
Name of root event.
Definition: DataSvc.h:52
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: DataSvc.cpp:1043
virtual StatusCode DataSvc::unregisterAddress ( const std::string &  fullPath)
virtual

IDataManagerSvc: Unregister object address from the data store.

StatusCode DataSvc::unregisterAddress ( const std::string &  fullPath)
virtual

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:66
constexpr char SEPARATOR
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307
virtual StatusCode DataSvc::unregisterAddress ( DataObject pParent,
const std::string &  objPath 
)
virtual

IDataManagerSvc: Unregister object address from the data store.

StatusCode DataSvc::unregisterAddress ( DataObject pParent,
const std::string &  objPath 
)
virtual

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
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307
StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
const std::string &  objPath 
)
virtual

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:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
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:52
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:63
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
virtual IRegistry * parent() const
Pointer to parent directory entry.
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:307
virtual StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
const std::string &  objPath 
)
virtual

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

473  {
474  DataObject* pObject = nullptr;
475  StatusCode status = findObject(fullPath, pObject);
476  if ( status.isFailure() ) return status;
477  RegEntry* pEntry = CAST_REGENTRY(RegEntry*,pObject->registry());
478  if ( !pEntry ) return INVALID_ROOT;
479  if ( !pEntry->isEmpty() ) return DIR_NOT_EMPTY;
480  RegEntry* pParent = pEntry->parentEntry();
481  if ( !pParent ) return INVALID_PARENT;
482  if ( pObject ) pObject->addRef();
483  pParent->remove(pEntry);
484  return StatusCode::SUCCESS;
485 }
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:87
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:833
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:34
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 488 of file DataSvc.cpp.

489  {
490  DataObject* pO = nullptr;
491  StatusCode status = findObject(parentPath, pO);
492  return status.isSuccess() ? unregisterObject(pO, objPath) : status;
493 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:473
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:833
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 496 of file DataSvc.cpp.

496  {
497  return unregisterObject(parentPath, itemToPath(item));
498 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:473
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 501 of file DataSvc.cpp.

501  {
502  if ( !checkRoot() ) return INVALID_ROOT;
503  RegEntry* entry = m_root->findLeaf(pObject);
504  if ( !entry ) return INVALID_OBJECT;
505  RegEntry* parent = entry->parentEntry();
506  if ( !parent ) return INVALID_PARENT;
507  if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
508  if ( entry->object() ) entry->object()->addRef();
509  if ( parent ) parent->remove(entry);
510  return SUCCESS;
511 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:66
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:87
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:34
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 514 of file DataSvc.cpp.

515  {
516  if ( checkRoot() ) {
517  try {
518  RegEntry* parent = CAST_REGENTRY(RegEntry*,pParentObj->registry());
519  if ( parent ) {
520  RegEntry* entry = parent->findLeaf(objectPath);
521  if ( entry ) {
522  if ( entry->isEmpty() ) {
523  if ( entry->object() ) {
524  entry->object()->addRef();
525  }
526  parent->remove(entry);
527  return SUCCESS;
528  }
529  return DIR_NOT_EMPTY;
530  }
531  return INVALID_OBJECT;
532  }
533  }
534  catch(...) {
535  }
536  return INVALID_PARENT;
537  }
538  return INVALID_ROOT;
539 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:91
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:387
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:34
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 542 of file DataSvc.cpp.

542  {
543  return unregisterObject(pParentObj, itemToPath(item));
544 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:473
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 889 of file DataSvc.cpp.

889  {
890  if ( !pRegistry ) { // Precondition:
891  return INVALID_OBJ_ADDR; // Addres must be valid
892  }
893  DataObject* toUpdate = pRegistry->object();
894  if ( !toUpdate ) { // Try first to load
895  return loadObject(pRegistry);
896  }
897  return updateObject(toUpdate);
898 }
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:587
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:889
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 881 of file DataSvc.cpp.

881  {
882  DataObject* pO = nullptr;
883  StatusCode status = findObject(updatePath, pO);
884  return status.isSuccess() ? updateObject(pO)
885  : retrieveObject(updatePath, pO);
886 }
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:833
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:768
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:889
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 901 of file DataSvc.cpp.

901  {
902  StatusCode status = INVALID_OBJ_ADDR;
903  if ( !toUpdate ) { // Precondition:
904  return INVALID_OBJECT; // Address must be valid
905  }
906  IRegistry* pRegistry = toUpdate->registry(); // Precondition:
907  if ( !pRegistry ) { // Need valid registry
908  return INVALID_OBJECT;
909  }
910  IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
911  if ( !pAddress ) { // Need valid address
912  return INVALID_OBJ_ADDR;
913  }
914  IConversionSvc* pLoader = getDataLoader(pRegistry);
915  if ( !pLoader ) { // Precondition:
916  return NO_DATA_LOADER; // Data loader must be present
917  }
918  if ( !m_inhibitPathes.empty() ) {
919  auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(),
920  pRegistry->identifier());
921  if ( inhibit != m_inhibitPathes.end() ) {
922  return NO_ACCESS;
923  }
924  }
925  try {
926  status = pLoader->updateObj(pAddress, toUpdate); // Call data loader
927  if ( status.isSuccess() ) {
928  status = pLoader->updateObjRefs(pAddress, toUpdate);
929  }
930  }
931  catch( const GaudiException& exc ) {
932  throw GaudiException("GaudiException in updateObject() " +
933  pRegistry->name(),
934  name(),
935  StatusCode::FAILURE, exc);
936  }
937  catch( const std::exception& x) {
938  throw GaudiException("std::exception in updateObject() " +
939  pRegistry->name() + ": " +
940  System::typeinfoName(typeid(x)) + ", " +
941  x.what(),
943  }
944  catch(...) {
945  throw GaudiException("UNKN exception in updateObject() " +
946  pRegistry->name(),
948  }
949  return status;
950 }
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:299
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:70
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:1223
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 953 of file DataSvc.cpp.

954  {
955  DataObject* pParent = nullptr;
956  StatusCode status = findObject(parentPath, pParent);
957  return status.isSuccess() ? updateObject( pParent, updatePath)
958  : status;
959 }
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:833
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:889
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 962 of file DataSvc.cpp.

963  {
964  DataObject* pObject = nullptr;
965  StatusCode status = findObject(parent, updatePath, pObject);
966  return status.isSuccess() ? updateObject(pObject)
967  : status;
968 }
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:833
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: DataSvc.cpp:889
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 72 of file DataSvc.h.

SmartIF< IConversionSvc > DataSvc::m_dataLoader = nullptr
protected

Pointer to data loader service.

Definition at line 54 of file DataSvc.h.

bool DataSvc::m_enableAccessHdlr = false
protected

Flag to enable interrupts on data access requests.

Definition at line 62 of file DataSvc.h.

bool DataSvc::m_enableFaultHdlr = false
protected

Flag to enable interrupts on data creation requests.

Definition at line 64 of file DataSvc.h.

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

Name of the data fault incident.

Definition at line 74 of file DataSvc.h.

bool DataSvc::m_forceLeaves = false
protected

Allow forced creation of default leaves on registerObject.

Definition at line 60 of file DataSvc.h.

SmartIF< IIncidentSvc > DataSvc::m_incidentSvc = nullptr
protected

Pointer to incident service.

Definition at line 56 of file DataSvc.h.

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

Map with object paths to be inhibited from loading.

Definition at line 68 of file DataSvc.h.

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

Property for the inhibited leaves.

Definition at line 70 of file DataSvc.h.

LoadItems DataSvc::m_preLoads
protected

Items to be pre-loaded.

Definition at line 58 of file DataSvc.h.

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

Pointer to root entry.

Definition at line 66 of file DataSvc.h.

CLID DataSvc::m_rootCLID = 110
protected

Integer Property corresponding to CLID of root entry.

Definition at line 50 of file DataSvc.h.

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

Name of root event.

Definition at line 52 of file DataSvc.h.


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