| The Gaudi Framework v30r0 (c919700c)

- 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( boost::string_ref fullPath, IOpaqueAddress* pAddress ) override;
85
87 StatusCode registerAddress( DataObject* parentObj, boost::string_ref objectPath, IOpaqueAddress* pAddress ) override;
88
90 StatusCode registerAddress( IRegistry* parentObj, boost::string_ref objectPath, IOpaqueAddress* pAddress ) override;
91
93 StatusCode unregisterAddress( boost::string_ref fullPath ) override;
94
96 StatusCode unregisterAddress( DataObject* pParent, boost::string_ref objPath ) override;
97
99 StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref 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( boost::string_ref sub_tree_path ) override;
119
123 StatusCode clearSubTree( DataObject* pObject ) override;
124
126 StatusCode clearStore() override;
127
131 StatusCode traverseSubTree( boost::string_ref 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( std::string itemPath ) override;
168
170 StatusCode removePreLoadItem( const DataStoreItem& item ) override;
171
173 StatusCode removePreLoadItem( 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( boost::string_ref fullPath, DataObject* pObject ) override;
192
194 StatusCode registerObject( boost::string_ref parentPath, boost::string_ref objPath, DataObject* pObject ) override;
195
197 StatusCode registerObject( boost::string_ref parentPath, int item, DataObject* pObject ) override;
198
200 StatusCode registerObject( DataObject* parentObj, boost::string_ref objPath, DataObject* pObject ) override;
201
203 StatusCode registerObject( DataObject* parentObj, int item, DataObject* pObject ) override;
204
206 StatusCode unregisterObject( boost::string_ref fullPath ) override;
207
209 StatusCode unregisterObject( boost::string_ref parentPath, boost::string_ref objectPath ) override;
210
212 StatusCode unregisterObject( boost::string_ref parentPath, int item ) override;
213
215 StatusCode unregisterObject( DataObject* pObject ) override;
216
218 StatusCode unregisterObject( DataObject* pObject, boost::string_ref objectPath ) override;
219
221 StatusCode unregisterObject( DataObject* pObject, int item ) override;
222
224 StatusCode retrieveObject( IRegistry* pDirectory, boost::string_ref path, DataObject*& pObject ) override;
225
227 StatusCode retrieveObject( boost::string_ref fullPath, DataObject*& pObject ) override;
228
230 StatusCode retrieveObject( boost::string_ref parentPath, boost::string_ref objPath, DataObject*& pObject ) override;
231
233 StatusCode retrieveObject( boost::string_ref parentPath, int item, DataObject*& pObject ) override;
234
236 StatusCode retrieveObject( DataObject* parentObj, boost::string_ref objPath, DataObject*& pObject ) override;
237
239 StatusCode retrieveObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
240
242 StatusCode findObject( boost::string_ref fullPath, DataObject*& pObject ) override;
243
245 StatusCode findObject( IRegistry* pDirectory, boost::string_ref path, DataObject*& pObject ) override;
246
248 StatusCode findObject( boost::string_ref parentPath, boost::string_ref objPath, DataObject*& pObject ) override;
249
251 StatusCode findObject( boost::string_ref parentPath, int item, DataObject*& pObject ) override;
252
254 StatusCode findObject( DataObject* parentObj, boost::string_ref objPath, DataObject*& pObject ) override;
255
257 StatusCode findObject( DataObject* parentObj, int item, DataObject*& pObject ) override;
258
260 StatusCode linkObject( IRegistry* from, boost::string_ref objPath, DataObject* to ) override;
261
263 StatusCode linkObject( boost::string_ref fromPath, boost::string_ref objPath, DataObject* to ) override;
264
266 StatusCode linkObject( DataObject* from, boost::string_ref objPath, DataObject* to ) override;
267
269 StatusCode linkObject( boost::string_ref fullPath, DataObject* to ) override;
270
272 StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override;
273
275 StatusCode unlinkObject( boost::string_ref fromPath, boost::string_ref objPath ) override;
276
278 StatusCode unlinkObject( DataObject* fromObj, boost::string_ref objPath ) override;
279
281 StatusCode unlinkObject( boost::string_ref fullPath ) override;
282
284 StatusCode updateObject( IRegistry* pDirectory ) override;
285
287 StatusCode updateObject( boost::string_ref updatePath ) override;
288
290 StatusCode updateObject( DataObject* toUpdate ) override;
291
293 StatusCode updateObject( boost::string_ref parentPath, boost::string_ref updatePath ) override;
294
296 StatusCode updateObject( DataObject* pParent, boost::string_ref 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, boost::string_ref path,
343 DataSvcHelpers::RegistryEntry*& pEntry );
350 DataObject* handleDataFault( IRegistry* pReg, boost::string_ref 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:895
IConversionSvc
Definition: IConversionSvc.h:37
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
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:46
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:110
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