| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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/DataStoreItem.h"
6 #include "GaudiKernel/IConversionSvc.h"
7 #include "GaudiKernel/IDataManagerSvc.h"
8 #include "GaudiKernel/IDataProviderSvc.h"
9 #include "GaudiKernel/IIncidentSvc.h"
10 #include "GaudiKernel/Service.h"
11 #include "GaudiKernel/SmartIF.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 {
28 // Map of objects where loading is inhibited
29 class InhibitMap;
30 // Generic registry entry
31 class RegistryEntry;
32 }
33
44 class GAUDI_API DataSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc>
45 {
46 public:
48 typedef std::vector<DataStoreItem> LoadItems;
49
50 protected:
52 SmartIF<IConversionSvc> m_dataLoader = nullptr;
54 SmartIF<IIncidentSvc> m_incidentSvc = nullptr;
55
56 Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
57 Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
58 Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
59 Gaudi::Property<std::vector<std::string>> m_inhibitPathes{this, "InhibitPathes", {}, "inhibited leaves"};
60
61 Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
62 "enable incidents on data creation requests"};
63 Gaudi::Property<std::string> m_faultName{this, "DataFaultName", "DataFault", "Name of the data fault incident"};
64
65 Gaudi::Property<bool> m_enableAccessHdlr{this, "EnableAccessHandler", false,
66 "enable incidents on data access requests"};
67 Gaudi::Property<std::string> m_accessName{this, "DataAccessName", "DataAccess", "Name of the data access incident"};
68
70 LoadItems m_preLoads;
72 DataSvcHelpers::RegistryEntry* m_root = nullptr;
74 DataSvcHelpers::InhibitMap* m_inhibitMap = nullptr;
75
76 public:
78 CLID rootCLID() const override;
79
81 const std::string& rootName() const override;
82
84 StatusCode registerAddress( const std::string& fullPath, IOpaqueAddress* pAddress ) override;
85
87 StatusCode registerAddress( DataObject* parentObj, const std::string& objectPath, IOpaqueAddress* pAddress ) override;
88
90 StatusCode registerAddress( IRegistry* parentObj, const std::string& objectPath, IOpaqueAddress* pAddress ) override;
91
93 StatusCode unregisterAddress( const std::string& fullPath ) override;
94
96 StatusCode unregisterAddress( DataObject* pParent, const std::string& objPath ) override;
97
99 StatusCode unregisterAddress( IRegistry* pParent, const std::string& objPath ) override;
100
104 StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& refLeaves ) override;
108 StatusCode objectLeaves( const IRegistry* pRegistry, std::vector<IRegistry*>& refLeaves ) override;
109
111 StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override;
113 StatusCode objectParent( const IRegistry* pRegistry, IRegistry*& refpParent ) override;
114
118 StatusCode clearSubTree( const std::string& sub_tree_path ) override;
119
123 StatusCode clearSubTree( DataObject* pObject ) override;
124
126 StatusCode clearStore() override;
127
131 StatusCode traverseSubTree( const std::string& sub_tree_path, IDataStoreAgent* pAgent ) override;
132
134 StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override;
135
137 StatusCode traverseTree( IDataStoreAgent* pAgent ) override;
138
141 StatusCode setRoot( std::string root_name, DataObject* pRootObj ) override;
142
146 virtual StatusCode i_setRoot( std::string root_name, DataObject* pRootObj );
147
150 StatusCode setRoot( std::string root_path, IOpaqueAddress* pRootAddr ) override;
151
156 virtual StatusCode i_setRoot( std::string root_path, IOpaqueAddress* pRootAddr );
157
161 StatusCode setDataLoader( IConversionSvc* svc, IDataProviderSvc* dpsvc = nullptr ) override;
162
164 StatusCode addPreLoadItem( const DataStoreItem& item ) override;
165
167 StatusCode addPreLoadItem( const std::string& itemPath ) override;
168
170 StatusCode removePreLoadItem( const DataStoreItem& item ) override;
171
173 StatusCode removePreLoadItem( const std::string& itemPath ) override;
174
176 StatusCode resetPreLoad() override;
177
185 virtual StatusCode preLoad( int depth, int load_depth, DataObject* pObject );
186
188 StatusCode preLoad() override;
189
191 StatusCode registerObject( const std::string& fullPath, DataObject* pObject ) override;
192
194 StatusCode registerObject( const std::string& parentPath, const std::string& objPath, DataObject* pObject ) override;
195
197 StatusCode registerObject( const std::string& parentPath, int item, DataObject* pObject ) override;
198
200 StatusCode registerObject( DataObject* parentObj, const std::string& objPath, DataObject* pObject ) override;
201
203 StatusCode registerObject( DataObject* parentObj, int item, DataObject* pObject ) override;
204
206 StatusCode unregisterObject( const std::string& fullPath ) override;
207
209 StatusCode unregisterObject( const std::string& parentPath, const std::string& objectPath ) override;
210
212 StatusCode unregisterObject( const std::string& parentPath, int item ) override;
213
215 StatusCode unregisterObject( DataObject* pObject ) override;
216
218 StatusCode unregisterObject( DataObject* pObject, const std::string& objectPath ) override;
219
221 StatusCode unregisterObject( DataObject* pObject, int item ) override;
222
224 StatusCode retrieveObject( IRegistry* pDirectory, const std::string& path, DataObject*& pObject ) override;
225
227 StatusCode retrieveObject( const std::string& fullPath, DataObject*& pObject ) override;
228
230 StatusCode retrieveObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) override;
231
233 StatusCode retrieveObject( const std::string& parentPath, int item, DataObject*& pObject ) override;
234
236 StatusCode retrieveObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) override;
237
239 StatusCode retrieveObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
240
242 StatusCode findObject( const std::string& fullPath, DataObject*& pObject ) override;
243
245 StatusCode findObject( IRegistry* pDirectory, const std::string& path, DataObject*& pObject ) override;
246
248 StatusCode findObject( const std::string& parentPath, const std::string& objPath, DataObject*& pObject ) override;
249
251 StatusCode findObject( const std::string& parentPath, int item, DataObject*& pObject ) override;
252
254 StatusCode findObject( DataObject* parentObj, const std::string& objPath, DataObject*& pObject ) override;
255
257 StatusCode findObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
258
260 StatusCode linkObject( IRegistry* from, const std::string& objPath, DataObject* to ) override;
261
263 StatusCode linkObject( const std::string& fromPath, const std::string& objPath, DataObject* to ) override;
264
266 StatusCode linkObject( DataObject* from, const std::string& objPath, DataObject* to ) override;
267
269 StatusCode linkObject( const std::string& fullPath, DataObject* to ) override;
270
272 StatusCode unlinkObject( IRegistry* from, const std::string& objPath ) override;
273
275 StatusCode unlinkObject( const std::string& fromPath, const std::string& objPath ) override;
276
278 StatusCode unlinkObject( DataObject* fromObj, const std::string& objPath ) override;
279
281 StatusCode unlinkObject( const std::string& fullPath ) override;
282
284 StatusCode updateObject( IRegistry* pDirectory ) override;
285
287 StatusCode updateObject( const std::string& updatePath ) override;
288
290 StatusCode updateObject( DataObject* toUpdate ) override;
291
293 StatusCode updateObject( const std::string& parentPath, const std::string& updatePath ) override;
294
296 StatusCode updateObject( DataObject* pParent, const std::string& updatePath ) override;
297
299 StatusCode initialize() override;
300
302 StatusCode reinitialize() override;
303
305 StatusCode finalize() override;
306
308 using extends::extends;
309
311 ~DataSvc() override;
312
313 private:
315 DataSvc( const DataSvc& ) = delete;
317 DataSvc& operator=( const DataSvc& ) = delete;
318
319 protected:
321 bool checkRoot() { return 0 != m_root; }
322
326 virtual IConversionSvc* getDataLoader( IRegistry* pReg );
327
329 virtual DataObject* createDefaultObject() const;
330
334 virtual StatusCode loadObject( IRegistry* pNode );
335
339 virtual StatusCode loadObject( IConversionSvc* pLoader, IRegistry* pNode );
340
342 StatusCode retrieveEntry( DataSvcHelpers::RegistryEntry* pNode, const std::string& path,
343 DataSvcHelpers::RegistryEntry*& pEntry );
350 DataObject* handleDataFault( IRegistry* pReg, const std::string& path = "" );
351
352 private:
353 StatusCode i_retrieveEntry( DataSvcHelpers::RegistryEntry* parentObj, boost::string_ref path,
354 DataSvcHelpers::RegistryEntry*& pEntry );
355 DataObject* i_handleDataFault( IRegistry* pReg, boost::string_ref path = boost::string_ref{} );
356 };
357 #endif // GAUDIKERNEL_DATASVC_H
SmartIF< IConversionSvc >
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
IConversionSvc
Definition: IConversionSvc.h:37
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
DataSvc::m_preLoads
LoadItems m_preLoads
Items to be pre-loaded.
Definition: DataSvc.h:70
DataSvc::checkRoot
bool checkRoot()
Check if root path is valid.
Definition: DataSvc.h:321
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
DataStoreItem.h
IDataManagerSvc.h
IDataProviderSvc.h
IIncidentSvc.h
DataSvc::LoadItems
std::vector< DataStoreItem > LoadItems
Define set of load items.
Definition: DataSvc.h:48
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
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:44
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:23