| The Gaudi Framework v27r1

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

- File List
- File Members

DataSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_DATASVC_H
2 #define GAUDIKERNEL_DATASVC_H
3
4 // Include files
5 #include "GaudiKernel/Service.h"
6 #include "GaudiKernel/DataStoreItem.h"
7 #include "GaudiKernel/IDataManagerSvc.h"
8 #include "GaudiKernel/IDataProviderSvc.h"
9 #include "GaudiKernel/IIncidentSvc.h"
10 #include "GaudiKernel/SmartIF.h"
11 #include "GaudiKernel/IConversionSvc.h"
12
13 #include <boost/utility/string_ref.hpp>
14
15 // Forward declarations
16 // Incident service
17 class IIncidentSvc;
18 // Generic address
19 class IOpaqueAddress;
20 // Generic interface to data object class
21 class DataObject;
22 // Data store agent
23 class IDataStoreAgent;
24
25 // Do not clutter global namespace for helpers...
26 namespace DataSvcHelpers {
27 // Map of objects where loading is inhibited
28 class InhibitMap;
29 // Generic registry entry
30 class RegistryEntry;
31 }
32
43 class GAUDI_API DataSvc: public extends<Service,
44 IDataProviderSvc,
45 IDataManagerSvc>
46 {
47 public:
49 typedef std::vector<DataStoreItem> LoadItems;
50
51 protected:
53 CLID m_rootCLID = 110; /*CLID_Event*/
55 std::string m_rootName = "/Event" ;
57 SmartIF<IConversionSvc> m_dataLoader = nullptr;
59 SmartIF<IIncidentSvc> m_incidentSvc = nullptr;
61 LoadItems m_preLoads;
63 bool m_forceLeaves = false;
65 bool m_enableAccessHdlr = false;
67 bool m_enableFaultHdlr = false;
69 DataSvcHelpers::RegistryEntry* m_root = nullptr;
71 DataSvcHelpers::InhibitMap* m_inhibitMap = nullptr;
73 std::vector<std::string> m_inhibitPathes;
75 std::string m_accessName = "DataAccess";
77 std::string m_faultName = "DataFault";
78 public:
79
81 CLID rootCLID() const override;
82
84 const std::string& rootName() const override;
85
87 StatusCode registerAddress( const std::string& fullPath,
88 IOpaqueAddress* pAddress) override;
89
91 StatusCode registerAddress( DataObject* parentObj,
92 const std::string& objectPath,
93 IOpaqueAddress* pAddress) override;
94
96 StatusCode registerAddress( IRegistry* parentObj,
97 const std::string& objectPath,
98 IOpaqueAddress* pAddress) override;
99
101 StatusCode unregisterAddress(const std::string& fullPath) override;
102
104 StatusCode unregisterAddress( DataObject* pParent,
105 const std::string& objPath) override;
106
108 StatusCode unregisterAddress( IRegistry* pParent,
109 const std::string& objPath) override;
110
114 StatusCode objectLeaves( const DataObject* pObject,
115 std::vector<IRegistry*>& refLeaves) override;
119 StatusCode objectLeaves( const IRegistry* pRegistry,
120 std::vector<IRegistry*>& refLeaves) override;
121
123 StatusCode objectParent( const DataObject* pObject,
124 IRegistry*& refpParent) override;
126 StatusCode objectParent( const IRegistry* pRegistry,
127 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,
146 IDataStoreAgent* pAgent ) override;
147
149 StatusCode traverseSubTree( DataObject* pObject,
150 IDataStoreAgent* pAgent ) override;
151
153 StatusCode traverseTree( IDataStoreAgent* pAgent ) override;
154
157 StatusCode setRoot( std::string root_name,
158 DataObject* pRootObj) override;
159
163 virtual StatusCode i_setRoot( std::string root_name,
164 DataObject* pRootObj);
165
168 StatusCode setRoot (std::string root_path,
169 IOpaqueAddress* pRootAddr) override;
170
175 virtual StatusCode i_setRoot (std::string root_path,
176 IOpaqueAddress* pRootAddr);
177
181 StatusCode setDataLoader( IConversionSvc* svc, IDataProviderSvc* dpsvc = nullptr ) override;
182
184 StatusCode addPreLoadItem( const DataStoreItem& item ) override;
185
187 StatusCode addPreLoadItem( const std::string& itemPath ) override;
188
190 StatusCode removePreLoadItem( const DataStoreItem& item ) override;
191
193 StatusCode removePreLoadItem( const std::string& itemPath ) override;
194
196 StatusCode resetPreLoad() override;
197
205 virtual StatusCode preLoad( int depth,
206 int load_depth,
207 DataObject* pObject );
208
210 StatusCode preLoad() override;
211
213 StatusCode registerObject( const std::string& fullPath,
214 DataObject* pObject ) override;
215
217 StatusCode registerObject( const std::string& parentPath,
218 const std::string& objPath,
219 DataObject* pObject ) override;
220
222 StatusCode registerObject( const std::string& parentPath,
223 int item,
224 DataObject* pObject ) override;
225
227 StatusCode registerObject( DataObject* parentObj,
228 const std::string& objPath,
229 DataObject* pObject ) override;
230
232 StatusCode registerObject( DataObject* parentObj,
233 int item,
234 DataObject* pObject ) override;
235
237 StatusCode unregisterObject(const std::string& fullPath ) override;
238
240 StatusCode unregisterObject(const std::string& parentPath,
241 const std::string& objectPath ) override;
242
244 StatusCode unregisterObject(const std::string& parentPath,
245 int item ) override;
246
248 StatusCode unregisterObject(DataObject* pObject ) override;
249
251 StatusCode unregisterObject(DataObject* pObject,
252 const std::string& objectPath ) override;
253
255 StatusCode unregisterObject(DataObject* pObject,
256 int item ) override;
257
259 StatusCode retrieveObject( IRegistry* pDirectory,
260 const std::string& path,
261 DataObject*& pObject ) override;
262
264 StatusCode retrieveObject( const std::string& fullPath,
265 DataObject*& pObject ) override;
266
268 StatusCode retrieveObject( const std::string& parentPath,
269 const std::string& objPath,
270 DataObject*& pObject ) override;
271
273 StatusCode retrieveObject( const std::string& parentPath,
274 int item,
275 DataObject*& pObject ) override;
276
278 StatusCode retrieveObject( DataObject* parentObj,
279 const std::string& objPath,
280 DataObject*& pObject ) override;
281
283 StatusCode retrieveObject( DataObject* parentObj,
284 int item,
285 DataObject*& pObject ) override;
286
288 StatusCode findObject( const std::string& fullPath,
289 DataObject*& pObject ) override;
290
292 StatusCode findObject( IRegistry* pDirectory,
293 const std::string& path,
294 DataObject*& pObject ) override;
295
297 StatusCode findObject( const std::string& parentPath,
298 const std::string& objPath,
299 DataObject*& pObject ) override;
300
302 StatusCode findObject( const std::string& parentPath,
303 int item,
304 DataObject*& pObject ) override;
305
307 StatusCode findObject( DataObject* parentObj,
308 const std::string& objPath,
309 DataObject*& pObject ) override;
310
312 StatusCode findObject( DataObject* parentObj,
313 int item,
314 DataObject*& pObject ) override;
315
317 StatusCode linkObject( IRegistry* from,
318 const std::string& objPath,
319 DataObject* to ) override;
320
322 StatusCode linkObject( const std::string& fromPath,
323 const std::string& objPath,
324 DataObject* to ) override;
325
327 StatusCode linkObject( DataObject* from,
328 const std::string& objPath,
329 DataObject* to ) override;
330
332 StatusCode linkObject( const std::string& fullPath,
333 DataObject* to ) override;
334
336 StatusCode unlinkObject(IRegistry* from,
337 const std::string& objPath ) override;
338
340 StatusCode unlinkObject(const std::string& fromPath,
341 const std::string& objPath ) override;
342
344 StatusCode unlinkObject(DataObject* fromObj,
345 const std::string& objPath ) override;
346
348 StatusCode unlinkObject(const std::string& fullPath ) override;
349
351 StatusCode updateObject(IRegistry* pDirectory ) override;
352
354 StatusCode updateObject(const std::string& updatePath ) override;
355
357 StatusCode updateObject(DataObject* toUpdate ) override;
358
360 StatusCode updateObject(const std::string& parentPath,
361 const std::string& updatePath ) override;
362
364 StatusCode updateObject(DataObject* pParent,
365 const std::string& updatePath ) override;
366
368 StatusCode initialize() override;
369
371 StatusCode reinitialize() override;
372
374 StatusCode finalize() override;
375
377 DataSvc( const std::string& name, ISvcLocator* svc );
378
380 ~DataSvc() override;
381
382 private:
384 DataSvc(const DataSvc&) = delete;
386 DataSvc& operator= (const DataSvc&) = delete;
387
388 protected:
390 bool checkRoot() {
391 return 0 != m_root;
392 }
393
397 virtual IConversionSvc* getDataLoader(IRegistry* pReg);
398
400 virtual DataObject* createDefaultObject() const;
401
405 virtual StatusCode loadObject( IRegistry* pNode );
406
410 virtual StatusCode loadObject( IConversionSvc* pLoader,
411 IRegistry* pNode );
412
414 StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode,
415 const std::string& path,
416 DataSvcHelpers::RegistryEntry*& pEntry );
423 DataObject* handleDataFault(IRegistry* pReg, const std::string& path="");
424 private:
425 StatusCode i_retrieveEntry(DataSvcHelpers::RegistryEntry* parentObj,
426 boost::string_ref path,
427 DataSvcHelpers::RegistryEntry*& pEntry) ;
428 DataObject* i_handleDataFault(IRegistry* pReg, boost::string_ref path = boost::string_ref{});
429 };
430 #endif // GAUDIKERNEL_DATASVC_H
SmartIF< IConversionSvc >
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
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:61
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:390
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::string
STL class.
Service.h
DataStoreItem.h
IDataManagerSvc.h
IDataProviderSvc.h
IIncidentSvc.h
DataSvc::LoadItems
std::vector< DataStoreItem > LoadItems
Define set of load items.
Definition: DataSvc.h:49
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
SmartIF.h
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
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
IConversionSvc.h
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
DataSvc
Data service base class.
Definition: DataSvc.h:43
ana.item
tuple item
print s1,s2
Definition: ana.py:146
DataSvc::m_inhibitPathes
std::vector< std::string > m_inhibitPathes
Property for the inhibited leaves.
Definition: DataSvc.h:73
DataSvcHelpers
Definition: DataSvc.h:26
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
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