The Gaudi Framework  v30r4 (9b837755)
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  {
132  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
133  return traverseSubTree( sub_path, &agent );
134  }
135 
142  virtual StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) = 0;
143 
151  template <typename F, typename = std::enable_if_t<!std::is_convertible<F, IDataStoreAgent*>::value>>
153  {
154  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
155  return traverseSubTree( pObject, &agent );
156  }
157 
161  virtual StatusCode traverseTree( IDataStoreAgent* pAgent ) = 0;
162 
168  template <typename F, typename = std::enable_if_t<!std::is_convertible<F, IDataStoreAgent*>::value>>
170  {
171  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
172  return traverseTree( &agent );
173  }
174 
181  virtual StatusCode setRoot( std::string root_name, DataObject* pObject ) = 0;
182 
189  virtual StatusCode setRoot( std::string root_path, IOpaqueAddress* pRootAddr ) = 0;
190 
198  virtual StatusCode registerAddress( boost::string_ref fullPath, IOpaqueAddress* pAddress ) = 0;
199 
208  StatusCode registerAddress( DataObject* parentObj, boost::string_ref objectPath, IOpaqueAddress* pAddress )
209  {
210  return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
211  }
212 
221  virtual StatusCode registerAddress( IRegistry* parentObj, boost::string_ref objectPath,
222  IOpaqueAddress* pAddress ) = 0;
223 
229  virtual StatusCode unregisterAddress( boost::string_ref fullPath ) = 0;
230 
238  StatusCode unregisterAddress( DataObject* pParent, boost::string_ref objPath )
239  {
240  return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
241  }
242 
250  virtual StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref objPath ) = 0;
251 };
252 
253 #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:73
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:51
#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)