Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
8 #include "boost/utility/string_ref.hpp"
9 #include <string>
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 
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( boost::string_ref sub_path ) = 0;
104 
110  virtual StatusCode clearSubTree( DataObject* pObject ) = 0;
111 
115  virtual StatusCode clearStore() = 0;
116 
121  virtual StatusCode traverseSubTree( boost::string_ref sub_tree_path, IDataStoreAgent* pAgent ) = 0;
122 
129  template <typename F, typename = std::enable_if_t<!std::is_convertible<F, IDataStoreAgent*>::value>>
130  StatusCode traverseSubTree( boost::string_ref 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<F, IDataStoreAgent*>::value>>
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<F, IDataStoreAgent*>::value>>
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( boost::string_ref fullPath, IOpaqueAddress* pAddress ) = 0;
196 
205  StatusCode registerAddress( DataObject* parentObj, boost::string_ref objectPath, IOpaqueAddress* pAddress ) {
206  return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
207  }
208 
217  virtual StatusCode registerAddress( IRegistry* parentObj, boost::string_ref objectPath,
218  IOpaqueAddress* pAddress ) = 0;
219 
225  virtual StatusCode unregisterAddress( boost::string_ref fullPath ) = 0;
226 
234  StatusCode unregisterAddress( DataObject* pParent, boost::string_ref objPath ) {
235  return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
236  }
237 
245  virtual StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref objPath ) = 0;
246 };
247 
248 #endif // GAUDIKERNEL_IDATAMANAGERSVC_H
StatusCode traverseTree(F &&f)
Analyse by traversing all data objects in the data store.
StatusCode registerAddress(DataObject *parentObj, boost::string_ref objectPath, IOpaqueAddress *pAddress)
Register object address with the data store.
StatusCode traverseSubTree(boost::string_ref sub_path, F &&f)
Analyse by traversing all data objects below the sub tree identified by its full path name...
StatusCode traverseSubTree(DataObject *pObject, F &&f)
Analyse by traversing all data objects below the sub tree identified by the object.
Data provider interface definition.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
STL class.
StatusCode unregisterAddress(DataObject *pParent, boost::string_ref objPath)
Unregister object address from the data store.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
#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
Base class to be used to extend an interface.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Generic data agent interface.
Opaque address interface definition.
#define GAUDI_API
Definition: Kernel.h:71
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
::details::GenericDataStoreAgent< F > makeDataStoreAgent(F &&f)