| The Gaudi Framework v29r1 (5cd95fa2)

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

- File List
- File Members

TsDataSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_TSDATASVC_H
2 #define GAUDIKERNEL_TSDATASVC_H
3
4 // Include files
5 #include "GaudiKernel/DataStoreItem.h"
6 #include "GaudiKernel/IDataManagerSvc.h"
7 #include "GaudiKernel/IDataProviderSvc.h"
8 #include "GaudiKernel/Service.h"
9
10 // External libraries
11 #include "tbb/recursive_mutex.h"
12 #include "tbb/spin_mutex.h"
13
14 namespace
15 {
16 typedef tbb::recursive_mutex tsDataSvcMutex;
17 // typedef tbb::spin_mutex tsDataSvcMutex;
18 }
19
20 // Forward declarations
21 // Incident service
22 class IIncidentSvc;
23 // Generic address
24 class IOpaqueAddress;
25 // Generic interface to data object class
26 class DataObject;
27 // Data store agent
28 class IDataStoreAgent;
29
30 // Do not clutter global namespace for helpers...
31 namespace DataSvcHelpers
32 {
33 // Map of objects where loading is inhibited
34 class InhibitMap;
35 // Generic registry entry
36 class RegistryEntry;
37 }
38
58 class GAUDI_API TsDataSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc>
59 {
60 public:
62 typedef std::vector<DataStoreItem> LoadItems;
63
64 protected:
66 IConversionSvc* m_dataLoader = nullptr;
68 IIncidentSvc* m_incidentSvc = nullptr;
69
70 Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
71 Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
72 Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
73 Gaudi::Property<std::vector<std::string>> m_inhibitPathes{this, "InhibitPathes", {}, "inhibited leaves"};
74
75 Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
76 "enable incidents on data creation requests"};
77 Gaudi::Property<std::string> m_faultName{this, "DataFaultName", "DataFault", "Name of the data fault incident"};
78
79 Gaudi::Property<bool> m_enableAccessHdlr{this, "EnableAccessHandler", false,
80 "enable incidents on data access requests"};
81 Gaudi::Property<std::string> m_accessName{this, "DataAccessName", "DataAccess", "Name of the data access incident"};
82
84 LoadItems m_preLoads;
86 DataSvcHelpers::RegistryEntry* m_root = nullptr;
88 DataSvcHelpers::InhibitMap* m_inhibitMap = nullptr;
89
90 public:
92 CLID rootCLID() const override;
93
95 const std::string& rootName() const override;
96
98 StatusCode registerAddress( const std::string& fullPath, IOpaqueAddress* pAddress ) override;
99
101 StatusCode registerAddress( DataObject* parentObj, const std::string& objectPath, IOpaqueAddress* pAddress ) override;
102
104 StatusCode registerAddress( IRegistry* parentObj, const std::string& objectPath, IOpaqueAddress* pAddress ) override;
105
107 StatusCode unregisterAddress( const std::string& fullPath ) override;
108
110 StatusCode unregisterAddress( DataObject* pParent, const std::string& objPath ) override;
111
113 StatusCode unregisterAddress( IRegistry* pParent, const std::string& objPath ) override;
114
118 StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& refLeaves ) override;
122 StatusCode objectLeaves( const IRegistry* pRegistry, std::vector<IRegistry*>& refLeaves ) override;
123
125 StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override;
127 StatusCode objectParent( const IRegistry* pRegistry, IRegistry*& refpParent ) override;
128
132 StatusCode clearSubTree( const std::string& sub_tree_path ) override;
133
137 StatusCode clearSubTree( DataObject* pObject ) override;
138
140 StatusCode clearStore() override;
141
145 StatusCode traverseSubTree( const std::string& sub_tree_path, IDataStoreAgent* pAgent ) override;
146
148 StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override;
149
151 StatusCode traverseTree( IDataStoreAgent* pAgent ) override;
152
155 StatusCode setRoot( std::string root_name, DataObject* pRootObj ) override;
156
160 virtual StatusCode i_setRoot( std::string root_name, DataObject* pRootObj );
161
164 StatusCode setRoot( std::string root_path, IOpaqueAddress* pRootAddr ) override;
165
170 virtual StatusCode i_setRoot( std::string root_path, IOpaqueAddress* pRootAddr );
171
175 StatusCode setDataLoader( IConversionSvc* svc, IDataProviderSvc* dpsvc = nullptr ) override;
176
178 StatusCode addPreLoadItem( const DataStoreItem& item ) override;
179
181 StatusCode addPreLoadItem( const std::string& itemPath ) override;
182
184 StatusCode removePreLoadItem( const DataStoreItem& item ) override;
185
187 StatusCode removePreLoadItem( const std::string& itemPath ) override;
188
190 StatusCode resetPreLoad() override;
191
199 virtual StatusCode preLoad( int depth, int load_depth, DataObject* pObject );
200
202 StatusCode preLoad() override;
203
205 StatusCode registerObject( const std::string& fullPath, DataObject* pObject ) override;
206
208 StatusCode registerObject( const std::string& parentPath, const std::string& objPath, DataObject* pObject ) override;
209
211 StatusCode registerObject( const std::string& parentPath, int item, DataObject* pObject ) override;
212
214 StatusCode registerObject( DataObject* parentObj, const std::string& objPath, DataObject* pObject ) override;
215
217 StatusCode registerObject( DataObject* parentObj, int item, DataObject* pObject ) override;
218
220 StatusCode unregisterObject( const std::string& fullPath ) override;
221
223 StatusCode unregisterObject( const std::string& parentPath, const std::string& objectPath ) override;
224
226 StatusCode unregisterObject( const std::string& parentPath, int item ) override;
227
229 StatusCode unregisterObject( DataObject* pObject ) override;
230
232 StatusCode unregisterObject( DataObject* pObject, const std::string& objectPath ) override;
233
235 StatusCode unregisterObject( DataObject* pObject, int item ) override;
236
238 StatusCode retrieveObject( IRegistry* pDirectory, const std::string& path, DataObject*& pObject ) override;
239
241 StatusCode retrieveObject( const std::string& fullPath, DataObject*& pObject ) override;
242
244 StatusCode retrieveObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) override;
245
247 StatusCode retrieveObject( const std::string& parentPath, int item, DataObject*& pObject ) override;
248
250 StatusCode retrieveObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) override;
251
253 StatusCode retrieveObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
254
256 StatusCode findObject( const std::string& fullPath, DataObject*& pObject ) override;
257
259 StatusCode findObject( IRegistry* pDirectory, const std::string& path, DataObject*& pObject ) override;
260
262 StatusCode findObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) override;
263
265 StatusCode findObject( const std::string& parentPath, int item, DataObject*& pObject ) override;
266
268 StatusCode findObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) override;
269
271 StatusCode findObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
272
274 StatusCode linkObject( IRegistry* from, const std::string& objPath, DataObject* to ) override;
275
277 StatusCode linkObject( const std::string& fromPath, const std::string& objPath, DataObject* to ) override;
278
280 StatusCode linkObject( DataObject* from, const std::string& objPath, DataObject* to ) override;
281
283 StatusCode linkObject( const std::string& fullPath, DataObject* to ) override;
284
286 StatusCode unlinkObject( IRegistry* from, const std::string& objPath ) override;
287
289 StatusCode unlinkObject( const std::string& fromPath, const std::string& objPath ) override;
290
292 StatusCode unlinkObject( DataObject* fromObj, const std::string& objPath ) override;
293
295 StatusCode unlinkObject( const std::string& fullPath ) override;
296
298 StatusCode updateObject( IRegistry* pDirectory ) override;
299
301 StatusCode updateObject( const std::string& updatePath ) override;
302
304 StatusCode updateObject( DataObject* toUpdate ) override;
305
307 StatusCode updateObject( const std::string& parentPath, const std::string& updatePath ) override;
308
310 StatusCode updateObject( DataObject* pParent, const std::string& updatePath ) override;
311
313 StatusCode initialize() override;
314
316 StatusCode reinitialize() override;
317
319 StatusCode finalize() override;
320
322 using extends::extends;
323
325 ~TsDataSvc() override;
326
327 private:
329 TsDataSvc( const TsDataSvc& ) = delete;
331 TsDataSvc& operator=( const TsDataSvc& ) = delete;
332
333 protected:
335 bool checkRoot() { return 0 != m_root; }
336
340 virtual IConversionSvc* getDataLoader( IRegistry* pReg );
341
343 virtual DataObject* createDefaultObject() const;
344
348 virtual StatusCode loadObject( IRegistry* pNode );
349
353 virtual StatusCode loadObject( IConversionSvc* pLoader, IRegistry* pNode );
354
356 StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode, const std::string& path,
357 DataSvcHelpers::RegistryEntry*& pEntry );
364 DataObject* handleDataFault( IRegistry* pReg, const std::string& path = "" );
365
367 tsDataSvcMutex m_accessMutex;
368 };
369 #endif // GAUDIKERNEL_TSDATASVC_H
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
IConversionSvc
Definition: IConversionSvc.h:37
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
TsDataSvc::m_accessMutex
tsDataSvcMutex m_accessMutex
Mutex to protect access to the store.
Definition: TsDataSvc.h:367
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
std::string
STL class.
Service.h
TsDataSvc::LoadItems
std::vector< DataStoreItem > LoadItems
Define set of load items.
Definition: TsDataSvc.h:62
DataStoreItem.h
IDataManagerSvc.h
IDataProviderSvc.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
TsDataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: TsDataSvc.h:84
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::vector< DataStoreItem >
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:16
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
TsDataSvc
Data service base class.
Definition: TsDataSvc.h:58
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:335
DataSvcHelpers
Definition: DataSvc.h:26
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23