| The Gaudi Framework v27r1

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

- File List
- File Members

TsDataSvc.h
Go to the documentation of this file.
1 // $Id: TsDataSvc.h,v 1.14 2006/11/30 14:43:13 mato Exp $
2 #ifndef GAUDIKERNEL_TSDATASVC_H
3 #define GAUDIKERNEL_TSDATASVC_H
4
5 // Include files
6 #include "GaudiKernel/Service.h"
7 #include "GaudiKernel/DataStoreItem.h"
8 #include "GaudiKernel/IDataManagerSvc.h"
9 #include "GaudiKernel/IDataProviderSvc.h"
10
11 // External libraries
12 #include "tbb/spin_mutex.h"
13 #include "tbb/recursive_mutex.h"
14
15 namespace {
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 // Service factory
30 template <class TYPE> class SvcFactory;
31
32 // Do not clutter global namespace for helpers...
33 namespace DataSvcHelpers {
34 // Map of objects where loading is inhibited
35 class InhibitMap;
36 // Generic registry entry
37 class RegistryEntry;
38 }
39
40
41
42
62 class GAUDI_API TsDataSvc: public extends<Service,
63 IDataProviderSvc,
64 IDataManagerSvc>
65 {
67 friend class SvcFactory<TsDataSvc>;
68
69 public:
71 typedef std::vector<DataStoreItem> LoadItems;
72
73 protected:
75 CLID m_rootCLID;
77 std::string m_rootName;
79 IConversionSvc* m_dataLoader;
81 IIncidentSvc* m_incidentSvc;
83 LoadItems m_preLoads;
85 bool m_forceLeaves;
87 bool m_enableAccessHdlr;
89 bool m_enableFaultHdlr;
91 DataSvcHelpers::RegistryEntry* m_root;
93 DataSvcHelpers::InhibitMap* m_inhibitMap;
95 std::vector<std::string> m_inhibitPathes;
97 std::string m_accessName;
99 std::string m_faultName;
100 public:
101
103 CLID rootCLID() const override;
104
106 const std::string& rootName() const override;
107
109 StatusCode registerAddress( const std::string& fullPath,
110 IOpaqueAddress* pAddress) override;
111
113 StatusCode registerAddress( DataObject* parentObj,
114 const std::string& objectPath,
115 IOpaqueAddress* pAddress) override;
116
118 StatusCode registerAddress( IRegistry* parentObj,
119 const std::string& objectPath,
120 IOpaqueAddress* pAddress) override;
121
123 StatusCode unregisterAddress(const std::string& fullPath) override;
124
126 StatusCode unregisterAddress( DataObject* pParent,
127 const std::string& objPath) override;
128
130 StatusCode unregisterAddress( IRegistry* pParent,
131 const std::string& objPath) override;
132
136 StatusCode objectLeaves( const DataObject* pObject,
137 std::vector<IRegistry*>& refLeaves) override;
141 StatusCode objectLeaves( const IRegistry* pRegistry,
142 std::vector<IRegistry*>& refLeaves) override;
143
145 StatusCode objectParent( const DataObject* pObject,
146 IRegistry*& refpParent) override;
148 StatusCode objectParent( const IRegistry* pRegistry,
149 IRegistry*& refpParent) override;
150
154 StatusCode clearSubTree( const std::string& sub_tree_path ) override;
155
159 StatusCode clearSubTree( DataObject* pObject ) override;
160
162 StatusCode clearStore() override;
163
167 StatusCode traverseSubTree( const std::string& sub_tree_path,
168 IDataStoreAgent* pAgent ) override;
169
171 StatusCode traverseSubTree( DataObject* pObject,
172 IDataStoreAgent* pAgent ) override;
173
175 StatusCode traverseTree( IDataStoreAgent* pAgent ) override;
176
179 StatusCode setRoot( std::string root_name,
180 DataObject* pRootObj) override;
181
185 virtual StatusCode i_setRoot( std::string root_name,
186 DataObject* pRootObj);
187
190 StatusCode setRoot (std::string root_path,
191 IOpaqueAddress* pRootAddr) override;
192
197 virtual StatusCode i_setRoot (std::string root_path,
198 IOpaqueAddress* pRootAddr);
199
203 StatusCode setDataLoader( IConversionSvc* svc,
204 IDataProviderSvc* dpsvc = 0 ) override;
205
207 StatusCode addPreLoadItem( const DataStoreItem& item ) override;
208
210 StatusCode addPreLoadItem( const std::string& itemPath ) override;
211
213 StatusCode removePreLoadItem( const DataStoreItem& item ) override;
214
216 StatusCode removePreLoadItem( const std::string& itemPath ) override;
217
219 StatusCode resetPreLoad() override;
220
228 virtual StatusCode preLoad( int depth,
229 int load_depth,
230 DataObject* pObject );
231
233 StatusCode preLoad() override;
234
236 StatusCode registerObject( const std::string& fullPath,
237 DataObject* pObject ) override;
238
240 StatusCode registerObject( const std::string& parentPath,
241 const std::string& objPath,
242 DataObject* pObject ) override;
243
245 StatusCode registerObject( const std::string& parentPath,
246 int item,
247 DataObject* pObject ) override;
248
250 StatusCode registerObject( DataObject* parentObj,
251 const std::string& objPath,
252 DataObject* pObject ) override;
253
255 StatusCode registerObject( DataObject* parentObj,
256 int item,
257 DataObject* pObject ) override;
258
260 StatusCode unregisterObject(const std::string& fullPath ) override;
261
263 StatusCode unregisterObject(const std::string& parentPath,
264 const std::string& objectPath ) override;
265
267 StatusCode unregisterObject(const std::string& parentPath,
268 int item ) override;
269
271 StatusCode unregisterObject(DataObject* pObject ) override;
272
274 StatusCode unregisterObject(DataObject* pObject,
275 const std::string& objectPath ) override;
276
278 StatusCode unregisterObject(DataObject* pObject,
279 int item ) override;
280
282 StatusCode retrieveObject( IRegistry* pDirectory,
283 const std::string& path,
284 DataObject*& pObject ) override;
285
287 StatusCode retrieveObject( const std::string& fullPath,
288 DataObject*& pObject ) override;
289
291 StatusCode retrieveObject( const std::string& parentPath,
292 const std::string& objPath,
293 DataObject*& pObject ) override;
294
296 StatusCode retrieveObject( const std::string& parentPath,
297 int item,
298 DataObject*& pObject ) override;
299
301 StatusCode retrieveObject( DataObject* parentObj,
302 const std::string& objPath,
303 DataObject*& pObject ) override;
304
306 StatusCode retrieveObject( DataObject* parentObj,
307 int item,
308 DataObject*& pObject ) override;
309
311 StatusCode findObject( const std::string& fullPath,
312 DataObject*& pObject ) override;
313
315 StatusCode findObject( IRegistry* pDirectory,
316 const std::string& path,
317 DataObject*& pObject ) override;
318
320 StatusCode findObject( const std::string& parentPath,
321 const std::string& objPath,
322 DataObject*& pObject ) override;
323
325 StatusCode findObject( const std::string& parentPath,
326 int item,
327 DataObject*& pObject ) override;
328
330 StatusCode findObject( DataObject* parentObj,
331 const std::string& objPath,
332 DataObject*& pObject ) override;
333
335 StatusCode findObject( DataObject* parentObj,
336 int item,
337 DataObject*& pObject ) override;
338
340 StatusCode linkObject( IRegistry* from,
341 const std::string& objPath,
342 DataObject* to ) override;
343
345 StatusCode linkObject( const std::string& fromPath,
346 const std::string& objPath,
347 DataObject* to ) override;
348
350 StatusCode linkObject( DataObject* from,
351 const std::string& objPath,
352 DataObject* to ) override;
353
355 StatusCode linkObject( const std::string& fullPath,
356 DataObject* to ) override;
357
359 StatusCode unlinkObject(IRegistry* from,
360 const std::string& objPath ) override;
361
363 StatusCode unlinkObject(const std::string& fromPath,
364 const std::string& objPath ) override;
365
367 StatusCode unlinkObject(DataObject* fromObj,
368 const std::string& objPath ) override;
369
371 StatusCode unlinkObject(const std::string& fullPath ) override;
372
374 StatusCode updateObject(IRegistry* pDirectory ) override;
375
377 StatusCode updateObject(const std::string& updatePath ) override;
378
380 StatusCode updateObject(DataObject* toUpdate ) override;
381
383 StatusCode updateObject(const std::string& parentPath,
384 const std::string& updatePath ) override;
385
387 StatusCode updateObject(DataObject* pParent,
388 const std::string& updatePath ) override;
389
391 StatusCode initialize() override;
392
394 StatusCode reinitialize() override;
395
397 StatusCode finalize() override;
398
400 TsDataSvc( const std::string& name, ISvcLocator* svc );
401
403 virtual ~TsDataSvc();
404
405 private:
407 TsDataSvc(const TsDataSvc&);
409 TsDataSvc& operator= (const TsDataSvc&);
410
411 protected:
413 bool checkRoot() {
414 return 0 != m_root;
415 }
416
420 virtual IConversionSvc* getDataLoader(IRegistry* pReg);
421
423 virtual DataObject* createDefaultObject() const;
424
428 virtual StatusCode loadObject( IRegistry* pNode );
429
433 virtual StatusCode loadObject( IConversionSvc* pLoader,
434 IRegistry* pNode );
435
437 StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode,
438 const std::string& path,
439 DataSvcHelpers::RegistryEntry*& pEntry );
446 DataObject* handleDataFault(IRegistry* pReg, const std::string& path="");
447
449 tsDataSvcMutex m_accessMutex;
450
451 };
452 #endif // GAUDIKERNEL_TSDATASVC_H
453
AnalysisTest.initialize
def initialize()
Definition: AnalysisTest.py:12
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
IConversionSvc
Definition: IConversionSvc.h:37
TsDataSvc::m_accessMutex
tsDataSvcMutex m_accessMutex
Mutex to protect access to the store.
Definition: TsDataSvc.h:449
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
SvcFactory
Definition: Service.h:350
TsDataSvc::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: TsDataSvc.h:79
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
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
std::string
STL class.
Service.h
TsDataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: TsDataSvc.h:95
TsDataSvc::LoadItems
std::vector< DataStoreItem > LoadItems
Define set of load items.
Definition: TsDataSvc.h:71
DataStoreItem.h
IDataManagerSvc.h
IDataProviderSvc.h
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
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
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
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
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::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:62
ana.item
tuple item
print s1,s2
Definition: ana.py:146
TsDataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: TsDataSvc.h:413
DataSvcHelpers
Definition: DataSvc.h:26
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
TsDataSvc::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: TsDataSvc.h:75
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21