| The Gaudi Framework v27r1

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

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

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

Data service base class. More...

`#include <GaudiKernel/TsDataSvc.h>`

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

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

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

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

## Protected Attributes
CLID | m_rootCLID
| Integer Property corresponding to CLID of root entry. More...
std::string | m_rootName
| Name of root event. More...
IConversionSvc * | m_dataLoader
| Pointer to data loader service. More...
IIncidentSvc * | m_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::RegistryEntry * | m_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...
tsDataSvcMutex | m_accessMutex
| Mutex to protect access to the store. More...
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel = MSG::NIL
| Service output level. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...

## Private Member Functions
| TsDataSvc (const TsDataSvc &)
| Fake copy constructor (never implemented). More...
TsDataSvc & | operator= (const TsDataSvc &)
| Fake assignment operator (never implemented). More...

## Friends
class | SvcFactory< TsDataSvc >
| The class creator is of course a friend! More...

## Detailed Description

Data service base class.

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

The accessor methods are protected with a lock. This is done having in mind the DetDataSvc and the retrieval of subdetectors in a multithreaded FW. This solution cannot solve the problem of having different conditions set available simultaneously but it is the simplest solution to allow multiple algorithms running concurrently to access detector components. In first approximation, since for the data we have the whiteboard, we protect only the retrieval of objects.

Author
  Markus Frank
  Sebastien Ponce
  Danilo Piparo

Version
  1.1

Definition at line 62 of file TsDataSvc.h.

## Member Typedef Documentation

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

Define set of load items.

Definition at line 71 of file TsDataSvc.h.

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 1397 of file TsDataSvc.cpp.

1398 : base_class(name,svc), m_rootCLID( /*CLID_Event*/ 110),
1399 m_rootName( "/Event"), m_root(0)
1400 {
1401 m_dataLoader = 0;
1402 m_inhibitMap = 0;
1403 m_incidentSvc = 0;
1404 m_forceLeaves = false;
1405 m_enableFaultHdlr = false;
1406 m_enableAccessHdlr = false;
1407 m_faultName = "DataFault";
1408 m_accessName = "DataAccess";
1409 declareProperty("RootCLID", m_rootCLID);
1410 declareProperty("RootName", m_rootName);
1411 declareProperty("ForceLeaves", m_forceLeaves);
1412 declareProperty("InhibitPathes", m_inhibitPathes);
1413 declareProperty("DataFaultName", m_faultName);
1414 declareProperty("DataAccessName", m_accessName);
1415 declareProperty("EnableFaultHandler", m_enableFaultHdlr);
1416 declareProperty("EnableAccessHandler", m_enableAccessHdlr);
1417 }
TsDataSvc::m_inhibitMap
DataSvcHelpers::InhibitMap * m_inhibitMap
Map with object paths to be inhibited from loading.
Definition: TsDataSvc.h:93
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
TsDataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: TsDataSvc.h:87
extends< Service, IDataProviderSvc, IDataManagerSvc >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:79
TsDataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: TsDataSvc.h:89
TsDataSvc::m_accessName
std::string m_accessName
Name of the data access incident.
Definition: TsDataSvc.h:97
TsDataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: TsDataSvc.h:95
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
TsDataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: TsDataSvc.h:85
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
TsDataSvc::m_faultName
std::string m_faultName
Name of the data fault incident.
Definition: TsDataSvc.h:99
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
TsDataSvc::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: TsDataSvc.h:75

TsDataSvc::~TsDataSvc | ( |  | ) |
| virtual

Standard Destructor.

Definition at line 1420 of file TsDataSvc.cpp.

1420 {
1421 setDataLoader(0).ignore();
1422 resetPreLoad().ignore();
1423 clearStore().ignore();
1424 }
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1284
TsDataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=0) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: TsDataSvc.cpp:214
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108

TsDataSvc::TsDataSvc | ( | const TsDataSvc & |  | ) |
| private

Fake copy constructor (never implemented).

## Member Function Documentation

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

Add an item to the preload list.

Definition at line 1255 of file TsDataSvc.cpp.

1255 {
1256 LoadItems::iterator i = std::find(m_preLoads.begin(), m_preLoads.end(), item);
1257 if ( i == m_preLoads.end() ) {
1258 m_preLoads.push_back(item);
1259 }
1260 return StatusCode::SUCCESS;
1261 }
std::vector::end
T end(T...args)
std::vector::push_back
T push_back(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:83
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
ana.i
list i
Definition: ana.py:128

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

Add an item to the preload list.

Definition at line 1264 of file TsDataSvc.cpp.

1264 {
1265 return addPreLoadItem( DataStoreItem(itemPath,1) );
1266 }
TsDataSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: TsDataSvc.cpp:1255
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

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

Check if root path is valid.

Definition at line 413 of file TsDataSvc.h.

413 {
414 return 0 != m_root;
415 }
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91

StatusCode TsDataSvc::clearStore | ( |  | ) |
| override

IDataManagerSvc: Remove all data objects in the data store.

Definition at line 115 of file TsDataSvc.cpp.

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

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

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

Definition at line 77 of file TsDataSvc.cpp.

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

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

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

Definition at line 98 of file TsDataSvc.cpp.

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

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

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

Definition at line 1385 of file TsDataSvc.cpp.

1385 {
1386 return new DataObject();
1387 }
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:50

StatusCode TsDataSvc::finalize | ( |  | ) |
| override

Service initialization.

Service initialisation.

Definition at line 1362 of file TsDataSvc.cpp.

1362 {
1363 // Nothing to do: just call base class initialisation
1364 setDataLoader(0).ignore();
1365 resetPreLoad().ignore();
1366 clearStore().ignore();
1367 if ( m_incidentSvc ) {
1368 m_incidentSvc->release();
1369 m_incidentSvc = 0;
1370 }
1371 return Service::finalize();
1372 }
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1284
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
TsDataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=0) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: TsDataSvc.cpp:214
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108

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

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

Definition at line 956 of file TsDataSvc.cpp.

957 {
958 STD_LOCK_GUARD_MACRO
959 pObject = 0;
960 if ( checkRoot() ) {
961 if ( path.length() == 0 || path == m_rootName ) {
962 pObject = m_root->object();
963 return (0 == pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
964 }
965 else if ( path[0] != SEPARATOR ) {
966 return findObject(m_rootName, path, pObject);
967 }
968 return findObject((IRegistry*)0, path, pObject);
969 }
970 return INVALID_ROOT;
971 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
std::string::length
T length(T...args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

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

Retrieve object identified by its directory from the data store.

Definition at line 936 of file TsDataSvc.cpp.

938 {
939 STD_LOCK_GUARD_MACRO
940 pObject = 0;
941 IRegistry* pReg = (0==pRegistry) ? m_root : pRegistry;
942 RegEntry* root_entry = CAST_REGENTRY(RegEntry*, pReg);
943 if ( 0 != root_entry ) {
944 if ( path.length() > 0 ) {
945 pReg = root_entry->find(path);
946 }
947 if ( 0 == pReg ) {
948 return INVALID_OBJ_PATH;
949 }
950 pObject = pReg->object();
951 }
952 return (0 == pObject) ? OBJ_NOT_LOADED : IDataProviderSvc_NO_ERROR;
953 }
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::length
T length(T...args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:170

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

Find object in the data store.

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

Definition at line 974 of file TsDataSvc.cpp.

976 {
977 DataObject* parent = 0;
978 StatusCode status = findObject(parentPath, parent);
979 if ( status.isSuccess() ) {
980 status = findObject (parent, objectPath, pObject);
981 }
982 return status;
983 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Find object in the data store.

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

Definition at line 986 of file TsDataSvc.cpp.

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

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

Find object in the data store.

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

Definition at line 999 of file TsDataSvc.cpp.

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

StatusCode TsDataSvc::findObject | ( | DataObject * | parentObj,
|  | int | item,
|  | DataObject *& | pObject
| ) |  |
| override

Find object in the data store.

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

Definition at line 992 of file TsDataSvc.cpp.

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

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

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

Definition at line 1392 of file TsDataSvc.cpp.

1392 {
1393 return m_dataLoader;
1394 }
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:79

DataObject * TsDataSvc::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 656 of file TsDataSvc.cpp.

657 {
658 if ( m_enableFaultHdlr ) {
659 IRegistry* pLeaf = 0;
660 if ( pReg && path.length() == 0 ) {
661 DataIncident incident(name(), m_faultName, pReg->identifier());
662 m_incidentSvc->fireIncident(incident);
663 return pReg->object();
664 }
665 else if ( pReg ) {
666 std::string p = pReg->identifier();
667 if (path[0] != SEPARATOR ) p += SEPARATOR;
668 p += path;
669 DataIncident incident(name(), m_faultName, p);
670 m_incidentSvc->fireIncident(incident);
671 pLeaf = m_root->findLeaf(p);
672 }
673 else {
674 std::string p = m_root->identifier();
675 if (path[0] != SEPARATOR ) p += SEPARATOR;
676 p += path;
677 DataIncident incident(name(), m_faultName, p);
678 m_incidentSvc->fireIncident(incident);
679 pLeaf = m_root->findLeaf(p);
680 }
681 if ( pLeaf ) {
682 return pLeaf->object();
683 }
684 }
685 return 0;
686 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
TsDataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: TsDataSvc.h:89
std::string
STL class.
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TsDataSvc::m_faultName
std::string m_faultName
Name of the data fault incident.
Definition: TsDataSvc.h:99
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:126
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
std::string::length
T length(T...args)
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataIncident
Data service incident class.

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

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

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

Definition at line 176 of file TsDataSvc.cpp.

177 {
178 if ( 0 != pRootObj ) {
179 m_root = new RegEntry(root_path);
180 m_root->makeHard(pRootObj);
181 m_root->setDataSvc(this);
182 // No done with GaudiHive. preLoad().ignore();
183 }
184 return SUCCESS;
185 }
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: TsDataSvc.cpp:66
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:98

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

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

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

Definition at line 202 of file TsDataSvc.cpp.

203 {
204 if ( 0 != pRootAddr ) {
205 m_root = new RegEntry(std::move(root_path));
206 m_root->makeHard(pRootAddr);
207 m_root->setDataSvc(this);
208 // Not done with GaudiHive. preLoad().ignore();
209 }
210 return SUCCESS;
211 }
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
RegEntry
DataSvcHelpers::RegistryEntry RegEntry
Definition: TsDataSvc.cpp:66
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
std::move
T move(T...args)
DataSvcHelpers::RegistryEntry::makeHard
void makeHard(DataObject *pObject)
Initialize link as hard link.
Definition: RegistryEntry.cpp:98

StatusCode TsDataSvc::initialize | ( |  | ) |
| override

Service initialization.

Definition at line 1321 of file TsDataSvc.cpp.

1321 {
1322 // Nothing to do: just call base class initialisation
1323 StatusCode sc = Service::initialize();
1324 if ( !sc.isSuccess() ) {
1325 return sc;
1326 }
1327 sc = service("IncidentSvc", m_incidentSvc, true);
1328 if ( UNLIKELY(!sc.isSuccess()) ) {
1329 error() << "Failed to access incident service." << endmsg;
1330 }
1331 return sc;
1332 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:144
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Add a link to another object.

Definition at line 1105 of file TsDataSvc.cpp.

1106 {
1107 STD_LOCK_GUARD_MACRO
1108 if ( checkRoot() ) {
1109 try {
1110 RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1111 if ( 0 != from_entry ) {
1112 // First check if both objects are already registered to the store
1113 RegEntry* to_entry = m_root->findLeaf(to);
1114 if ( 0 == to_entry ) {
1115 return INVALID_OBJECT;
1116 }
1117 else {
1118 std::string::size_type sep = objPath.rfind(SEPARATOR);
1119 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1120 DataObject* pO = 0;
1121 std::string fromPath(objPath, 0, sep);
1122 StatusCode sc = retrieveObject(from, fromPath, pO);
1123 if ( sc.isSuccess() ) {
1124 std::string toPath(objPath, sep, objPath.length());
1125 sc = linkObject(pO->registry(), toPath, to);
1126 }
1127 return sc;
1128 }
1129 // Now register the soft link
1130 StatusCode status = from_entry->add( objPath, to, true);
1131 return status.isSuccess() ?
1132 IDataProviderSvc_NO_ERROR : DOUBL_OBJ_PATH;
1133 }
1134 }
1135 }
1136 catch (...) {
1137 }
1138 return INVALID_PARENT;
1139 }
1140 return INVALID_ROOT;
1141 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
std::string::rfind
T rfind(T...args)
merge_files.sc
int sc
Definition: merge_files.py:167
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1105
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::length
T length(T...args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

Add a link to another object.

Definition at line 1160 of file TsDataSvc.cpp.

1162 {
1163 STD_LOCK_GUARD_MACRO
1164 DataObject* pO = 0;
1165 StatusCode status = retrieveObject(from, pO);
1166 if ( status.isSuccess() ) {
1167 return linkObject(pO->registry(), objPath, to);
1168 }
1169 return status;
1170 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1105
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

Add a link to another object.

Definition at line 1173 of file TsDataSvc.cpp.

1175 {
1176 STD_LOCK_GUARD_MACRO
1177 if ( 0 != from ) {
1178 IRegistry* from_entry = from->registry();
1179 if ( 0 != from_entry ) {
1180 return linkObject( from_entry, objPath, to);
1181 }
1182 }
1183 return INVALID_PARENT;
1184 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1105
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

Add a link to another object.

Definition at line 1144 of file TsDataSvc.cpp.

1145 {
1146 STD_LOCK_GUARD_MACRO
1147 if ( fullPath.length() > 0 ) {
1148 if ( fullPath[0] != SEPARATOR ) {
1149 return linkObject(m_rootName, fullPath, to);
1150 }
1151 std::string::size_type sep = fullPath.rfind(SEPARATOR);
1152 std::string objPath(fullPath, sep, fullPath.length());
1153 std::string fromPath(fullPath, 0, sep);
1154 return linkObject( fromPath, objPath, to);
1155 }
1156 return INVALID_OBJ_PATH;
1157 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::rfind
T rfind(T...args)
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
std::string
STL class.
TsDataSvc::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: TsDataSvc.cpp:1105
std::string::length
T length(T...args)
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

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

Definition at line 691 of file TsDataSvc.cpp.

691 {
692 IConversionSvc* pLoader = getDataLoader(pRegistry);
693 return loadObject(pLoader, pRegistry);
694 }
IConversionSvc
Definition: IConversionSvc.h:37
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:1392
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:691

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

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

Definition at line 699 of file TsDataSvc.cpp.

699 {
700 STD_LOCK_GUARD_MACRO
701 StatusCode status = INVALID_OBJ_ADDR;
702 DataObject* pObject = 0;
703 if ( 0 == pLoader ) { // Precondition: Data loader must be present
704 if (handleDataFault(pRegistry) != 0) return SUCCESS;
705 else return NO_DATA_LOADER;
706 }
707 if ( 0 == pRegistry ) { // Precondition: Directory must be valid
708 if (handleDataFault(pRegistry) != 0) return SUCCESS;
709 else return INVALID_OBJ_ADDR;
710 }
711
712 VERMSG << "Requested object " << pRegistry->identifier() << endmsg;
713
714 if ( m_enableAccessHdlr ) {
715 // Fire data access incident
716 DataIncident incident(name(), m_accessName, pRegistry->identifier());
717 m_incidentSvc->fireIncident(incident);
718 }
719 if ( m_inhibitPathes.size() > 0 ) {
720 const std::string& ident = pRegistry->identifier();
721 std::vector<std::string>::iterator inhibit =
722 std::find(m_inhibitPathes.begin(), m_inhibitPathes.end(), ident);
723 if ( inhibit != m_inhibitPathes.end() ) {
724 return NO_ACCESS;
725 }
726 }
727 IOpaqueAddress* pAddress = pRegistry->address();
728 if ( 0 == pAddress ) { // Precondition:
729 return INVALID_OBJ_ADDR; // Address must be valid
730 }
731 try {
732 status = pLoader->createObj(pAddress, pObject); // Call data loader
733 if ( status.isSuccess() ) {
734
735 VERMSG << "Object " << pRegistry->identifier() << " created" << endmsg;
736
737 RegEntry *pEntry = CAST_REGENTRY(RegEntry*,pRegistry);
738 pEntry->setObject(pObject);
739
740 VERMSG << "Filling object " << pRegistry->identifier() << endmsg;
741 status = pLoader->fillObjRefs(pAddress, pObject);
742 }
743 }
744 catch( const GaudiException& exc ) {
745 if ( handleDataFault(pRegistry) != 0 ) {
746 return SUCCESS;
747 }
748 throw GaudiException("GaudiException in loadObject() " + pRegistry->identifier(),
749 name(), StatusCode::FAILURE, exc);
750 }
751 catch( const std::exception& x) {
752 if ( handleDataFault(pRegistry) != 0 ) {
753 return SUCCESS;
754 }
755 throw GaudiException("std::exception in loadObject() " + pRegistry->identifier() +
756 ": " + System::typeinfoName(typeid(x)) + ", " + x.what(),
757 name(), StatusCode::FAILURE);
758 }
759 catch(...) {
760 if ( handleDataFault(pRegistry) != 0 ) {
761 return SUCCESS;
762 }
763 throw GaudiException("UNKN exception in loadObject() " + pRegistry->identifier(),
764 name(), StatusCode::FAILURE);
765 }
766 if ( !status.isSuccess() ) {
767 if ( handleDataFault(pRegistry) != 0 ) {
768 return StatusCode::SUCCESS;
769 }
770 }
771 ON_VERBOSE if ( status.isSuccess() ) {
772 verbose() << "Object " << pRegistry->identifier() << " successfully loaded" << endmsg;
773 }
774 return status;
775 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
IConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
CommonMessagingBase::verbose
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
Definition: CommonMessaging.h:130
TsDataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: TsDataSvc.h:87
std::vector::end
T end(T...args)
TsDataSvc::m_accessName
std::string m_accessName
Name of the data access incident.
Definition: TsDataSvc.h:97
std::string
STL class.
VERMSG
#define VERMSG
Definition: TsDataSvc.cpp:72
TsDataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: TsDataSvc.h:95
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:122
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
StatusCode::FAILURE
Definition: StatusCode.h:29
ON_VERBOSE
#define ON_VERBOSE
Definition: TsDataSvc.cpp:69
std::exception::what
T what(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:656
std::exception
STL class.
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::find
T find(T...args)
std::vector::size
T size(T...args)
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
std::vector
STL class.
std::vector::begin
T begin(T...args)
DataIncident
Data service incident class.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

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

IDataManagerSvc: Explore an object identified by its pointer.

Definition at line 249 of file TsDataSvc.cpp.

250 {
251 STD_LOCK_GUARD_MACRO
252 if ( pObject ) {
253 return objectLeaves(pObject->registry(), leaves);
254 }
255 return INVALID_OBJECT;
256 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
TsDataSvc::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: TsDataSvc.cpp:249
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

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

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

Definition at line 261 of file TsDataSvc.cpp.

262 {
263 STD_LOCK_GUARD_MACRO
264 if ( checkRoot() ) {
265 const RegEntry* node_entry = CAST_REGENTRY(const RegEntry*,pRegistry);
266 if ( node_entry ) {
267 std::copy(node_entry->leaves().begin(),node_entry->leaves().end(),back_inserter(leaves));
268 //leaves = node_entry->leaves();
269 return StatusCode::SUCCESS;
270 }
271 return INVALID_OBJECT;
272 }
273 return INVALID_ROOT;
274 }
std::copy
T copy(T...args)
std::vector::end
T end(T...args)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:150
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::vector::begin
T begin(T...args)
std::back_inserter
T back_inserter(T...args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

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

Definition at line 225 of file TsDataSvc.cpp.

226 {
227 STD_LOCK_GUARD_MACRO
228 if ( pObject ) {
229 return objectParent(pObject->registry(), refpParent);
230 }
231 return INVALID_OBJECT;
232 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: TsDataSvc.cpp:225

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

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

Definition at line 234 of file TsDataSvc.cpp.

235 {
236 STD_LOCK_GUARD_MACRO
237 if ( checkRoot() ) {
238 const RegEntry* node_entry = CAST_REGENTRY(const RegEntry*,pRegistry);
239 if ( node_entry ) {
240 refpParent = node_entry->parent();
241 return StatusCode::SUCCESS;
242 }
243 return INVALID_OBJECT;
244 }
245 return INVALID_ROOT;
246 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:142
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

TsDataSvc& TsDataSvc::operator= | ( | const TsDataSvc & |  | ) |
| private

Fake assignment operator (never implemented).

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

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

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

Parameters

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

Returns
  Status code indicating success or failure.

Definition at line 1290 of file TsDataSvc.cpp.

1290 {
1291 //unused: StatusCode sc = StatusCode::FAILURE;
1292 if ( 0 != pObject && depth++ < load_depth ) {
1293 RegEntry* dir = CAST_REGENTRY(RegEntry*,pObject->registry());
1294 if ( 0 != dir ) {
1295 for (RegEntry::Iterator i = dir->begin(); i != dir->end(); i++ ) {
1296 DataObject *pObj = 0;
1297 StatusCode status = retrieveObject(pObject, (*i)->name(), pObj);
1298 if ( status.isSuccess() && depth < load_depth ) {
1299 preLoad(depth, load_depth, pObj).ignore();
1300 }
1301 }
1302 }
1303 }
1304 return StatusCode::SUCCESS;
1305 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1308
DataSvcHelpers::RegistryEntry::begin
virtual Iterator begin() const
Return starting point for container iteration.
Definition: RegistryEntry.h:162
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::Iterator
Store::const_iterator Iterator
Iterator definition.
Definition: RegistryEntry.h:45
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:78
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ana.i
list i
Definition: ana.py:128
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
DataSvcHelpers::RegistryEntry::end
virtual Iterator end() const
Return end elemtn if the container.
Definition: RegistryEntry.h:166

StatusCode TsDataSvc::preLoad | ( |  | ) |
| override

load all preload items of the list

Definition at line 1308 of file TsDataSvc.cpp.

1308 {
1309 DataObject* pObj = 0;
1310 for (LoadItems::iterator i = m_preLoads.begin(); i != m_preLoads.end(); i++) {
1311 StatusCode sc = retrieveObject( (*i).path(), pObj);
1312 int load_depth = (*i).depth();
1313 if ( sc.isSuccess() && load_depth > 1 ) {
1314 preLoad(1, load_depth, pObj).ignore();
1315 }
1316 }
1317 return StatusCode::SUCCESS;
1318 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::vector::end
T end(T...args)
merge_files.sc
int sc
Definition: merge_files.py:167
TsDataSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: TsDataSvc.cpp:1308
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:83
std::vector::begin
T begin(T...args)
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ana.i
list i
Definition: ana.py:128

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

IDataManagerSvc: Register object address with the data store.

Definition at line 277 of file TsDataSvc.cpp.

278 {
279 if ( fullPath.length() > 0 ) {
280 if ( fullPath[0] != SEPARATOR ) {
281 return registerAddress(m_root, fullPath, pAddress);
282 }
283 IRegistry* pRegistry = 0;
284 return registerAddress(pRegistry, fullPath, pAddress);
285 }
286 return INVALID_OBJ_PATH;
287 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::string::length
T length(T...args)
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:277

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

IDataManagerSvc: Register object address with the data store.

Definition at line 290 of file TsDataSvc.cpp.

292 {
293 IRegistry* pRegistry = (0 == parentObj) ? 0 : parentObj->registry();
294 return registerAddress(pRegistry, objectPath, pAddress);
295 }
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:277

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

IDataManagerSvc: Register object address with the data store.

Definition at line 298 of file TsDataSvc.cpp.

300 {
301 if ( checkRoot() ) {
302 if ( objPath.length() > 0 ) {
303 if ( 0 == parentObj ) {
304 if ( objPath[0] != SEPARATOR ) {
305 return registerAddress(m_root, objPath, pAddress);
306 }
307 std::string::size_type sep = objPath.find(SEPARATOR,1);
308 if ( sep != std::string::npos ) {
309 std::string p_path (objPath, 0, sep);
310 if ( p_path == m_rootName ) {
311 std::string o_path (objPath, sep, objPath.length());
312 return registerAddress(m_root, o_path, pAddress);
313 }
314 }
315 return INVALID_PARENT;
316 }
317 if ( objPath[0] != SEPARATOR ) {
318 std::string path;
319 path = SEPARATOR;
320 path += objPath;
321 return registerAddress(parentObj, path, pAddress);
322 }
323 RegEntry* par_entry = CAST_REGENTRY(RegEntry*,parentObj);
324 if ( 0 != par_entry ) {
325 std::string::size_type sep = objPath.rfind(SEPARATOR);
326 if ( sep > 0 && sep != std::string::npos ) {
327 std::string p_path (objPath, 0, sep);
328 std::string o_path (objPath, sep, objPath.length());
329 RegEntry* p_entry = par_entry->findLeaf(p_path);
330 // Create default object leafs if the
331 // intermediate nodes are not present
332 if ( 0 == p_entry && m_forceLeaves ) {
333 DataObject *pLeaf = createDefaultObject();
334 StatusCode sc = registerObject(par_entry->identifier(),
335 p_path,
336 pLeaf);
337 if ( ! sc.isSuccess() ) {
338 delete pLeaf;
339 }
340 p_entry = par_entry->findLeaf(p_path);
341 }
342 if ( 0 != p_entry ) {
343 return registerAddress(p_entry, o_path, pAddress);
344 }
345 return INVALID_PARENT;
346 }
347 StatusCode status = par_entry->add(objPath, pAddress);
348 if ( status.isSuccess() ) {
349 return status;
350 }
351 return DOUBL_OBJ_PATH;
352 }
353 return INVALID_PARENT;
354 }
355 return INVALID_OBJ_PATH;
356 }
357 return INVALID_ROOT;
358 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
merge_files.sc
int sc
Definition: merge_files.py:167
std::string
STL class.
TsDataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: TsDataSvc.h:85
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:126
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1385
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427
TsDataSvc::registerAddress
StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition: TsDataSvc.cpp:277
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

Register object with the data store.

Definition at line 427 of file TsDataSvc.cpp.

428 {
429 return registerObject(0, fullPath, pObject);
430 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427

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

Register object with the data store.

Definition at line 434 of file TsDataSvc.cpp.

436 {
437 DataObject* pO = 0;
438 StatusCode status = retrieveObject(parentPath, pO);
439 if ( !status.isSuccess() && m_forceLeaves ) {
440 pO = createDefaultObject();
441 status = registerObject(parentPath, pO);
442 if ( !status.isSuccess() ) {
443 pO->release();
444 }
445 }
446 if ( status.isSuccess() ) {
447 status = registerObject(pO, objPath, pObject);
448 }
449 return status;
450 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: TsDataSvc.h:85
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1385
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Register object with the data store.

Definition at line 453 of file TsDataSvc.cpp.

455 {
456 return registerObject(parentPath, itemToPath(item), pObject);
457 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Register object with the data store.

Definition at line 467 of file TsDataSvc.cpp.

469 {
470 if ( checkRoot() ) {
471 if ( 0 == parentObj ) {
472 if ( objPath.length() > 0 ) {
473 if ( objPath[0] == SEPARATOR ) {
474 std::string::size_type sep = objPath.find(SEPARATOR,1);
475 if ( sep != std::string::npos ) {
476 std::string p_path (objPath, 0, sep);
477 std::string o_path (objPath, sep, objPath.length());
478 return registerObject(p_path, o_path, pObject);
479 }
480 }
481 else {
482 return registerObject(m_rootName, objPath, pObject);
483 }
484 }
485 return INVALID_OBJ_PATH;
486 }
487 RegEntry* node_entry = CAST_REGENTRY(RegEntry*,parentObj->registry());
488 if ( 0 != node_entry ) {
489 StatusCode status = INVALID_PARENT;
490 std::string::size_type sep = objPath.find(SEPARATOR,1);
491 if ( sep != std::string::npos ) {
492 std::string p_path (objPath, 0, sep);
493 std::string o_path (objPath, sep, objPath.length());
494 RegEntry* par_entry = node_entry->findLeaf(p_path);
495 // Create default object leafs if the
496 // intermediate nodes are not present
497 if ( 0 == par_entry && m_forceLeaves ) {
498 DataObject *pLeaf = createDefaultObject();
499 StatusCode sc = registerObject(parentObj, p_path, pLeaf);
500 if ( ! sc.isSuccess() ) {
501 delete pLeaf;
502 }
503 par_entry = node_entry->findLeaf(p_path);
504 }
505 else if ( 0 != par_entry && par_entry->object() == 0 ) {
506 status = retrieveEntry( node_entry, p_path, par_entry);
507 if ( !status.isSuccess() && !par_entry->address() && m_forceLeaves ) {
508 DataObject *pLeaf = createDefaultObject();
509 StatusCode sc = registerObject(parentObj, p_path, pLeaf);
510 if ( ! sc.isSuccess() ) {
511 delete pLeaf;
512 }
513 par_entry = node_entry->findLeaf(p_path);
514 }
515 }
516 node_entry = par_entry;
517 if ( 0 != node_entry ) {
518 DataObject* obj = node_entry->object();
519 if ( 0 != obj ) {
520 status = registerObject( obj, o_path, pObject );
521 }
522 }
523 }
524 else {
525 RegEntry* leaf = node_entry->findLeaf(objPath);
526 if ( 0 == leaf ) {
527 status = node_entry->add( objPath, pObject );
528 }
529 else {
530 DataObject* obj = leaf->object();
531 if ( 0 == obj ) {
532 if (0 == pObject) {
533 error() << "registerObject: trying to register null DataObject" << endmsg;
534 return StatusCode::FAILURE;
535 }
536 else {
537 pObject->setRegistry(leaf);
538 }
539 leaf->setAddress(0);
540 leaf->setObject(pObject);
541 status = StatusCode::SUCCESS;
542 }
543 else {
544 status = DOUBL_OBJ_PATH;
545 }
546 }
547 }
548 return status;
549 }
550 return INVALID_PARENT;
551 }
552 return INVALID_ROOT;
553 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::add
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Definition: RegistryEntry.cpp:197
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
merge_files.sc
int sc
Definition: merge_files.py:167
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:112
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:122
StatusCode::FAILURE
Definition: StatusCode.h:29
TsDataSvc::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: TsDataSvc.h:85
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(T...args)
TsDataSvc::createDefaultObject
virtual DataObject * createDefaultObject() const
Create default objects in case forced creation of leaves is requested.
Definition: TsDataSvc.cpp:1385
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:778

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

Register object with the data store.

Definition at line 460 of file TsDataSvc.cpp.

462 {
463 return registerObject(parentObj, itemToPath(item), pObject);
464 }
TsDataSvc::registerObject
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: TsDataSvc.cpp:427
ana.item
tuple item
print s1,s2
Definition: ana.py:146

StatusCode TsDataSvc::reinitialize | ( |  | ) |
| override

Service initialization.

Service reinitialization.

Definition at line 1335 of file TsDataSvc.cpp.

1335 {
1336 StatusCode sc;
1337 // the finalize part is copied here
1338 setDataLoader(0).ignore();
1339 resetPreLoad().ignore();
1340 clearStore().ignore();
1341 if ( m_incidentSvc ) {
1342 m_incidentSvc->release();
1343 m_incidentSvc = 0;
1344 }
1345 // re-initialize the base class
1346 sc = Service::reinitialize();
1347 if ( UNLIKELY(!sc.isSuccess()) ) {
1348 error() << "Unable to reinitialize base class" << endmsg;
1349 return sc;
1350 }
1351 // the initialize part is copied here
1352 sc = service("IncidentSvc", m_incidentSvc, true);
1353 if ( UNLIKELY(!sc.isSuccess()) ) {
1354 error() << "Failed to access incident service." << endmsg;
1355 return sc;
1356 }
1357 // return
1358 return StatusCode::SUCCESS;
1359 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
TsDataSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: TsDataSvc.cpp:1284
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
TsDataSvc::m_incidentSvc
IIncidentSvc * m_incidentSvc
Pointer to incident service.
Definition: TsDataSvc.h:81
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:282
TsDataSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=0) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition: TsDataSvc.cpp:214
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:144
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Remove an item from the preload list.

Definition at line 1269 of file TsDataSvc.cpp.

1269 {
1270 LoadItems::iterator i =
1271 std::remove(m_preLoads.begin(), m_preLoads.end(), item);
1272 if ( i != m_preLoads.end() ) {
1273 m_preLoads.erase(i, m_preLoads.end());
1274 }
1275 return StatusCode::SUCCESS;
1276 }
std::vector::end
T end(T...args)
std::remove
T remove(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:83
std::vector::erase
T erase(T...args)
std::vector::begin
T begin(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
ana.i
list i
Definition: ana.py:128

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

Add an item to the preload list.

Definition at line 1279 of file TsDataSvc.cpp.

1279 {
1280 return removePreLoadItem( DataStoreItem(itemPath,1) );
1281 }
TsDataSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: TsDataSvc.cpp:1269
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17

StatusCode TsDataSvc::resetPreLoad | ( |  | ) |
| override

Clear the preload list.

Definition at line 1284 of file TsDataSvc.cpp.

1284 {
1285 m_preLoads.erase(m_preLoads.begin(), m_preLoads.end());
1286 return StatusCode::SUCCESS;
1287 }
std::vector::end
T end(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:83
std::vector::erase
T erase(T...args)
std::vector::begin
T begin(T...args)

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

Retrieve registry entry from store.

Definition at line 778 of file TsDataSvc.cpp.

780 {
781 STD_LOCK_GUARD_MACRO
782 std::string::size_type sep = path.find(SEPARATOR,1);
783 StatusCode status = StatusCode(INVALID_ROOT,true);
784 pEntry = 0;
785 // A.Valassi 16.08.2001 avoid core dump if store is empty
786 if ( checkRoot() ) {
787 if ( 0 == parentObj ) {
788 if ( path.length() == 0 || path == m_rootName ) {
789 return retrieveEntry(m_root, "", pEntry);
790 }
791 else if ( path[0] != SEPARATOR ) {
792 return retrieveEntry(m_root, path, pEntry);
793 }
794 else if ( sep != std::string::npos ) {
795 if ( m_root->object() == 0 ) {
796 RegEntry* r = 0;
797 status = retrieveEntry(m_root, "", r);
798 if ( !status.isSuccess() ) {
799 return status;
800 }
801 }
802 std::string o_path (path, sep, path.length());
803 return retrieveEntry(m_root, o_path, pEntry);
804 }
805 return INVALID_OBJ_PATH;
806 }
807 if ( sep != std::string::npos ) { // the string contains a separator (after pos 0)
808 std::string p_path (path,0,sep);
809 std::string o_path (path,sep,path.length());
810 if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
811 status = loadObject(parentObj);
812 if ( !status.isSuccess() ) {
813 return status;
814 }
815 }
816 RegEntry* root_entry = parentObj->findLeaf(p_path);
817 if ( !root_entry && m_enableFaultHdlr ) {
818 // If not even the parent is there, an incident
819 // to load the parent must be fired...
820 handleDataFault(parentObj, p_path);
821 root_entry = parentObj->findLeaf(p_path);
822 }
823 if ( root_entry ) {
824 DataObject* pO = root_entry->object();
825 if ( 0 == pO ) {
826 // Object is not loaded: load the object if at all possible
827 status = loadObject(root_entry);
828 if ( !status.isSuccess() ) {
829 return status;
830 }
831 }
832 if ( root_entry->isSoft() ) {
833 root_entry = CAST_REGENTRY(RegEntry*,pO->registry());
834 }
835 return retrieveEntry (root_entry, o_path, pEntry);
836 }
837 return status;
838 }
839 else if ( path.length() == 0 ) {
840 pEntry = parentObj;
841 }
842 else {
843 if (!parentObj->object()) { // if the parent object has not been loaded yet, load it now
844 status = loadObject(parentObj);
845 if ( !status.isSuccess() ) {
846 return status;
847 }
848 }
849 // last leave in search: find leaf and load
850 pEntry = parentObj->findLeaf(path);
851 // If no registry entry was found, trigger incident for action-on-demand
852 if ( !pEntry && m_enableFaultHdlr ) {
853 handleDataFault(parentObj, path);
854 pEntry = (0==path.length()) ? parentObj : parentObj->findLeaf(path);
855 }
856 }
857 // Check results and return
858 if ( 0 == pEntry ) {
859 status = INVALID_OBJ_PATH;
860 }
861 else if ( 0 == pEntry->object() ) {
862 status = loadObject(pEntry);
863 }
864 else if ( m_enableAccessHdlr ) {
865 // Fire data access incident
866 // I do not know if this is a good idea....
867 // This fires too often!
868 //
869 //DataIncident incident(name(), m_accessName, pEntry->identifier());
870 //m_incidentSvc->fireIncident(incident);
871 status = SUCCESS;
872 }
873 else {
874 status = SUCCESS;
875 }
876 }
877 return status;
878 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
TsDataSvc::m_enableAccessHdlr
bool m_enableAccessHdlr
Flag to enable interrupts on data access requests.
Definition: TsDataSvc.h:87
TsDataSvc::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: TsDataSvc.h:89
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
DataSvcHelpers::RegistryEntry::isSoft
virtual bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:146
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::handleDataFault
DataObject * handleDataFault(IRegistry *pReg, const std::string &path="")
Invoke data fault handling if enabled.
Definition: TsDataSvc.cpp:656
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(T...args)
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:691
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:778

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

Retrieve object from data store.

Retrieve object identified by its directory from the data store.

Definition at line 881 of file TsDataSvc.cpp.

883 {
884 STD_LOCK_GUARD_MACRO
885 pObject = 0;
886 RegEntry *result = 0, *parent = CAST_REGENTRY(RegEntry*,pRegistry);
887 StatusCode status = retrieveEntry(parent, path, result);
888 if ( status.isSuccess() ) {
889 pObject = result->object();
890 }
891 return status;
892 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
TsDataSvc::retrieveEntry
StatusCode retrieveEntry(DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
Retrieve registry entry from store.
Definition: TsDataSvc.cpp:778

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

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

Definition at line 895 of file TsDataSvc.cpp.

896 {
897 IRegistry* nullDir = 0;
898 return retrieveObject(nullDir, fullPath, pObject);
899 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

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

Retrieve object from data store.

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

Definition at line 902 of file TsDataSvc.cpp.

904 {
905 DataObject* parent = 0;
906 StatusCode status = retrieveObject(parentPath, parent);
907 if ( status.isSuccess() ) {
908 status = retrieveObject (parent, objectPath, pObject);
909 }
910 return status;
911 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

Retrieve object from data store.

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

Definition at line 914 of file TsDataSvc.cpp.

916 {
917 return retrieveObject(parentPath, itemToPath(item), pObject);
918 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

Retrieve object from data store.

Definition at line 921 of file TsDataSvc.cpp.

923 {
924 IRegistry* pRegistry = (0==parentObj) ? 0 : parentObj->registry();
925 return retrieveObject(pRegistry, path, pObject);
926 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191

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

Retrieve object from data store.

Retrieve registry entry from store.

Definition at line 929 of file TsDataSvc.cpp.

931 {
932 return retrieveObject(parentObj, itemToPath(item), pObject);
933 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
ana.item
tuple item
print s1,s2
Definition: ana.py:146

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

IDataManagerSvc: Accessor for root event CLID.

CLID for root Event.

Definition at line 1375 of file TsDataSvc.cpp.

1375 {
1376 return( (CLID)m_rootCLID );
1377 }
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
TsDataSvc::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: TsDataSvc.h:75

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

IDataManagerSvc: Accessor for root event name.

Name for root Event.

Definition at line 1380 of file TsDataSvc.cpp.

1380 {
1381 return( m_rootName );
1382 }
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77

StatusCode TsDataSvc::setDataLoader | ( | IConversionSvc * | svc,
|  | IDataProviderSvc * | dpsvc = `0`
| ) |  |
| override

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

IDataManagerSvc: Pass a default data loader to the service.

Definition at line 214 of file TsDataSvc.cpp.

214 {
215 if ( 0 != pDataLoader ) pDataLoader->addRef();
216 if ( 0 != m_dataLoader ) m_dataLoader->release();
217 if ( 0 != pDataLoader ) {
218 pDataLoader->setDataProvider(dpsvc == nullptr ? this : dpsvc).ignore();
219 }
220 m_dataLoader = pDataLoader;
221 return SUCCESS;
222 }
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:79
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
IInterface::release
virtual unsigned long release()=0
Release Interface instance.

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

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

Takes care to clear the store before reinitializing it

Definition at line 165 of file TsDataSvc.cpp.

166 {
167 clearStore().ignore();
168 return i_setRoot (std::move(root_path), pRootObj);
169 }
std::move
T move(T...args)
TsDataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: TsDataSvc.cpp:176
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108

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

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

Takes care to clear the store before reinitializing it

Definition at line 191 of file TsDataSvc.cpp.

192 {
193 clearStore().ignore();
194 return i_setRoot (std::move(root_path), pRootAddr);
195 }
std::move
T move(T...args)
TsDataSvc::i_setRoot
virtual StatusCode i_setRoot(std::string root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: TsDataSvc.cpp:176
TsDataSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: TsDataSvc.cpp:115
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108

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

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

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

Definition at line 127 of file TsDataSvc.cpp.

128 {
129 STD_LOCK_GUARD_MACRO
130 DataObject* pO = 0;
131 StatusCode status = findObject(sub_tree_path, pO);
132 if ( status.isSuccess() ) {
133 status = traverseSubTree(pO, pAgent);
134 }
135 return status;
136 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::traverseSubTree
StatusCode traverseSubTree(const std::string &sub_tree_path, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: TsDataSvc.cpp:127
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

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

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

Definition at line 139 of file TsDataSvc.cpp.

140 {
141 STD_LOCK_GUARD_MACRO
142 if ( checkRoot() ) {
143 RegEntry* entry = CAST_REGENTRY(RegEntry*,pObject->registry());
144 if ( 0 != entry ) {
145 return entry->traverseTree(pAgent);
146 }
147 return INVALID_OBJECT;
148 }
149 return INVALID_ROOT;
150 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:285
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

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

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

Definition at line 153 of file TsDataSvc.cpp.

153 {
154 STD_LOCK_GUARD_MACRO
155 if ( checkRoot() ) {
156 return m_root->traverseTree(pAgent);
157 }
158 return INVALID_ROOT;
159 }
DataSvcHelpers::RegistryEntry::traverseTree
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
Definition: RegistryEntry.cpp:285
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

Remove a link to another object.

Definition at line 1187 of file TsDataSvc.cpp.

1188 {
1189 STD_LOCK_GUARD_MACRO
1190 if ( checkRoot() ) {
1191 try {
1192 RegEntry* from_entry = CAST_REGENTRY(RegEntry*,from);
1193 if ( 0 != from_entry ) {
1194 std::string::size_type sep = objPath.rfind(SEPARATOR);
1195 if ( sep > 0 && sep != std::string::npos ) { // in case the objPath is a sub-directory itself
1196 DataObject* pO = 0;
1197 std::string fromPath(objPath, 0, sep);
1198 StatusCode sc = findObject(from, fromPath, pO);
1199 if ( sc.isSuccess() ) {
1200 std::string toPath(objPath, sep, objPath.length());
1201 sc = unlinkObject(pO->registry(), toPath);
1202 }
1203 return sc;
1204 }
1205 StatusCode status = from_entry->remove( objPath );
1206 if ( status.isSuccess() ) {
1207 return status;
1208 }
1209 return INVALID_OBJ_PATH;
1210 }
1211 }
1212 catch (...) {
1213 }
1214 return INVALID_PARENT;
1215 }
1216 return INVALID_ROOT;
1217 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1187
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string::rfind
T rfind(T...args)
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
merge_files.sc
int sc
Definition: merge_files.py:167
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::length
T length(T...args)
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Remove a link to another object.

Definition at line 1234 of file TsDataSvc.cpp.

1235 {
1236 DataObject* pObject = 0;
1237 StatusCode status = findObject(from, pObject);
1238 if ( status.isSuccess() ) {
1239 status = unlinkObject(pObject->registry(), objPath);
1240 }
1241 return status;
1242 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1187
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Remove a link to another object.

Definition at line 1245 of file TsDataSvc.cpp.

1246 {
1247 if ( checkRoot() ) {
1248 IRegistry* from_entry = m_root->findLeaf(from);
1249 return unlinkObject(from_entry, objPath);
1250 }
1251 return INVALID_ROOT;
1252 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1187
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413

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

Remove a link to another object.

Definition at line 1220 of file TsDataSvc.cpp.

1220 {
1221 if ( fullPath.length() > 0 ) {
1222 if ( fullPath[0] != SEPARATOR ) {
1223 return unlinkObject(m_rootName, fullPath);
1224 }
1225 std::string::size_type sep = fullPath.rfind(SEPARATOR);
1226 std::string objPath(fullPath, sep, fullPath.length());
1227 std::string fromPath(fullPath, 0, sep);
1228 return unlinkObject(fromPath, objPath);
1229 }
1230 return INVALID_OBJ_PATH;
1231 }
TsDataSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: TsDataSvc.cpp:1187
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::rfind
T rfind(T...args)
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
std::string
STL class.
std::string::length
T length(T...args)

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 361 of file TsDataSvc.cpp.

361 {
362 if ( fullPath.length() > 0 ) {
363 IRegistry* pRegistry = 0;
364 if ( fullPath[0] != SEPARATOR ) {
365 return unregisterAddress(m_root, fullPath);
366 }
367 return unregisterAddress(pRegistry, fullPath);
368 }
369 return INVALID_OBJ_PATH;
370 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:361
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::string::length
T length(T...args)

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 373 of file TsDataSvc.cpp.

374 {
375 IRegistry* pRegistry = (0 == pParent) ? 0 : pParent->registry();
376 return unregisterAddress(pRegistry, objPath);
377 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:361
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22

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

IDataManagerSvc: Unregister object address from the data store.

Definition at line 380 of file TsDataSvc.cpp.

381 {
382 if ( checkRoot() ) {
383 if ( objPath.length() > 0 ) {
384 if ( 0 == pParent ) {
385 if ( objPath[0] != SEPARATOR ) {
386 return unregisterAddress(m_root, objPath);
387 }
388 std::string::size_type sep = objPath.find(SEPARATOR,1);
389 if ( sep != std::string::npos ) {
390 std::string p_path (objPath, 0, sep);
391 if ( p_path == m_rootName ) {
392 std::string o_path (objPath, sep, objPath.length());
393 return unregisterAddress(m_root, o_path);
394 }
395 }
396 return INVALID_PARENT;
397 }
398 if ( objPath[0] != SEPARATOR ) {
399 std::string path;
400 path = SEPARATOR;
401 path += objPath;
402 return unregisterAddress(pParent, path);
403 }
404 RegEntry* node_entry = CAST_REGENTRY(RegEntry*,pParent);
405 if ( 0 != node_entry ) {
406 RegEntry* leaf_entry = node_entry->findLeaf(objPath);
407 if ( 0 != leaf_entry ) {
408 std::string::size_type sep = objPath.rfind(SEPARATOR);
409 if ( sep > 0 && sep != std::string::npos ) {
410 std::string path = objPath.substr(sep);
411 return unregisterAddress(leaf_entry->parent(), path);
412 }
413 StatusCode status = node_entry->remove(objPath);
414 if ( status.isSuccess() ) {
415 return status;
416 }
417 }
418 }
419 return INVALID_PARENT;
420 }
421 return INVALID_OBJ_PATH;
422 }
423 return INVALID_ROOT;
424 }
TsDataSvc::unregisterAddress
StatusCode unregisterAddress(const std::string &fullPath) override
IDataManagerSvc: Unregister object address from the data store.
Definition: TsDataSvc.cpp:361
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string::rfind
T rfind(T...args)
TsDataSvc::m_rootName
std::string m_rootName
Name of root event.
Definition: TsDataSvc.h:77
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
std::string
STL class.
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::string::find
T find(T...args)
std::string::length
T length(T...args)
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:142
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
std::string::substr
T substr(T...args)
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

Unregister object from the data store.

Definition at line 556 of file TsDataSvc.cpp.

556 {
557 DataObject* pObject = 0;
558 StatusCode status = findObject(fullPath, pObject);
559 if ( status.isSuccess() ) {
560 RegEntry* pEntry = CAST_REGENTRY(RegEntry*,pObject->registry());
561 if ( 0 != pEntry ) {
562 if ( pEntry->isEmpty() ) {
563 RegEntry* pParent = pEntry->parentEntry();
564 if ( 0 != pParent ) {
565 if ( 0 != pObject ) {
566 pObject->addRef();
567 }
568 pParent->remove(pEntry);
569 return StatusCode::SUCCESS;
570 }
571 return INVALID_PARENT;
572 }
573 return DIR_NOT_EMPTY;
574 }
575 return INVALID_ROOT;
576 }
577 return status;
578 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Unregister object from the data store.

Definition at line 581 of file TsDataSvc.cpp.

582 {
583 DataObject* pO = 0;
584 StatusCode status = findObject(parentPath, pO);
585 if ( status.isSuccess() ) {
586 status = unregisterObject(pO, objPath);
587 }
588 return status;
589 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:556
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Unregister object from the data store.

Definition at line 592 of file TsDataSvc.cpp.

592 {
593 return unregisterObject(parentPath, itemToPath(item));
594 }
ana.item
tuple item
print s1,s2
Definition: ana.py:146
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:556

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

Unregister object from the data store.

Definition at line 597 of file TsDataSvc.cpp.

597 {
598 if ( checkRoot() ) {
599 RegEntry* entry = m_root->findLeaf(pObject);
600 if ( 0 != entry ) {
601 RegEntry* parent = entry->parentEntry();
602 if ( 0 != parent ) {
603 if ( entry->isEmpty() ) {
604 if ( 0 != entry->object() ) {
605 entry->object()->addRef();
606 }
607 if ( 0 != parent ) {
608 parent->remove(entry);
609 }
610 return SUCCESS;
611 }
612 return INVALID_PARENT;
613 }
614 return DIR_NOT_EMPTY;
615 }
616 return INVALID_OBJECT;
617 }
618 return INVALID_ROOT;
619 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
TsDataSvc::m_root
DataSvcHelpers::RegistryEntry * m_root
Pointer to root entry.
Definition: TsDataSvc.h:91
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413

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

Unregister object from the data store.

Definition at line 622 of file TsDataSvc.cpp.

623 {
624 if ( checkRoot() ) {
625 try {
626 RegEntry* parent = CAST_REGENTRY(RegEntry*,pParentObj->registry());
627 if ( 0 != parent ) {
628 RegEntry* entry = parent->findLeaf(objectPath);
629 if ( 0 != entry ) {
630 if ( entry->isEmpty() ) {
631 if ( 0 != entry->object() ) {
632 entry->object()->addRef();
633 }
634 parent->remove(entry);
635 return SUCCESS;
636 }
637 return DIR_NOT_EMPTY;
638 }
639 return INVALID_OBJECT;
640 }
641 }
642 catch(...) {
643 }
644 return INVALID_PARENT;
645 }
646 return INVALID_ROOT;
647 }
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:95
DataSvcHelpers::RegistryEntry::remove
virtual long remove(const std::string &name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:146
DataObject::addRef
virtual unsigned long addRef()
Add reference to object.
Definition: DataObject.cpp:63
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:158
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: TsDataSvc.cpp:64

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

Unregister object from the data store.

Definition at line 650 of file TsDataSvc.cpp.

650 {
651 return unregisterObject(pParentObj, itemToPath(item));
652 }
ana.item
tuple item
print s1,s2
Definition: ana.py:146
TsDataSvc::unregisterObject
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: TsDataSvc.cpp:556

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

Update object identified by its directory entry.

Update object.

Definition at line 1017 of file TsDataSvc.cpp.

1017 {
1018 if ( 0 == pRegistry ) { // Precondition:
1019 return INVALID_OBJ_ADDR; // Addres must be valid
1020 }
1021 DataObject* toUpdate = pRegistry->object();
1022 if ( 0 == toUpdate ) { // Try first to load
1023 return loadObject(pRegistry);
1024 }
1025 return updateObject(toUpdate);
1026 }
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:1017
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::loadObject
virtual StatusCode loadObject(IRegistry *pNode)
Invoke Persistency service to create transient object from its persistent representation.
Definition: TsDataSvc.cpp:691

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

Update object.

Definition at line 1007 of file TsDataSvc.cpp.

1007 {
1008 DataObject* pO = 0;
1009 StatusCode status = findObject(updatePath, pO);
1010 if ( status.isSuccess() ) {
1011 return updateObject(pO);
1012 }
1013 return retrieveObject(updatePath, pO);
1014 }
TsDataSvc::retrieveObject
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: TsDataSvc.cpp:881
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:1017
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Update object.

Definition at line 1029 of file TsDataSvc.cpp.

1029 {
1030 STD_LOCK_GUARD_MACRO
1031 StatusCode status = INVALID_OBJ_ADDR;
1032 if ( 0 == toUpdate ) { // Precondition:
1033 return INVALID_OBJECT; // Address must be valid
1034 }
1035 IRegistry* pRegistry = toUpdate->registry(); // Precondition:
1036 if ( 0 == pRegistry ) { // Need valid registry
1037 return INVALID_OBJECT;
1038 }
1039 IOpaqueAddress* pAddress = pRegistry->address(); // Precondition:
1040 if ( 0 == pAddress ) { // Need valid address
1041 return INVALID_OBJ_ADDR;
1042 }
1043 IConversionSvc* pLoader = getDataLoader(pRegistry);
1044 if ( 0 == pLoader ) { // Precondition:
1045 return NO_DATA_LOADER; // Data loader must be present
1046 }
1047 if ( m_inhibitPathes.size() > 0 ) {
1048 const std::string& ident = pRegistry->identifier();
1049 std::vector<std::string>::iterator inhibit =
1050 std::find(m_inhibitPathes.begin(), m_inhibitPathes.end(), ident);
1051 if ( inhibit != m_inhibitPathes.end() ) {
1052 return NO_ACCESS;
1053 }
1054 }
1055 try {
1056 status = pLoader->updateObj(pAddress, toUpdate); // Call data loader
1057 if ( status.isSuccess() ) {
1058 status = pLoader->updateObjRefs(pAddress, toUpdate);
1059 }
1060 }
1061 catch( const GaudiException& exc ) {
1062 throw GaudiException("GaudiException in updateObject() " +
1063 pRegistry->name(),
1064 name(),
1065 StatusCode::FAILURE, exc);
1066 }
1067 catch( const std::exception& x) {
1068 throw GaudiException("std::exception in updateObject() " +
1069 pRegistry->name() + ": " +
1070 System::typeinfoName(typeid(x)) + ", " +
1071 x.what(),
1072 name(), StatusCode::FAILURE);
1073 }
1074 catch(...) {
1075 throw GaudiException("UNKN exception in updateObject() " +
1076 pRegistry->name(),
1077 name(), StatusCode::FAILURE);
1078 }
1079 return status;
1080 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
IConversionSvc
Definition: IConversionSvc.h:37
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::vector::end
T end(T...args)
TsDataSvc::getDataLoader
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
Retrieve customizable data loader according to registry entry to be retrieved.
Definition: TsDataSvc.cpp:1392
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
std::string
STL class.
TsDataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: TsDataSvc.h:95
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IConverter::updateObjRefs
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::exception
STL class.
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::find
T find(T...args)
std::vector::size
T size(T...args)
std::vector
STL class.
std::vector::begin
T begin(T...args)
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
STD_LOCK_GUARD_MACRO
#define STD_LOCK_GUARD_MACRO
Definition: TsDataSvc.cpp:46

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

Update object.

Definition at line 1083 of file TsDataSvc.cpp.

1084 {
1085 DataObject* pParent = 0;
1086 StatusCode status = findObject(parentPath, pParent);
1087 if ( status.isSuccess() ) {
1088 status = updateObject( pParent, updatePath);
1089 }
1090 return status;
1091 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:1017
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

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

Update object.

Definition at line 1094 of file TsDataSvc.cpp.

1095 {
1096 DataObject* pObject = 0;
1097 StatusCode status = findObject(parent, updatePath, pObject);
1098 if ( status.isSuccess() ) {
1099 status = updateObject(pObject);
1100 }
1101 return status;
1102 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
TsDataSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: TsDataSvc.cpp:1017
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
TsDataSvc::findObject
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: TsDataSvc.cpp:956

## Friends And Related Function Documentation

friend class SvcFactory< TsDataSvc >
| friend

The class creator is of course a friend!

Definition at line 67 of file TsDataSvc.h.

## Member Data Documentation

tsDataSvcMutex TsDataSvc::m_accessMutex
| protected

Mutex to protect access to the store.

Definition at line 449 of file TsDataSvc.h.

std::string TsDataSvc::m_accessName
| protected

Name of the data access incident.

Definition at line 97 of file TsDataSvc.h.

IConversionSvc* TsDataSvc::m_dataLoader
| protected

Pointer to data loader service.

Definition at line 79 of file TsDataSvc.h.

bool TsDataSvc::m_enableAccessHdlr
| protected

Flag to enable interrupts on data access requests.

Definition at line 87 of file TsDataSvc.h.

bool TsDataSvc::m_enableFaultHdlr
| protected

Flag to enable interrupts on data creation requests.

Definition at line 89 of file TsDataSvc.h.

std::string TsDataSvc::m_faultName
| protected

Name of the data fault incident.

Definition at line 99 of file TsDataSvc.h.

bool TsDataSvc::m_forceLeaves
| protected

Allow forced creation of default leaves on registerObject.

Definition at line 85 of file TsDataSvc.h.

IIncidentSvc* TsDataSvc::m_incidentSvc
| protected

Pointer to incident service.

Definition at line 81 of file TsDataSvc.h.

DataSvcHelpers::InhibitMap* TsDataSvc::m_inhibitMap
| protected

Map with object paths to be inhibited from loading.

Definition at line 93 of file TsDataSvc.h.

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

Property for the inhibited leaves.

Definition at line 95 of file TsDataSvc.h.

LoadItems TsDataSvc::m_preLoads
| protected

Items to be pre-loaded.

Definition at line 83 of file TsDataSvc.h.

DataSvcHelpers::RegistryEntry* TsDataSvc::m_root
| protected

Pointer to root entry.

Definition at line 91 of file TsDataSvc.h.

CLID TsDataSvc::m_rootCLID
| protected

Integer Property corresponding to CLID of root entry.

Definition at line 75 of file TsDataSvc.h.

std::string TsDataSvc::m_rootName
| protected

Name of root event.

Definition at line 77 of file TsDataSvc.h.

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

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