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 extends2< Service, IDataProviderSvc, IDataManagerSvc >
typedef extends2 base_class
 Typedef to this class. More...
 
typedef extends2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2< IDataProviderSvc, IDataManagerSvcextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces2< IDataProviderSvc, IDataManagerSvcextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3< IService, IProperty, IStatefulextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces3< IService, IProperty, IStatefulextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename IService::iid::iids::type, typename mpl::fold< typename IProperty::iid::iids::type, typename IStateful::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef mpl::fold< typename IService::iid::iids::type, typename mpl::fold< typename IProperty::iid::iids::type, typename IStateful::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces2< IDataProviderSvc, IDataManagerSvc >
typedef mpl::fold< typename IDataProviderSvc::iid::iids::type, typename IDataManagerSvc::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef mpl::fold< typename IDataProviderSvc::iid::iids::type, typename IDataManagerSvc::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IDataProviderSvc
enum  { SEPARATOR = '/' }
 
enum  Status {
  IDataProviderSvc_NO_ERROR = 1, DOUBL_OBJ_PATH, INVALID_OBJ_PATH, INVALID_ROOT,
  INVALID_OBJECT, INVALID_PARENT, OBJ_NOT_LOADED, NO_DATA_LOADER,
  INVALID_OBJ_ADDR, DIR_NOT_EMPTY, NO_MORE_LEVELS, NO_ACCESS,
  LAST, IDataProviderSvc_NO_ERROR = 1, DOUBL_OBJ_PATH, INVALID_OBJ_PATH,
  INVALID_ROOT, INVALID_OBJECT, INVALID_PARENT, OBJ_NOT_LOADED,
  NO_DATA_LOADER, INVALID_OBJ_ADDR, DIR_NOT_EMPTY, NO_MORE_LEVELS,
  NO_ACCESS, LAST
}
 Status code definitions. More...
 
enum  { SEPARATOR = '/' }
 
enum  Status {
  IDataProviderSvc_NO_ERROR = 1, DOUBL_OBJ_PATH, INVALID_OBJ_PATH, INVALID_ROOT,
  INVALID_OBJECT, INVALID_PARENT, OBJ_NOT_LOADED, NO_DATA_LOADER,
  INVALID_OBJ_ADDR, DIR_NOT_EMPTY, NO_MORE_LEVELS, NO_ACCESS,
  LAST, IDataProviderSvc_NO_ERROR = 1, DOUBL_OBJ_PATH, INVALID_OBJ_PATH,
  INVALID_ROOT, INVALID_OBJECT, INVALID_PARENT, OBJ_NOT_LOADED,
  NO_DATA_LOADER, INVALID_OBJ_ADDR, DIR_NOT_EMPTY, NO_MORE_LEVELS,
  NO_ACCESS, LAST
}
 Status code definitions. More...
 

Public Member Functions

virtual CLID rootCLID () const
 IDataManagerSvc: Accessor for root event CLID. More...
 
virtual std::string rootName () const
 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...
 
virtual StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode clearSubTree (const std::string &sub_tree_path)
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode clearSubTree (DataObject *pObject)
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
 
virtual StatusCode clearStore ()
 IDataManagerSvc: Remove all data objects in the data store. More...
 
virtual StatusCode traverseSubTree (const std::string &sub_tree_path, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
virtual StatusCode traverseTree (IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
virtual StatusCode setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode setDataLoader (IConversionSvc *svc)
 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...
 
virtual StatusCode registerObject (const std::string &fullPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode unregisterObject (const std::string &fullPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, int item)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, int item)
 Unregister object from the data store. More...
 
virtual StatusCode retrieveObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode findObject (const std::string &fullPath, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode linkObject (IRegistry *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (DataObject *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fullPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode unlinkObject (IRegistry *from, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fromPath, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (DataObject *fromObj, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fullPath)
 Remove a link to another object. More...
 
virtual StatusCode updateObject (IRegistry *pDirectory)
 Update object identified by its directory entry. More...
 
virtual StatusCode updateObject (const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *toUpdate)
 Update object. More...
 
virtual StatusCode updateObject (const std::string &parentPath, const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *pParent, const std::string &updatePath)
 Update object. More...
 
virtual StatusCode initialize ()
 Service initialization. More...
 
virtual StatusCode reinitialize ()
 Service initialization. More...
 
virtual StatusCode finalize ()
 Service initialization. More...
 
 DataSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~DataSvc ()
 Standard Destructor. More...
 
virtual CLID rootCLID () const
 IDataManagerSvc: Accessor for root event CLID. More...
 
virtual std::string rootName () const
 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...
 
virtual StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode clearSubTree (const std::string &sub_tree_path)
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode clearSubTree (DataObject *pObject)
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
 
virtual StatusCode clearStore ()
 IDataManagerSvc: Remove all data objects in the data store. More...
 
virtual StatusCode traverseSubTree (const std::string &sub_tree_path, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
virtual StatusCode traverseTree (IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
virtual StatusCode setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode setDataLoader (IConversionSvc *svc)
 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...
 
virtual StatusCode registerObject (const std::string &fullPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode unregisterObject (const std::string &fullPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, int item)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, int item)
 Unregister object from the data store. More...
 
virtual StatusCode retrieveObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode findObject (const std::string &fullPath, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode linkObject (IRegistry *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (DataObject *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fullPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode unlinkObject (IRegistry *from, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fromPath, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (DataObject *fromObj, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fullPath)
 Remove a link to another object. More...
 
virtual StatusCode updateObject (IRegistry *pDirectory)
 Update object identified by its directory entry. More...
 
virtual StatusCode updateObject (const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *toUpdate)
 Update object. More...
 
virtual StatusCode updateObject (const std::string &parentPath, const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *pParent, const std::string &updatePath)
 Update object. More...
 
virtual StatusCode initialize ()
 Service initialization. More...
 
virtual StatusCode reinitialize ()
 Service initialization. More...
 
virtual StatusCode finalize ()
 Service initialization. More...
 
 DataSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~DataSvc ()
 Standard Destructor. More...
 
- Public Member Functions inherited from extends2< Service, IDataProviderSvc, IDataManagerSvc >
 extends2 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends2 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends2 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends2 ()
 Default constructor. More...
 
 extends2 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends2 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends2 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends2 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends2 ()
 Virtual destructor. More...
 
virtual ~extends2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector< Property * > & getProperties () const
 Get list of properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Return true if we have a property with the given name. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector< Property * > & getProperties () const
 Get list of properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Return true if we have a property with the given name. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- Public Member Functions inherited from extend_interfaces2< IDataProviderSvc, IDataManagerSvc >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IDataProviderSvc
 DeclareInterfaceID (IDataProviderSvc, 3, 0)
 InterfaceID. More...
 
virtual ~IDataProviderSvc ()
 virtual destructor More...
 
 DeclareInterfaceID (IDataProviderSvc, 3, 0)
 InterfaceID. More...
 
virtual ~IDataProviderSvc ()
 virtual destructor More...
 
- Public Member Functions inherited from IDataManagerSvc
 DeclareInterfaceID (IDataManagerSvc, 2, 0)
 InterfaceID. More...
 
 DeclareInterfaceID (IDataManagerSvc, 2, 0)
 InterfaceID. 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 Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

CLID m_rootCLID
 Integer Property corresponding to CLID of root entry. More...
 
std::string m_rootName
 Name of root event. More...
 
IConversionSvcm_dataLoader
 Pointer to data loader service. More...
 
IIncidentSvcm_incidentSvc
 Pointer to incident service. More...
 
LoadItems m_preLoads
 Items to be pre-loaded. More...
 
bool m_forceLeaves
 Allow forced creation of default leaves on registerObject. More...
 
bool m_enableAccessHdlr
 Flag to enable interrupts on data access requests. More...
 
bool m_enableFaultHdlr
 Flag to enable interrupts on data creation requests. More...
 
DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry. More...
 
DataSvcHelpers::InhibitMap * m_inhibitMap
 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
 Name of the data access incident. More...
 
std::string m_faultName
 Name of the data fault incident. More...
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Private Member Functions

 DataSvc (const DataSvc &)
 Fake copy constructor (never implemented). More...
 
DataSvcoperator= (const DataSvc &)
 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 &)
 Fake copy constructor (never implemented). More...
 
DataSvcoperator= (const DataSvc &)
 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{})
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

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 40 of file DataSvc.h.

Member Typedef Documentation

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

Define set of load items.

Definition at line 44 of file DataSvc.h.

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

Define set of load items.

Definition at line 44 of file DataSvc.h.

Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 1276 of file DataSvc.cpp.

1277 : base_class(name,svc), m_rootCLID( /*CLID_Event*/ 110),
1278  m_rootName( "/Event"), m_root(nullptr)
1279 {
1280  m_dataLoader = nullptr;
1281  m_inhibitMap = 0;
1282  m_incidentSvc = nullptr;
1283  m_forceLeaves = false;
1284  m_enableFaultHdlr = false;
1285  m_enableAccessHdlr = false;
1286  m_faultName = "DataFault";
1287  m_accessName = "DataAccess";
1288  declareProperty("RootCLID", m_rootCLID);
1289  declareProperty("RootName", m_rootName);
1290  declareProperty("ForceLeaves", m_forceLeaves);
1291  declareProperty("InhibitPathes", m_inhibitPathes);
1292  declareProperty("DataFaultName", m_faultName);
1293  declareProperty("DataAccessName", m_accessName);
1294  declareProperty("EnableFaultHandler", m_enableFaultHdlr);
1295  declareProperty("EnableAccessHandler", m_enableAccessHdlr);
1296 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:60
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:62
DataSvcHelpers::InhibitMap * m_inhibitMap
Map with object paths to be inhibited from loading.
Definition: DataSvc.h:66
extends2 base_class
Typedef to this class.
Definition: extends.h:77
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:70
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:68
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:58
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:52
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:72
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:48
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:212
DataSvc::~DataSvc ( )
virtual

Standard Destructor.

Definition at line 1299 of file DataSvc.cpp.

1299  {
1300  setDataLoader(nullptr).ignore();
1301  resetPreLoad().ignore();
1302  clearStore().ignore();
1303 }
virtual StatusCode setDataLoader(IConversionSvc *svc)
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:203
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1164
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:115
void ignore() const
Definition: StatusCode.h:107
DataSvc::DataSvc ( const DataSvc )
private

Fake copy constructor (never implemented).

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

Standard Constructor.

virtual DataSvc::~DataSvc ( )
virtual

Standard Destructor.

DataSvc::DataSvc ( const DataSvc )
private

Fake copy constructor (never implemented).

Member Function Documentation

StatusCode DataSvc::addPreLoadItem ( const DataStoreItem item)
virtual

Add an item to the preload list.

Implements IDataProviderSvc.

Definition at line 1138 of file DataSvc.cpp.

1138  {
1139  auto i = std::find(std::begin(m_preLoads), std::end(m_preLoads), item);
1140  if ( i == std::end(m_preLoads) ) {
1141  m_preLoads.push_back(item);
1142  }
1143  return StatusCode::SUCCESS;
1144 }
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:56
tuple end
Definition: IOTest.py:101
list i
Definition: ana.py:128
virtual StatusCode DataSvc::addPreLoadItem ( const DataStoreItem item)
virtual

Add an item to the preload list.

Implements IDataProviderSvc.

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

Add an item to the preload list.

Implements IDataProviderSvc.

Definition at line 1147 of file DataSvc.cpp.

1147  {
1148  return addPreLoadItem( DataStoreItem(itemPath,1) );
1149 }
Description of the DataStoreItem class.
Definition: DataStoreItem.h:18
virtual StatusCode addPreLoadItem(const DataStoreItem &item)
Add an item to the preload list.
Definition: DataSvc.cpp:1138
virtual StatusCode DataSvc::addPreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

Implements IDataProviderSvc.

bool DataSvc::checkRoot ( )
inlineprotected

Check if root path is valid.

Definition at line 385 of file DataSvc.h.

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

Check if root path is valid.

Definition at line 385 of file DataSvc.h.

385  {
386  return 0 != m_root;
387  }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual StatusCode DataSvc::clearStore ( )
virtual

IDataManagerSvc: Remove all data objects in the data store.

Implements IDataManagerSvc.

Reimplemented in DetDataSvc.

StatusCode DataSvc::clearStore ( )
virtual

IDataManagerSvc: Remove all data objects in the data store.

Implements IDataManagerSvc.

Reimplemented in DetDataSvc.

Definition at line 115 of file DataSvc.cpp.

115  {
116  if ( checkRoot() ) {
117  m_root->release();
118  m_root = nullptr;
119  return SUCCESS;
120  }
121  return INVALID_ROOT;
122 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual unsigned long release()
IInterface implementation: Reference the object.
Normal successful completion.
Definition: IInterface.h:219
virtual StatusCode DataSvc::clearSubTree ( const std::string &  sub_tree_path)
virtual

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

Implements IDataManagerSvc.

StatusCode DataSvc::clearSubTree ( const std::string &  sub_tree_path)
virtual

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

Implements IDataManagerSvc.

Definition at line 77 of file DataSvc.cpp.

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

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

Implements IDataManagerSvc.

StatusCode DataSvc::clearSubTree ( DataObject pObject)
virtual

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

Implements IDataManagerSvc.

Definition at line 98 of file DataSvc.cpp.

98  {
99  if ( checkRoot() ) {
100  RegEntry* entry = CAST_REGENTRY(RegEntry*,pObject->registry());
101  if ( entry ) {
102  RegEntry* parent = entry->parentEntry();
103  if ( parent ) {
104  parent->remove(entry);
105  return SUCCESS;
106  }
107  return INVALID_PARENT;
108  }
109  return INVALID_OBJECT;
110  }
111  return INVALID_ROOT;
112 }
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual long remove(const std::string &name)
Remove an entry from the store.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:88
Normal successful completion.
Definition: IInterface.h:219
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Pointer to parent object is not valid.
Object pointer is invalid.
DataObject * DataSvc::createDefaultObject ( ) const
protectedvirtual

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

Definition at line 1264 of file DataSvc.cpp.

1264  {
1265  return new DataObject();
1266 }
virtual DataObject* DataSvc::createDefaultObject ( ) const
protectedvirtual

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

StatusCode DataSvc::finalize ( )
virtual

Service initialization.

Service initialisation.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, TagCollectionSvc, RecordDataSvc, and EvtDataSvc.

Definition at line 1241 of file DataSvc.cpp.

1241  {
1242  // Nothing to do: just call base class initialisation
1243  setDataLoader(nullptr).ignore();
1244  resetPreLoad().ignore();
1245  clearStore().ignore();
1246  if ( m_incidentSvc ) {
1248  m_incidentSvc = nullptr;
1249  }
1250  return Service::finalize();
1251 }
virtual StatusCode setDataLoader(IConversionSvc *svc)
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:203
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1164
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:115
void ignore() const
Definition: StatusCode.h:107
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:197
virtual StatusCode DataSvc::finalize ( )
virtual

Service initialization.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, TagCollectionSvc, RecordDataSvc, and EvtDataSvc.

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

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

Implements IDataProviderSvc.

Definition at line 855 of file DataSvc.cpp.

856  {
857  pObject = nullptr;
858  if ( checkRoot() ) {
859  if ( path.empty() || path == m_rootName ) {
860  pObject = m_root->object();
861  return (0 == pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
862  }
863  else if ( path.front() != SEPARATOR ) {
864  return findObject(m_rootName, path, pObject);
865  }
866  return findObject((IRegistry*)nullptr, path, pObject);
867  }
868  return INVALID_ROOT;
869 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
list path
Definition: __init__.py:15
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
Sorry, the requested object is not loaded.
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
Retrive object behind the link.
virtual StatusCode DataSvc::findObject ( const std::string &  fullPath,
DataObject *&  pObject 
)
virtual

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

Implements IDataProviderSvc.

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

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

Implements IDataProviderSvc.

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

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

Retrieve object identified by its directory from the data store.

Implements IDataProviderSvc.

Definition at line 836 of file DataSvc.cpp.

838  {
839  pObject = nullptr;
840  IRegistry* pReg = ( pRegistry ? pRegistry : m_root );
841  RegEntry* root_entry = CAST_REGENTRY(RegEntry*, pReg);
842  if ( root_entry ) {
843  if ( !path.empty() ) {
844  pReg = root_entry->find(path);
845  }
846  if ( !pReg ) {
847  return INVALID_OBJ_PATH;
848  }
849  pObject = pReg->object();
850  }
851  return (!pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
852 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
list path
Definition: __init__.py:15
Sorry, the requested object is not loaded.
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:64
Invalid path from root to object request failed.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
virtual StatusCode DataSvc::findObject ( const std::string &  parentPath,
const std::string &  objPath,
DataObject *&  pObject 
)
virtual

Find object in the data store.

Implements IDataProviderSvc.

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

Find object in the data store.

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

Implements IDataProviderSvc.

Definition at line 872 of file DataSvc.cpp.

874  {
875  DataObject* parent = nullptr;
876  StatusCode status = findObject(parentPath, parent);
877  if ( status.isSuccess() ) {
878  status = findObject (parent, objectPath, pObject);
879  }
880  return status;
881 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::findObject ( const std::string &  parentPath,
int  item,
DataObject *&  pObject 
)
virtual

Find object in the data store.

Implements IDataProviderSvc.

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

Find object in the data store.

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

Implements IDataProviderSvc.

Definition at line 884 of file DataSvc.cpp.

885  {
886  return findObject(parentPath, itemToPath(item), pObject);
887 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::findObject ( DataObject parentObj,
const std::string &  objPath,
DataObject *&  pObject 
)
virtual

Find object in the data store.

Implements IDataProviderSvc.

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

Find object in the data store.

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

Implements IDataProviderSvc.

Definition at line 897 of file DataSvc.cpp.

899  {
900  IRegistry* pDir = ( parentObj ? parentObj->registry() : nullptr );
901  return findObject(pDir, path, pObject);
902 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
list path
Definition: __init__.py:15
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode DataSvc::findObject ( DataObject parentObj,
int  item,
DataObject *&  pObject 
)
virtual

Find object in the data store.

Implements IDataProviderSvc.

StatusCode DataSvc::findObject ( DataObject parentObj,
int  item,
DataObject *&  pObject 
)
virtual

Find object in the data store.

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

Implements IDataProviderSvc.

Definition at line 890 of file DataSvc.cpp.

892  {
893  return findObject(parentObj, itemToPath(item), pObject);
894 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
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.

Reimplemented in NTupleSvc.

Definition at line 1271 of file DataSvc.cpp.

1271  {
1272  return m_dataLoader;
1273 }
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:52
virtual IConversionSvc* DataSvc::getDataLoader ( IRegistry pReg)
protectedvirtual

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

Reimplemented in NTupleSvc.

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

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

567 {
568  if ( m_enableFaultHdlr ) {
569  IRegistry* pLeaf = nullptr;
570  if ( pReg && path.empty() ) {
571  DataIncident incident(name(), m_faultName, pReg->identifier());
572  m_incidentSvc->fireIncident(incident);
573  return pReg->object();
574  }
575  else if ( pReg ) {
576  std::string p = pReg->identifier();
577  if (path.front() != SEPARATOR ) p += SEPARATOR;
578  p.append(path.data(),path.size());
579  DataIncident incident(name(), m_faultName, p);
580  m_incidentSvc->fireIncident(incident);
581  pLeaf = m_root->findLeaf(p);
582  }
583  else {
584  std::string p = m_root->identifier();
585  if (path.front() != SEPARATOR ) p += SEPARATOR;
586  p.append(path.data(),path.size());
587  DataIncident incident(name(), m_faultName, p);
588  m_incidentSvc->fireIncident(incident);
589  pLeaf = m_root->findLeaf(p);
590  }
591  if ( pLeaf ) {
592  return pLeaf->object();
593  }
594  }
595  return nullptr;
596 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:62
list path
Definition: __init__.py:15
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
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
virtual DataObject * object() const =0
Retrieve object behind the link.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
std::string m_faultName
Name of the data fault incident.
Definition: DataSvc.h:72
virtual const std::string & identifier() const
Full identifier (or key)
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 692 of file DataSvc.cpp.

694  {
695  // A.Valassi 16.08.2001 avoid core dump if store is empty
696  if ( !checkRoot() ) return StatusCode(INVALID_ROOT,true);
697 
698  static const auto empty = boost::string_ref{};
699  auto sep = find(path,SEPARATOR,1);
700  pEntry = nullptr;
701 
702  if ( !parentObj ) {
703  if ( path.empty() || path == m_rootName ) {
704  parentObj = m_root;
705  path = empty;
706  } else if ( path.front() != SEPARATOR ) {
707  parentObj = m_root;
708  } else if ( sep != boost::string_ref::npos ) {
709  if ( !m_root->object() ) {
710  RegEntry* r = nullptr;
711  auto status = i_retrieveEntry(m_root, empty, r);
712  if ( !status.isSuccess() ) return status;
713  }
714  parentObj = m_root;
715  path = path.substr(sep);
716  } else {
717  return INVALID_OBJ_PATH;
718  }
719  sep = find(path,SEPARATOR,1);
720  }
721 
722  StatusCode status = StatusCode(INVALID_ROOT,true);
723  if ( sep != boost::string_ref::npos ) { // the string contains a separator (after pos 0)
724  if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
725  status = loadObject(parentObj);
726  if ( !status.isSuccess() ) return status;
727  }
728  auto p_path = path.substr(0,sep);
729  RegEntry* root_entry = parentObj->findLeaf(p_path);
730  if ( !root_entry && m_enableFaultHdlr ) {
731  // If not even the parent is there, an incident
732  // to load the parent must be fired...
733  i_handleDataFault(parentObj, p_path);
734  root_entry = parentObj->findLeaf(p_path);
735  }
736  if ( root_entry ) {
737  DataObject* pO = root_entry->object();
738  if ( !pO ) {
739  // Object is not loaded: load the object if at all possible
740  status = loadObject(root_entry);
741  if ( !status.isSuccess() ) return status;
742  }
743  if ( root_entry->isSoft() ) {
744  root_entry = CAST_REGENTRY(RegEntry*,pO->registry());
745  }
746  return i_retrieveEntry(root_entry, path.substr(sep), pEntry);
747  }
748  return status;
749  } else if ( path.empty() ) {
750  pEntry = parentObj;
751  } else {
752  if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
753  status = loadObject(parentObj);
754  if ( !status.isSuccess() ) return status;
755  }
756  // last leave in search: find leaf and load
757  pEntry = parentObj->findLeaf(path);
758  // If no registry entry was found, trigger incident for action-on-demand
759  if ( !pEntry && m_enableFaultHdlr ) {
760  i_handleDataFault(parentObj, path);
761  pEntry = (path.empty() ? parentObj : parentObj->findLeaf(path) );
762  }
763  }
764 
765  // Check results and return
766  if ( !pEntry ) return INVALID_OBJ_PATH;
767  if ( !pEntry->object() ) return loadObject(pEntry);
768 
769  if ( m_enableAccessHdlr ) {
770  // Fire data access incident
771  // I do not know if this is a good idea....
772  // This fires too often!
773  //
774  //DataIncident incident(name(), m_accessName, pEntry->identifier());
775  //m_incidentSvc->fireIncident(incident);
776  return SUCCESS;
777  }
778  return SUCCESS;
779 }
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:60
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: DataSvc.h:62
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
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:601
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
DataObject * i_handleDataFault(IRegistry *pReg, boost::string_ref path=boost::string_ref{})
Definition: DataSvc.cpp:566
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
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:692
Normal successful completion.
Definition: IInterface.h:219
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Invalid path from root to object request failed.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual DataObject * object() const
Retrive object behind the link.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
StatusCode DataSvc::i_setRoot ( const 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 165 of file DataSvc.cpp.

166  {
167  if ( pRootObj ) {
168  m_root = new RegEntry(root_path);
169  m_root->makeHard(pRootObj);
170  m_root->setDataSvc(this);
171  preLoad().ignore();
172  }
173  return SUCCESS;
174 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1188
Normal successful completion.
Definition: IInterface.h:219
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:84
void ignore() const
Definition: StatusCode.h:107
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:66
void makeHard(DataObject *pObject)
Initialize link as hard link.
virtual StatusCode DataSvc::i_setRoot ( const 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 ( const 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 191 of file DataSvc.cpp.

192  {
193  if ( pRootAddr ) {
194  m_root = new RegEntry(root_path);
195  m_root->makeHard(pRootAddr);
196  m_root->setDataSvc(this);
197  preLoad().ignore();
198  }
199  return SUCCESS;
200 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1188
Normal successful completion.
Definition: IInterface.h:219
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:84
void ignore() const
Definition: StatusCode.h:107
DataSvcHelpers::RegistryEntry RegEntry
Definition: DataSvc.cpp:66
void makeHard(DataObject *pObject)
Initialize link as hard link.
virtual StatusCode DataSvc::i_setRoot ( const 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 ( )
virtual

Service initialization.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, TagCollectionSvc, RecordDataSvc, and EvtDataSvc.

Definition at line 1201 of file DataSvc.cpp.

1201  {
1202  // Nothing to do: just call base class initialisation
1204  if ( !sc.isSuccess() ) {
1205  return sc;
1206  }
1207  sc = service("IncidentSvc", m_incidentSvc, true);
1208  if ( UNLIKELY(!sc.isSuccess()) ) {
1209  error() << "Failed to access incident service." << endmsg;
1210  }
1211  return sc;
1212 }
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:75
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:72
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:143
#define UNLIKELY(x)
Definition: Kernel.h:127
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode DataSvc::initialize ( )
virtual

Service initialization.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, TagCollectionSvc, RecordDataSvc, and EvtDataSvc.

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

Add a link to another object.

Implements IDataProviderSvc.

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

Add a link to another object.

Implements IDataProviderSvc.

Definition at line 1001 of file DataSvc.cpp.

1002  {
1003  if ( checkRoot() ) {
1004  try {
1005  RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1006  if ( from_entry ) {
1007  // First check if both objects are already registered to the store
1008  RegEntry* to_entry = m_root->findLeaf(to);
1009  if ( !to_entry ) {
1010  return INVALID_OBJECT;
1011  }
1012  else {
1013  std::string::size_type sep = objPath.rfind(SEPARATOR);
1014  if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1015  DataObject* pO = nullptr;
1016  StatusCode sc = retrieveObject(from, objPath.substr(0,sep), pO);
1017  if ( sc.isSuccess() ) {
1018  sc = linkObject(pO->registry(), objPath.substr(sep), to);
1019  }
1020  return sc;
1021  }
1022  // Now register the soft link
1023  StatusCode status = from_entry->add( objPath, to, true);
1024  return status.isSuccess() ?
1026  }
1027  }
1028  }
1029  catch (...) {
1030  }
1031  return INVALID_PARENT;
1032  }
1033  return INVALID_ROOT;
1034 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
The path for this objects is already in use.
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to)
Add a link to another object.
Definition: DataSvc.cpp:1001
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Pointer to parent object is not valid.
Object pointer is invalid.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::linkObject ( const std::string &  fromPath,
const std::string &  objPath,
DataObject to 
)
virtual

Add a link to another object.

Implements IDataProviderSvc.

StatusCode DataSvc::linkObject ( const std::string &  fromPath,
const std::string &  objPath,
DataObject to 
)
virtual

Add a link to another object.

Implements IDataProviderSvc.

Definition at line 1050 of file DataSvc.cpp.

1052  {
1053  DataObject* pO = nullptr;
1054  StatusCode status = retrieveObject(from, pO);
1055  if ( status.isSuccess() ) {
1056  return linkObject(pO->registry(), objPath, to);
1057  }
1058  return status;
1059 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to)
Add a link to another object.
Definition: DataSvc.cpp:1001
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::linkObject ( DataObject from,
const std::string &  objPath,
DataObject to 
)
virtual

Add a link to another object.

Implements IDataProviderSvc.

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

Add a link to another object.

Implements IDataProviderSvc.

Definition at line 1062 of file DataSvc.cpp.

1064  {
1065  if ( from ) {
1066  IRegistry* from_entry = from->registry();
1067  if ( from_entry ) {
1068  return linkObject( from_entry, objPath, to);
1069  }
1070  }
1071  return INVALID_PARENT;
1072 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to)
Add a link to another object.
Definition: DataSvc.cpp:1001
Pointer to parent object is not valid.
virtual StatusCode DataSvc::linkObject ( const std::string &  fullPath,
DataObject to 
)
virtual

Add a link to another object.

Implements IDataProviderSvc.

StatusCode DataSvc::linkObject ( const std::string &  fullPath,
DataObject to 
)
virtual

Add a link to another object.

Implements IDataProviderSvc.

Definition at line 1037 of file DataSvc.cpp.

1038  {
1039  if ( !fullPath.empty() ) {
1040  if ( fullPath.front() != SEPARATOR ) {
1041  return linkObject(m_rootName, fullPath, to);
1042  }
1043  auto sep = fullPath.rfind(SEPARATOR);
1044  return linkObject( fullPath.substr( 0, sep), fullPath.substr(sep), to);
1045  }
1046  return INVALID_OBJ_PATH;
1047 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
Invalid path from root to object request failed.
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to)
Add a link to another object.
Definition: DataSvc.cpp:1001
StatusCode DataSvc::loadObject ( IRegistry pNode)
protectedvirtual

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

Definition at line 601 of file DataSvc.cpp.

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

609  {
610  StatusCode status = INVALID_OBJ_ADDR;
611  DataObject* pObject = nullptr;
612  if ( !pLoader ) { // Precondition: Data loader must be present
613  if (handleDataFault(pRegistry)) return SUCCESS;
614  else return NO_DATA_LOADER;
615  }
616  if ( !pRegistry ) { // Precondition: Directory must be valid
617  if (handleDataFault(pRegistry)) return SUCCESS;
618  else return INVALID_OBJ_ADDR;
619  }
620 
621  VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
622 
623  if ( m_enableAccessHdlr ) {
624  // Fire data access incident
625  DataIncident incident(name(), m_accessName, pRegistry->identifier());
626  m_incidentSvc->fireIncident(incident);
627  }
628  if ( !m_inhibitPathes.empty() ) {
629  auto inhibit = std::find(m_inhibitPathes.begin(), m_inhibitPathes.end(),
630  pRegistry->identifier());
631  if ( inhibit != m_inhibitPathes.end() ) {
632  return NO_ACCESS;
633  }
634  }
635  IOpaqueAddress* pAddress = pRegistry->address();
636  if ( !pAddress ) { // Precondition:
637  return INVALID_OBJ_ADDR; // Address must be valid
638  }
639  try {
640  status = pLoader->createObj(pAddress, pObject); // Call data loader
641  if ( status.isSuccess() ) {
642 
643  VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
644 
645  RegEntry *pEntry = CAST_REGENTRY(RegEntry*,pRegistry);
646  pEntry->setObject(pObject);
647 
648  VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
649  status = pLoader->fillObjRefs(pAddress, pObject);
650  }
651  }
652  catch( const GaudiException& exc ) {
653  if ( handleDataFault(pRegistry) ) {
654  return SUCCESS;
655  }
656  throw GaudiException("GaudiException in loadObject() " + pRegistry->identifier(),
657  name(), StatusCode::FAILURE, exc);
658  }
659  catch( const std::exception& x) {
660  if ( handleDataFault(pRegistry) ) {
661  return SUCCESS;
662  }
663  throw GaudiException("std::exception in loadObject() " + pRegistry->identifier() +
664  ": " + System::typeinfoName(typeid(x)) + ", " + x.what(),
666  }
667  catch(...) {
668  if ( handleDataFault(pRegistry) ) {
669  return SUCCESS;
670  }
671  throw GaudiException("UNKN exception in loadObject() " + pRegistry->identifier(),
673  }
674  if ( !status.isSuccess() ) {
675  if ( handleDataFault(pRegistry) ) {
676  return StatusCode::SUCCESS;
677  }
678  }
679  ON_VERBOSE if ( status.isSuccess() ) {
680  verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
681  }
682  return status;
683 }
#define VERMSG
Definition: DataSvc.cpp:72
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: DataSvc.h:60
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
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:75
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
std::string m_accessName
Name of the data access incident.
Definition: DataSvc.h:70
No data loader available.
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:68
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
Access to the requested leaf is inhibited.
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
void setObject(DataObject *obj)
Set/Update object address.
Normal successful completion.
Definition: IInterface.h:219
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: DataSvc.cpp:562
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:31
#define ON_VERBOSE
Definition: DataSvc.cpp:69
virtual StatusCode DataSvc::objectLeaves ( const DataObject pObject,
std::vector< IRegistry * > &  refLeaves 
)
virtual

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

Implements IDataManagerSvc.

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

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

IDataManagerSvc: Explore an object identified by its pointer.

Implements IDataManagerSvc.

Definition at line 230 of file DataSvc.cpp.

231  {
232  if ( !pObject ) return INVALID_OBJECT;
233  return objectLeaves(pObject->registry(), leaves);
234 }
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: DataSvc.cpp:230
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
Object pointer is invalid.
StatusCode DataSvc::objectLeaves ( const IRegistry pRegistry,
std::vector< IRegistry * > &  refLeaves 
)
virtual

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

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

Implements IDataManagerSvc.

Definition at line 239 of file DataSvc.cpp.

240  {
241  if ( !checkRoot() ) return INVALID_ROOT;
242  const RegEntry* node_entry = CAST_REGENTRY(const RegEntry*,pRegistry);
243  if ( !node_entry ) return INVALID_OBJECT;
244  leaves = node_entry->leaves();
245  return StatusCode::SUCCESS;
246 }
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
const Store & leaves() const
Access the leaves of the object.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Object pointer is invalid.
virtual StatusCode DataSvc::objectLeaves ( const IRegistry pRegistry,
std::vector< IRegistry * > &  refLeaves 
)
virtual

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

Implements IDataManagerSvc.

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

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

Implements IDataManagerSvc.

Definition at line 214 of file DataSvc.cpp.

215  {
216  if ( !pObject ) return INVALID_OBJECT;
217  return objectParent(pObject->registry(), refpParent);
218 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: DataSvc.cpp:214
Object pointer is invalid.
virtual StatusCode DataSvc::objectParent ( const DataObject pObject,
IRegistry *&  refpParent 
)
virtual

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

Implements IDataManagerSvc.

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

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

Implements IDataManagerSvc.

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

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

Implements IDataManagerSvc.

Definition at line 220 of file DataSvc.cpp.

221  {
222  if ( !checkRoot() ) return INVALID_ROOT;
223  const RegEntry* node_entry = CAST_REGENTRY(const RegEntry*,pRegistry);
224  if ( !node_entry ) return INVALID_OBJECT;
225  refpParent = node_entry->parent();
226  return StatusCode::SUCCESS;
227 }
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual IRegistry * parent() const
Pointer to parent directory entry.
Object pointer is invalid.
DataSvc& DataSvc::operator= ( const DataSvc )
private

Fake assignment operator (never implemented).

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

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

1170  {
1171  //unused: StatusCode sc = StatusCode::FAILURE;
1172  if ( pObject && depth++ < load_depth ) {
1173  RegEntry* dir = CAST_REGENTRY(RegEntry*,pObject->registry());
1174  if ( dir ) {
1175  for (const auto& i : *dir) {
1176  DataObject *pObj = nullptr;
1177  StatusCode status = retrieveObject(pObject, i->name(), pObj);
1178  if ( status.isSuccess() && depth < load_depth ) {
1179  preLoad(depth, load_depth, pObj).ignore();
1180  }
1181  }
1182  }
1183  }
1184  return StatusCode::SUCCESS;
1185 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1188
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
void ignore() const
Definition: StatusCode.h:107
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
list i
Definition: ana.py:128
virtual StatusCode DataSvc::preLoad ( )
virtual

load all preload items of the list

Implements IDataProviderSvc.

StatusCode DataSvc::preLoad ( )
virtual

load all preload items of the list

Implements IDataProviderSvc.

Definition at line 1188 of file DataSvc.cpp.

1188  {
1189  DataObject* pObj = nullptr;
1190  for (const auto& i : m_preLoads ) {
1191  StatusCode sc = retrieveObject( i.path(), pObj);
1192  int load_depth = i.depth();
1193  if ( sc.isSuccess() && load_depth > 1 ) {
1194  preLoad(1, load_depth, pObj).ignore();
1195  }
1196  }
1197  return StatusCode::SUCCESS;
1198 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:56
virtual StatusCode preLoad()
load all preload items of the list
Definition: DataSvc.cpp:1188
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
void ignore() const
Definition: StatusCode.h:107
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
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.

Implements IDataManagerSvc.

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

IDataManagerSvc: Register object address with the data store.

Implements IDataManagerSvc.

Definition at line 249 of file DataSvc.cpp.

250  {
251  if ( fullPath.empty() ) return INVALID_OBJ_PATH;
252  return registerAddress( fullPath.front() != SEPARATOR ? m_root : nullptr,
253  fullPath, pAddress);
254 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:249
Invalid path from root to object request failed.
StatusCode DataSvc::registerAddress ( DataObject parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

IDataManagerSvc: Register object address with the data store.

Implements IDataManagerSvc.

Definition at line 257 of file DataSvc.cpp.

259  {
260  IRegistry* pRegistry = ( parentObj ? parentObj->registry() : nullptr );
261  return registerAddress(pRegistry, objectPath, pAddress);
262 }
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:249
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
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.

Implements IDataManagerSvc.

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

IDataManagerSvc: Register object address with the data store.

Implements IDataManagerSvc.

Definition at line 265 of file DataSvc.cpp.

267  {
268  if ( !checkRoot() ) return INVALID_ROOT;
269  if ( objPath.empty() ) return INVALID_OBJ_PATH;
270 
271  if ( !parentObj ) {
272  if ( objPath.front() != SEPARATOR ) {
273  return registerAddress(m_root, objPath, pAddress);
274  }
275  std::string::size_type sep = objPath.find(SEPARATOR,1);
276  if ( sep == std::string::npos ) {
277  return INVALID_PARENT;
278  }
279  if ( objPath.compare(0,sep,m_rootName) == 0 ) {
280  return registerAddress(m_root, objPath.substr(sep), pAddress);
281  }
282  }
283  if ( objPath.front() != SEPARATOR ) {
284  return registerAddress(parentObj, char(SEPARATOR)+objPath, pAddress);
285  }
286  RegEntry* par_entry = CAST_REGENTRY(RegEntry*,parentObj);
287  if ( !par_entry ) return INVALID_PARENT;
288 
289  std::string::size_type sep = objPath.rfind(SEPARATOR);
290  if ( sep > 0 && sep != std::string::npos ) {
291  auto p_path = objPath.substr( 0, sep);
292  auto o_path = objPath.substr( sep );
293  RegEntry* p_entry = par_entry->findLeaf(p_path);
294  // Create default object leafs if the
295  // intermediate nodes are not present
296  if ( 0 == p_entry && m_forceLeaves ) {
297  DataObject *pLeaf = createDefaultObject();
298  StatusCode sc = registerObject(par_entry->identifier(),
299  p_path,
300  pLeaf);
301  if ( sc.isFailure() ) delete pLeaf;
302  p_entry = par_entry->findLeaf(p_path);
303  }
304  if ( !p_entry ) return INVALID_PARENT;
305  return registerAddress(p_entry, o_path, pAddress);
306  }
307  StatusCode status = par_entry->add(objPath, pAddress);
308  return status.isSuccess() ? status : DOUBL_OBJ_PATH;
309 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
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:50
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:249
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:58
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Invalid path from root to object request failed.
The path for this objects is already in use.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual const std::string & identifier() const
Full identifier (or key)
Pointer to parent object is not valid.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1264
virtual StatusCode DataSvc::registerAddress ( IRegistry parentObj,
const std::string &  objectPath,
IOpaqueAddress pAddress 
)
virtual

IDataManagerSvc: Register object address with the data store.

Implements IDataManagerSvc.

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

Register object with the data store.

Implements IDataProviderSvc.

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

Register object with the data store.

Implements IDataProviderSvc.

Definition at line 361 of file DataSvc.cpp.

362  {
363  return registerObject(nullptr, fullPath, pObject);
364 }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
StatusCode DataSvc::registerObject ( const std::string &  parentPath,
const std::string &  objPath,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

Definition at line 368 of file DataSvc.cpp.

370  {
371  DataObject* pO = nullptr;
372  StatusCode status = retrieveObject(parentPath, pO);
373  if ( !status.isSuccess() && m_forceLeaves ) {
374  pO = createDefaultObject();
375  status = registerObject(parentPath, pO);
376  if ( !status.isSuccess() ) pO->release();
377  }
378  if ( status.isFailure() ) return status;
379  return registerObject(pO, objPath, pObject);
380 }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:58
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1264
virtual StatusCode DataSvc::registerObject ( const std::string &  parentPath,
const std::string &  objPath,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

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

Register object with the data store.

Implements IDataProviderSvc.

Definition at line 383 of file DataSvc.cpp.

385  {
386  return registerObject(parentPath, itemToPath(item), pObject);
387 }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::registerObject ( const std::string &  parentPath,
int  item,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

StatusCode DataSvc::registerObject ( DataObject parentObj,
const std::string &  objPath,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

Definition at line 397 of file DataSvc.cpp.

399  {
400  if ( !checkRoot() ) return INVALID_ROOT;
401 
402  if ( !parentObj ) {
403  if ( !objPath.empty() ) {
404  if ( objPath.front() == SEPARATOR ) {
405  std::string::size_type sep = objPath.find(SEPARATOR,1);
406  if ( sep != std::string::npos ) {
407  return registerObject(objPath.substr( 0, sep), objPath.substr( sep ), pObject);
408  }
409  }
410  else {
411  return registerObject(m_rootName, objPath, pObject);
412  }
413  }
414  return INVALID_OBJ_PATH;
415  }
416  RegEntry* node_entry = CAST_REGENTRY(RegEntry*,parentObj->registry());
417  if ( node_entry ) {
418  StatusCode status = INVALID_PARENT;
419  std::string::size_type sep = objPath.find(SEPARATOR,1);
420  if ( sep != std::string::npos ) {
421  auto p_path = objPath.substr( 0, sep );
422  auto o_path = objPath.substr( sep );
423  RegEntry* par_entry = node_entry->findLeaf(p_path);
424  // Create default object leafs if the
425  // intermediate nodes are not present
426  if ( 0 == par_entry && m_forceLeaves ) {
427  DataObject *pLeaf = createDefaultObject();
428  StatusCode sc = registerObject(parentObj, p_path, pLeaf);
429  if ( ! sc.isSuccess() ) {
430  delete pLeaf;
431  }
432  par_entry = node_entry->findLeaf(p_path);
433  }
434  else if ( 0 != par_entry && par_entry->object() == 0 ) {
435  status = i_retrieveEntry( node_entry, p_path, par_entry);
436  if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
437  DataObject *pLeaf = createDefaultObject();
438  StatusCode sc = registerObject(parentObj, p_path, pLeaf);
439  if ( ! sc.isSuccess() ) {
440  delete pLeaf;
441  }
442  par_entry = node_entry->findLeaf(p_path);
443  }
444  }
445  node_entry = par_entry;
446  if ( node_entry ) {
447  DataObject* obj = node_entry->object();
448  if ( obj ) {
449  status = registerObject( obj, o_path, pObject );
450  }
451  }
452  }
453  else {
454  RegEntry* leaf = node_entry->findLeaf(objPath);
455  if ( !leaf ) {
456  status = node_entry->add( objPath, pObject );
457  }
458  else {
459  DataObject* obj = leaf->object();
460  if ( !obj ) {
461  if ( !pObject ) {
462  error() << "registerObject: trying to register null DataObject" << endmsg;
463  return StatusCode::FAILURE;
464  }
465  else {
466  pObject->setRegistry(leaf);
467  }
468  leaf->setAddress(0);
469  leaf->setObject(pObject);
470  status = StatusCode::SUCCESS;
471  }
472  else {
473  status = DOUBL_OBJ_PATH;
474  }
475  }
476  }
477  return status;
478  }
479  return INVALID_PARENT;
480 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
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:75
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:50
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:65
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
void setObject(DataObject *obj)
Set/Update object address.
virtual IOpaqueAddress * address() const
Retrieve opaque storage address.
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:692
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: DataSvc.h:58
void setAddress(IOpaqueAddress *pAddress)
Set/Update Opaque address.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Invalid path from root to object request failed.
The path for this objects is already in use.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Pointer to parent object is not valid.
virtual DataObject * object() const
Retrive object behind the link.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: DataSvc.cpp:1264
virtual StatusCode DataSvc::registerObject ( DataObject parentObj,
const std::string &  objPath,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

StatusCode DataSvc::registerObject ( DataObject parentObj,
int  item,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

Definition at line 390 of file DataSvc.cpp.

392  {
393  return registerObject(parentObj, itemToPath(item), pObject);
394 }
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:361
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::registerObject ( DataObject parentObj,
int  item,
DataObject pObject 
)
virtual

Register object with the data store.

Implements IDataProviderSvc.

StatusCode DataSvc::reinitialize ( )
virtual

Service initialization.

Service reinitialization.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, RecordDataSvc, and EvtDataSvc.

Definition at line 1215 of file DataSvc.cpp.

1215  {
1216  // the finalize part is copied here
1217  setDataLoader(nullptr).ignore();
1218  resetPreLoad().ignore();
1219  clearStore().ignore();
1220  if ( m_incidentSvc ) {
1222  m_incidentSvc = nullptr;
1223  }
1224  // re-initialize the base class
1226  if ( UNLIKELY(!sc.isSuccess()) ) {
1227  error() << "Unable to reinitialize base class" << endmsg;
1228  return sc;
1229  }
1230  // the initialize part is copied here
1231  sc = service("IncidentSvc", m_incidentSvc, true);
1232  if ( UNLIKELY(!sc.isSuccess()) ) {
1233  error() << "Failed to access incident service." << endmsg;
1234  return sc;
1235  }
1236  // return
1237  return StatusCode::SUCCESS;
1238 }
virtual StatusCode setDataLoader(IConversionSvc *svc)
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
Definition: DataSvc.cpp:203
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:75
virtual StatusCode resetPreLoad()
Clear the preload list.
Definition: DataSvc.cpp:1164
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: DataSvc.h:54
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: Service.cpp:292
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:115
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:143
#define UNLIKELY(x)
Definition: Kernel.h:127
void ignore() const
Definition: StatusCode.h:107
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode DataSvc::reinitialize ( )
virtual

Service initialization.

Reimplemented from Service.

Reimplemented in HistogramSvc, NTupleSvc, DetDataSvc, RecordDataSvc, and EvtDataSvc.

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

Remove an item from the preload list.

Implements IDataProviderSvc.

StatusCode DataSvc::removePreLoadItem ( const DataStoreItem item)
virtual

Remove an item from the preload list.

Implements IDataProviderSvc.

Definition at line 1152 of file DataSvc.cpp.

1152  {
1153  m_preLoads.erase(std::remove(std::begin(m_preLoads), std::end(m_preLoads), item),
1154  std::end(m_preLoads));
1155  return StatusCode::SUCCESS;
1156 }
def remove(file, logdir)
Definition: install.py:153
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:56
tuple end
Definition: IOTest.py:101
StatusCode DataSvc::removePreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

Implements IDataProviderSvc.

Definition at line 1159 of file DataSvc.cpp.

1159  {
1160  return removePreLoadItem( DataStoreItem(itemPath,1) );
1161 }
virtual StatusCode removePreLoadItem(const DataStoreItem &item)
Remove an item from the preload list.
Definition: DataSvc.cpp:1152
Description of the DataStoreItem class.
Definition: DataStoreItem.h:18
virtual StatusCode DataSvc::removePreLoadItem ( const std::string &  itemPath)
virtual

Add an item to the preload list.

Implements IDataProviderSvc.

virtual StatusCode DataSvc::resetPreLoad ( )
virtual

Clear the preload list.

Implements IDataProviderSvc.

StatusCode DataSvc::resetPreLoad ( )
virtual

Clear the preload list.

Implements IDataProviderSvc.

Definition at line 1164 of file DataSvc.cpp.

1164  {
1165  m_preLoads.erase(std::begin(m_preLoads), std::end(m_preLoads));
1166  return StatusCode::SUCCESS;
1167 }
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:56
tuple end
Definition: IOTest.py:101
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 686 of file DataSvc.cpp.

688  {
689  return i_retrieveEntry(parentObj,path,pEntry);
690 }
list path
Definition: __init__.py:15
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:692
StatusCode DataSvc::retrieveObject ( IRegistry pDirectory,
const std::string &  path,
DataObject *&  pObject 
)
virtual

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Implements IDataProviderSvc.

Definition at line 782 of file DataSvc.cpp.

784  {
785  pObject = nullptr;
786  RegEntry *result = nullptr, *parent = CAST_REGENTRY(RegEntry*,pRegistry);
787  StatusCode status = i_retrieveEntry(parent, path, result);
788  if ( status.isSuccess() ) {
789  pObject = result->object();
790  }
791  return status;
792 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
list path
Definition: __init__.py:15
StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry *parentObj, boost::string_ref path, DataSvcHelpers::RegistryEntry *&pEntry)
Definition: DataSvc.cpp:692
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual DataObject * object() const
Retrive object behind the link.
virtual StatusCode DataSvc::retrieveObject ( IRegistry pDirectory,
const std::string &  path,
DataObject *&  pObject 
)
virtual

Retrieve object from data store.

Implements IDataProviderSvc.

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

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

Implements IDataProviderSvc.

Definition at line 795 of file DataSvc.cpp.

796  {
797  IRegistry* nullDir = nullptr;
798  return retrieveObject(nullDir, fullPath, pObject);
799 }
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
virtual StatusCode DataSvc::retrieveObject ( const std::string &  fullPath,
DataObject *&  pObject 
)
virtual

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

Implements IDataProviderSvc.

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

Retrieve object from data store.

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

Implements IDataProviderSvc.

Definition at line 802 of file DataSvc.cpp.

804  {
805  DataObject* parent = nullptr;
806  StatusCode status = retrieveObject(parentPath, parent);
807  if ( status.isSuccess() ) {
808  status = retrieveObject (parent, objectPath, pObject);
809  }
810  return status;
811 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::retrieveObject ( const std::string &  parentPath,
const std::string &  objPath,
DataObject *&  pObject 
)
virtual

Retrieve object from data store.

Implements IDataProviderSvc.

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

Retrieve object from data store.

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

Implements IDataProviderSvc.

Definition at line 814 of file DataSvc.cpp.

816  {
817  return retrieveObject(parentPath, itemToPath(item), pObject);
818 }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::retrieveObject ( const std::string &  parentPath,
int  item,
DataObject *&  pObject 
)
virtual

Retrieve object from data store.

Implements IDataProviderSvc.

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

Retrieve object from data store.

Implements IDataProviderSvc.

Definition at line 821 of file DataSvc.cpp.

823  {
824  IRegistry* pRegistry = (parentObj ? parentObj->registry() : nullptr);
825  return retrieveObject(pRegistry, path, pObject);
826 }
list path
Definition: __init__.py:15
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
virtual StatusCode DataSvc::retrieveObject ( DataObject parentObj,
const std::string &  objPath,
DataObject *&  pObject 
)
virtual

Retrieve object from data store.

Implements IDataProviderSvc.

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

Retrieve object from data store.

Implements IDataProviderSvc.

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

Retrieve object from data store.

Retrieve registry entry from store.

Implements IDataProviderSvc.

Definition at line 829 of file DataSvc.cpp.

831  {
832  return retrieveObject(parentObj, itemToPath(item), pObject);
833 }
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
tuple item
print s1,s2
Definition: ana.py:146
virtual CLID DataSvc::rootCLID ( ) const
virtual

IDataManagerSvc: Accessor for root event CLID.

Implements IDataManagerSvc.

CLID DataSvc::rootCLID ( ) const
virtual

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Implements IDataManagerSvc.

Definition at line 1254 of file DataSvc.cpp.

1254  {
1255  return( (CLID)m_rootCLID );
1256 }
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:48
std::string DataSvc::rootName ( ) const
virtual

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Implements IDataManagerSvc.

Definition at line 1259 of file DataSvc.cpp.

1259  {
1260  return( m_rootName );
1261 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
virtual std::string DataSvc::rootName ( ) const
virtual

IDataManagerSvc: Accessor for root event name.

Implements IDataManagerSvc.

virtual StatusCode DataSvc::setDataLoader ( IConversionSvc svc)
virtual

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

Implements IDataManagerSvc.

StatusCode DataSvc::setDataLoader ( IConversionSvc svc)
virtual

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

IDataManagerSvc: Pass a default data loader to the service.

Implements IDataManagerSvc.

Definition at line 203 of file DataSvc.cpp.

203  {
204  if ( pDataLoader ) pDataLoader->addRef();
206  if ( pDataLoader ) {
207  pDataLoader->setDataProvider(this).ignore();
208  }
209  m_dataLoader = pDataLoader;
210  return SUCCESS;
211 }
Normal successful completion.
Definition: IInterface.h:219
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: DataSvc.h:52
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode DataSvc::setRoot ( const std::string &  root_name,
DataObject pRootObj 
)
virtual

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

Takes care to clear the store before reinitializing it

Implements IDataManagerSvc.

StatusCode DataSvc::setRoot ( const std::string &  root_path,
DataObject pRootObj 
)
virtual

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

Takes care to clear the store before reinitializing it

Implements IDataManagerSvc.

Definition at line 154 of file DataSvc.cpp.

155  {
156  clearStore().ignore();
157  return i_setRoot (root_path, pRootObj);
158 }
virtual StatusCode i_setRoot(const std::string &root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:165
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:115
void ignore() const
Definition: StatusCode.h:107
StatusCode DataSvc::setRoot ( const std::string &  root_path,
IOpaqueAddress pRootAddr 
)
virtual

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

Implements IDataManagerSvc.

Definition at line 180 of file DataSvc.cpp.

181  {
182  clearStore().ignore();
183  return i_setRoot (root_path, pRootAddr);
184 }
virtual StatusCode i_setRoot(const std::string &root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:165
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:115
void ignore() const
Definition: StatusCode.h:107
virtual StatusCode DataSvc::setRoot ( const std::string &  root_path,
IOpaqueAddress pRootAddr 
)
virtual

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

Implements IDataManagerSvc.

StatusCode DataSvc::traverseSubTree ( const std::string &  sub_tree_path,
IDataStoreAgent pAgent 
)
virtual

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.

Implements IDataManagerSvc.

Definition at line 127 of file DataSvc.cpp.

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

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

Implements IDataManagerSvc.

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

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

Implements IDataManagerSvc.

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

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

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

Implements IDataManagerSvc.

Definition at line 136 of file DataSvc.cpp.

137  {
138  if ( !checkRoot() ) return INVALID_ROOT;
139  RegEntry* entry = CAST_REGENTRY(RegEntry*,pObject->registry());
140  if ( !entry ) return INVALID_OBJECT;
141  return entry->traverseTree(pAgent);
142 }
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Object pointer is invalid.
virtual StatusCode DataSvc::traverseTree ( IDataStoreAgent pAgent)
virtual

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

Implements IDataManagerSvc.

StatusCode DataSvc::traverseTree ( IDataStoreAgent pAgent)
virtual

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

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

Implements IDataManagerSvc.

Definition at line 145 of file DataSvc.cpp.

145  {
146  if ( !checkRoot() ) return INVALID_ROOT;
147  return m_root->traverseTree(pAgent);
148 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual StatusCode DataSvc::unlinkObject ( IRegistry from,
const std::string &  objPath 
)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

StatusCode DataSvc::unlinkObject ( IRegistry from,
const std::string &  objPath 
)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

Definition at line 1075 of file DataSvc.cpp.

1076  {
1077  if ( checkRoot() ) {
1078  try {
1079  RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1080  if ( from_entry ) {
1081  std::string::size_type sep = objPath.rfind(SEPARATOR);
1082  if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1083  DataObject* pO = nullptr;
1084  StatusCode sc = findObject(from, objPath.substr(0,sep), pO);
1085  if ( sc.isSuccess() ) {
1086  sc = unlinkObject(pO->registry(), objPath.substr(sep));
1087  }
1088  return sc;
1089  }
1090  StatusCode status = from_entry->remove( objPath );
1091  if ( status.isSuccess() ) {
1092  return status;
1093  }
1094  return INVALID_OBJ_PATH;
1095  }
1096  }
1097  catch (...) {
1098  }
1099  return INVALID_PARENT;
1100  }
1101  return INVALID_ROOT;
1102 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual long remove(const std::string &name)
Remove an entry from the store.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Invalid path from root to object request failed.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Pointer to parent object is not valid.
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)
Remove a link to another object.
Definition: DataSvc.cpp:1075
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::unlinkObject ( const std::string &  fromPath,
const std::string &  objPath 
)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

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

Remove a link to another object.

Implements IDataProviderSvc.

Definition at line 1117 of file DataSvc.cpp.

1118  {
1119  DataObject* pObject = nullptr;
1120  StatusCode status = findObject(from, pObject);
1121  if ( status.isSuccess() ) {
1122  status = unlinkObject(pObject->registry(), objPath);
1123  }
1124  return status;
1125 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)
Remove a link to another object.
Definition: DataSvc.cpp:1075
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::unlinkObject ( DataObject fromObj,
const std::string &  objPath 
)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

StatusCode DataSvc::unlinkObject ( DataObject fromObj,
const std::string &  objPath 
)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

Definition at line 1128 of file DataSvc.cpp.

1129  {
1130  if ( checkRoot() ) {
1131  IRegistry* from_entry = m_root->findLeaf(from);
1132  return unlinkObject(from_entry, objPath);
1133  }
1134  return INVALID_ROOT;
1135 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)
Remove a link to another object.
Definition: DataSvc.cpp:1075
virtual StatusCode DataSvc::unlinkObject ( const std::string &  fullPath)
virtual

Remove a link to another object.

Implements IDataProviderSvc.

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

Remove a link to another object.

Implements IDataProviderSvc.

Definition at line 1105 of file DataSvc.cpp.

1105  {
1106  if ( !fullPath.empty() ) {
1107  if ( fullPath.front() != SEPARATOR ) {
1108  return unlinkObject(m_rootName, fullPath);
1109  }
1110  auto sep = fullPath.rfind(SEPARATOR);
1111  return unlinkObject(fullPath.substr(0,sep), fullPath.substr(sep));
1112  }
1113  return INVALID_OBJ_PATH;
1114 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
Invalid path from root to object request failed.
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)
Remove a link to another object.
Definition: DataSvc.cpp:1075
virtual StatusCode DataSvc::unregisterAddress ( const std::string &  fullPath)
virtual

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

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

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

Definition at line 312 of file DataSvc.cpp.

312  {
313  if ( fullPath.empty() ) return INVALID_OBJ_PATH;
314  return unregisterAddress( fullPath.front() != SEPARATOR ? m_root : nullptr,
315  fullPath );
316 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
Invalid path from root to object request failed.
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:312
virtual StatusCode DataSvc::unregisterAddress ( DataObject pParent,
const std::string &  objPath 
)
virtual

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

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

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

Definition at line 319 of file DataSvc.cpp.

320  {
321  return unregisterAddress( pParent ? pParent->registry() : nullptr,
322  objPath);
323 }
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:312
StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
const std::string &  objPath 
)
virtual

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

Definition at line 326 of file DataSvc.cpp.

327  {
328  if ( !checkRoot() ) return INVALID_ROOT;
329  if ( objPath.empty() ) return INVALID_OBJ_PATH;
330 
331  if ( !pParent ) {
332  if ( objPath.front() != SEPARATOR ) {
333  return unregisterAddress(m_root, objPath);
334  }
335  std::string::size_type sep = objPath.find(SEPARATOR,1);
336  if ( sep != std::string::npos &&
337  objPath.compare( 0, sep, m_rootName) == 0 ) {
338  return unregisterAddress(m_root, objPath.substr(sep));
339  }
340  return INVALID_PARENT;
341  }
342  if ( objPath.front() != SEPARATOR ) {
343  return unregisterAddress(pParent, char(SEPARATOR)+objPath);
344  }
345  RegEntry* node_entry = CAST_REGENTRY(RegEntry*,pParent);
346  if ( node_entry ) {
347  RegEntry* leaf_entry = node_entry->findLeaf(objPath);
348  if ( leaf_entry ) {
349  std::string::size_type sep = objPath.rfind(SEPARATOR);
350  if ( sep > 0 && sep != std::string::npos ) {
351  return unregisterAddress(leaf_entry->parent(), objPath.substr(sep));
352  }
353  StatusCode status = node_entry->remove(objPath);
354  if ( status.isSuccess() ) return status;
355  }
356  }
357  return INVALID_PARENT;
358 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
std::string m_rootName
Name of root event.
Definition: DataSvc.h:50
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
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:30
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Invalid path from root to object request failed.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
virtual IRegistry * parent() const
Pointer to parent directory entry.
Pointer to parent object is not valid.
virtual StatusCode unregisterAddress(const std::string &fullPath)
IDataManagerSvc: Unregister object address from the data store.
Definition: DataSvc.cpp:312
virtual StatusCode DataSvc::unregisterAddress ( IRegistry pParent,
const std::string &  objPath 
)
virtual

IDataManagerSvc: Unregister object address from the data store.

Implements IDataManagerSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 483 of file DataSvc.cpp.

483  {
484  DataObject* pObject = nullptr;
485  StatusCode status = findObject(fullPath, pObject);
486  if ( status.isFailure() ) return status;
487  RegEntry* pEntry = CAST_REGENTRY(RegEntry*,pObject->registry());
488  if ( !pEntry ) return INVALID_ROOT;
489 
490  if ( !pEntry->isEmpty() ) return DIR_NOT_EMPTY;
491 
492  RegEntry* pParent = pEntry->parentEntry();
493  if ( !pParent ) return INVALID_PARENT;
494 
495  if ( pObject ) pObject->addRef();
496  pParent->remove(pEntry);
497  return StatusCode::SUCCESS;
498 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
Invalid root path object cannot be retrieved or stored.
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:85
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:88
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual bool isEmpty() const
Simple check if the Container is empty.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Directory entry is NOT empty.
Pointer to parent object is not valid.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
StatusCode DataSvc::unregisterObject ( const std::string &  parentPath,
const std::string &  objectPath 
)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 501 of file DataSvc.cpp.

502  {
503  DataObject* pO = nullptr;
504  StatusCode status = findObject(parentPath, pO);
505  if ( status.isFailure() ) return status;
506  return unregisterObject(pO, objPath);
507 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode unregisterObject(const std::string &fullPath)
Unregister object from the data store.
Definition: DataSvc.cpp:483
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::unregisterObject ( const std::string &  parentPath,
const std::string &  objectPath 
)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 510 of file DataSvc.cpp.

510  {
511  return unregisterObject(parentPath, itemToPath(item));
512 }
virtual StatusCode unregisterObject(const std::string &fullPath)
Unregister object from the data store.
Definition: DataSvc.cpp:483
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::unregisterObject ( DataObject pObject)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

StatusCode DataSvc::unregisterObject ( DataObject pObject)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 515 of file DataSvc.cpp.

515  {
516  if ( !checkRoot() ) return INVALID_ROOT;
517  RegEntry* entry = m_root->findLeaf(pObject);
518  if ( !entry ) return INVALID_OBJECT;
519  RegEntry* parent = entry->parentEntry();
520  if ( !parent ) return INVALID_PARENT;
521  if ( !entry->isEmpty() ) return DIR_NOT_EMPTY;
522  if ( entry->object() ) entry->object()->addRef();
523  if ( parent ) parent->remove(entry);
524  return SUCCESS;
525 }
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: DataSvc.h:64
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:88
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
Normal successful completion.
Definition: IInterface.h:219
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Directory entry is NOT empty.
Pointer to parent object is not valid.
Object pointer is invalid.
virtual DataObject * object() const
Retrive object behind the link.
StatusCode DataSvc::unregisterObject ( DataObject pObject,
const std::string &  objectPath 
)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 528 of file DataSvc.cpp.

529  {
530  if ( checkRoot() ) {
531  try {
532  RegEntry* parent = CAST_REGENTRY(RegEntry*,pParentObj->registry());
533  if ( parent ) {
534  RegEntry* entry = parent->findLeaf(objectPath);
535  if ( entry ) {
536  if ( entry->isEmpty() ) {
537  if ( entry->object() ) {
538  entry->object()->addRef();
539  }
540  parent->remove(entry);
541  return SUCCESS;
542  }
543  return DIR_NOT_EMPTY;
544  }
545  return INVALID_OBJECT;
546  }
547  }
548  catch(...) {
549  }
550  return INVALID_PARENT;
551  }
552  return INVALID_ROOT;
553 }
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:92
Invalid root path object cannot be retrieved or stored.
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:385
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:53
Normal successful completion.
Definition: IInterface.h:219
virtual bool isEmpty() const
Simple check if the Container is empty.
#define CAST_REGENTRY(x, y)
Definition: DataSvc.cpp:64
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:35
Directory entry is NOT empty.
Pointer to parent object is not valid.
Object pointer is invalid.
virtual DataObject * object() const
Retrive object behind the link.
virtual StatusCode DataSvc::unregisterObject ( DataObject pObject,
const std::string &  objectPath 
)
virtual

Unregister object from the data store.

Implements IDataProviderSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

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

Unregister object from the data store.

Implements IDataProviderSvc.

Definition at line 556 of file DataSvc.cpp.

556  {
557  return unregisterObject(pParentObj, itemToPath(item));
558 }
virtual StatusCode unregisterObject(const std::string &fullPath)
Unregister object from the data store.
Definition: DataSvc.cpp:483
tuple item
print s1,s2
Definition: ana.py:146
virtual StatusCode DataSvc::updateObject ( IRegistry pDirectory)
virtual

Update object identified by its directory entry.

Implements IDataProviderSvc.

StatusCode DataSvc::updateObject ( IRegistry pDirectory)
virtual

Update object identified by its directory entry.

Update object.

Implements IDataProviderSvc.

Definition at line 915 of file DataSvc.cpp.

915  {
916  if ( !pRegistry ) { // Precondition:
917  return INVALID_OBJ_ADDR; // Addres must be valid
918  }
919  DataObject* toUpdate = pRegistry->object();
920  if ( !toUpdate ) { // Try first to load
921  return loadObject(pRegistry);
922  }
923  return updateObject(toUpdate);
924 }
virtual StatusCode updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
Definition: DataSvc.cpp:915
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: DataSvc.cpp:601
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::updateObject ( const std::string &  updatePath)
virtual

Update object.

Implements IDataProviderSvc.

StatusCode DataSvc::updateObject ( const std::string &  updatePath)
virtual

Update object.

Implements IDataProviderSvc.

Definition at line 905 of file DataSvc.cpp.

905  {
906  DataObject* pO = nullptr;
907  StatusCode status = findObject(updatePath, pO);
908  if ( status.isSuccess() ) {
909  return updateObject(pO);
910  }
911  return retrieveObject(updatePath, pO);
912 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
Definition: DataSvc.cpp:915
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:782
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
StatusCode DataSvc::updateObject ( DataObject toUpdate)
virtual

Update object.

Implements IDataProviderSvc.

Reimplemented in DetDataSvc.

Definition at line 927 of file DataSvc.cpp.

927  {
928  StatusCode status = INVALID_OBJ_ADDR;
929  if ( !toUpdate ) { // Precondition:
930  return INVALID_OBJECT; // Address must be valid
931  }
932  IRegistry* pRegistry = toUpdate->registry(); // Precondition:
933  if ( !pRegistry ) { // Need valid registry
934  return INVALID_OBJECT;
935  }
936  IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
937  if ( !pAddress ) { // Need valid address
938  return INVALID_OBJ_ADDR;
939  }
940  IConversionSvc* pLoader = getDataLoader(pRegistry);
941  if ( !pLoader ) { // Precondition:
942  return NO_DATA_LOADER; // Data loader must be present
943  }
944  if ( !m_inhibitPathes.empty() ) {
945  auto inhibit = std::find( m_inhibitPathes.begin(), m_inhibitPathes.end(),
946  pRegistry->identifier());
947  if ( inhibit != m_inhibitPathes.end() ) {
948  return NO_ACCESS;
949  }
950  }
951  try {
952  status = pLoader->updateObj(pAddress, toUpdate); // Call data loader
953  if ( status.isSuccess() ) {
954  status = pLoader->updateObjRefs(pAddress, toUpdate);
955  }
956  }
957  catch( const GaudiException& exc ) {
958  throw GaudiException("GaudiException in updateObject() " +
959  pRegistry->name(),
960  name(),
961  StatusCode::FAILURE, exc);
962  }
963  catch( const std::exception& x) {
964  throw GaudiException("std::exception in updateObject() " +
965  pRegistry->name() + ": " +
966  System::typeinfoName(typeid(x)) + ", " +
967  x.what(),
969  }
970  catch(...) {
971  throw GaudiException("UNKN exception in updateObject() " +
972  pRegistry->name(),
974  }
975  return status;
976 }
Define general base for Gaudi exception.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
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)
No data loader available.
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:68
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
Access to the requested leaf is inhibited.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
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 std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:329
Object pointer is invalid.
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:1271
virtual StatusCode DataSvc::updateObject ( DataObject toUpdate)
virtual

Update object.

Implements IDataProviderSvc.

Reimplemented in DetDataSvc.

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

Update object.

Implements IDataProviderSvc.

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

Update object.

Implements IDataProviderSvc.

Definition at line 979 of file DataSvc.cpp.

980  {
981  DataObject* pParent = nullptr;
982  StatusCode status = findObject(parentPath, pParent);
983  if ( status.isSuccess() ) {
984  status = updateObject( pParent, updatePath);
985  }
986  return status;
987 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
Definition: DataSvc.cpp:915
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual StatusCode DataSvc::updateObject ( DataObject pParent,
const std::string &  updatePath 
)
virtual

Update object.

Implements IDataProviderSvc.

StatusCode DataSvc::updateObject ( DataObject pParent,
const std::string &  updatePath 
)
virtual

Update object.

Implements IDataProviderSvc.

Definition at line 990 of file DataSvc.cpp.

991  {
992  DataObject* pObject = nullptr;
993  StatusCode status = findObject(parent, updatePath, pObject);
994  if ( status.isSuccess() ) {
995  status = updateObject(pObject);
996  }
997  return status;
998 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:855
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual StatusCode updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
Definition: DataSvc.cpp:915
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31

Member Data Documentation

std::string DataSvc::m_accessName
protected

Name of the data access incident.

Definition at line 70 of file DataSvc.h.

IConversionSvc * DataSvc::m_dataLoader
protected

Pointer to data loader service.

Definition at line 52 of file DataSvc.h.

bool DataSvc::m_enableAccessHdlr
protected

Flag to enable interrupts on data access requests.

Definition at line 60 of file DataSvc.h.

bool DataSvc::m_enableFaultHdlr
protected

Flag to enable interrupts on data creation requests.

Definition at line 62 of file DataSvc.h.

std::string DataSvc::m_faultName
protected

Name of the data fault incident.

Definition at line 72 of file DataSvc.h.

bool DataSvc::m_forceLeaves
protected

Allow forced creation of default leaves on registerObject.

Definition at line 58 of file DataSvc.h.

IIncidentSvc * DataSvc::m_incidentSvc
protected

Pointer to incident service.

Definition at line 54 of file DataSvc.h.

DataSvcHelpers::InhibitMap * DataSvc::m_inhibitMap
protected

Map with object paths to be inhibited from loading.

Definition at line 66 of file DataSvc.h.

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

Property for the inhibited leaves.

Definition at line 68 of file DataSvc.h.

LoadItems DataSvc::m_preLoads
protected

Items to be pre-loaded.

Definition at line 56 of file DataSvc.h.

DataSvcHelpers::RegistryEntry * DataSvc::m_root
protected

Pointer to root entry.

Definition at line 64 of file DataSvc.h.

CLID DataSvc::m_rootCLID
protected

Integer Property corresponding to CLID of root entry.

Definition at line 48 of file DataSvc.h.

std::string DataSvc::m_rootName
protected

Name of root event.

Definition at line 50 of file DataSvc.h.


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