| The Gaudi Framework v32r1 (f65d50dc)

IDataManagerSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IDATAMANAGERSVC_H
2 #define GAUDIKERNEL_IDATAMANAGERSVC_H
3
4 // Include files
5 #include "GaudiKernel/ClassID.h"
6 #include "GaudiKernel/IDataStoreAgent.h"
7 #include "GaudiKernel/IInterface.h"
8 #include <string>
9 #include <string_view>
10 #include <vector>
11
12 // Forward declarations
13 // Generic interface to data object class
14 #include "GaudiKernel/DataObject.h"
15 // Interface to persistency service
16 class IConversionSvc;
17 // Opaque addresses
18 class IOpaqueAddress;
19 // Registry entry definition
20 class IRegistry;
21 // Data provider svc
22 class IDataProviderSvc;
23
45 struct GAUDI_API IDataManagerSvc : extend_interfaces<IInterface> {
47 DeclareInterfaceID( IDataManagerSvc, 4, 0 );
48
50 virtual CLID rootCLID() const = 0;
51
53 virtual const std::string& rootName() const = 0;
54
61 virtual StatusCode setDataLoader( IConversionSvc* svc, IDataProviderSvc* dpsvc = nullptr ) = 0;
62
69 virtual StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) = 0;
70
77 virtual StatusCode objectParent( const IRegistry* pRegistry, IRegistry*& refpParent ) = 0;
78
87 virtual StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& refLeaves ) = 0;
88
97 virtual StatusCode objectLeaves( const IRegistry* pRegistry, std::vector<IRegistry*>& refLeaves ) = 0;
98
103 virtual StatusCode clearSubTree( std::string_view sub_path ) = 0;
104
110 virtual StatusCode clearSubTree( DataObject* pObject ) = 0;
111
115 virtual StatusCode clearStore() = 0;
116
121 virtual StatusCode traverseSubTree( std::string_view sub_tree_path, IDataStoreAgent* pAgent ) = 0;
122
129 template <typename F, typename = std::enable_if_t<!std::is_convertible_v<F, IDataStoreAgent*>>>
130 StatusCode traverseSubTree( std::string_view sub_path, F&& f ) {
131 auto agent = makeDataStoreAgent( std::forward<F>( f ) );
132 return traverseSubTree( sub_path, &agent );
133 }
134
141 virtual StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) = 0;
142
150 template <typename F, typename = std::enable_if_t<!std::is_convertible_v<F, IDataStoreAgent*>>>
151 StatusCode traverseSubTree( DataObject* pObject, F&& f ) {
152 auto agent = makeDataStoreAgent( std::forward<F>( f ) );
153 return traverseSubTree( pObject, &agent );
154 }
155
159 virtual StatusCode traverseTree( IDataStoreAgent* pAgent ) = 0;
160
166 template <typename F, typename = std::enable_if_t<!std::is_convertible_v<F, IDataStoreAgent*>>>
167 StatusCode traverseTree( F&& f ) {
168 auto agent = makeDataStoreAgent( std::forward<F>( f ) );
169 return traverseTree( &agent );
170 }
171
178 virtual StatusCode setRoot( std::string root_name, DataObject* pObject ) = 0;
179
186 virtual StatusCode setRoot( std::string root_path, IOpaqueAddress* pRootAddr ) = 0;
187
195 virtual StatusCode registerAddress( std::string_view fullPath, IOpaqueAddress* pAddress ) = 0;
196
205 StatusCode registerAddress( DataObject* parentObj, std::string_view objectPath, IOpaqueAddress* pAddress ) {
206 return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
207 }
208
217 virtual StatusCode registerAddress( IRegistry* parentObj, std::string_view objectPath, IOpaqueAddress* pAddress ) = 0;
218
224 virtual StatusCode unregisterAddress( std::string_view fullPath ) = 0;
225
233 StatusCode unregisterAddress( DataObject* pParent, std::string_view objPath ) {
234 return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
235 }
236
244 virtual StatusCode unregisterAddress( IRegistry* pParent, std::string_view objPath ) = 0;
245 };
246
247 #endif // GAUDIKERNEL_IDATAMANAGERSVC_H
ClassID.h
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IConversionSvc
Definition: IConversionSvc.h:37
IDataManagerSvc::traverseTree
StatusCode traverseTree(F &&f)
Analyse by traversing all data objects in the data store.
Definition: IDataManagerSvc.h:167
IDataManagerSvc
Definition: IDataManagerSvc.h:45
IDataManagerSvc::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, F &&f)
Analyse by traversing all data objects below the sub tree identified by the object.
Definition: IDataManagerSvc.h:151
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:43
std::string
STL class.
IDataManagerSvc::unregisterAddress
StatusCode unregisterAddress(DataObject *pParent, std::string_view objPath)
Unregister object address from the data store.
Definition: IDataManagerSvc.h:233
IDataManagerSvc::traverseSubTree
StatusCode traverseSubTree(std::string_view sub_path, F &&f)
Analyse by traversing all data objects below the sub tree identified by its full path name.
Definition: IDataManagerSvc.h:130
IDataManagerSvc::registerAddress
StatusCode registerAddress(DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
Register object address with the data store.
Definition: IDataManagerSvc.h:205
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
extend_interfaces
Base class to be used to extend an interface.
Definition: extend_interfaces.h:5
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
IDataStoreAgent.h
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:13
std::vector< IRegistry * >
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:17
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
IInterface.h
makeDataStoreAgent
::details::GenericDataStoreAgent< F > makeDataStoreAgent(F &&f)
Definition: IDataStoreAgent.h:42
DataObject.h