Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IDataManagerSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 #include <GaudiKernel/ClassID.h>
14 #include <GaudiKernel/DataObject.h>
16 #include <GaudiKernel/IInterface.h>
17 #include <string>
18 #include <string_view>
19 #include <vector>
20 
21 class IConversionSvc;
22 class IOpaqueAddress;
23 class IRegistry;
24 class IDataProviderSvc;
25 
50 
52  virtual CLID rootCLID() const = 0;
53 
55  virtual const std::string& rootName() const = 0;
56 
63  virtual StatusCode setDataLoader( IConversionSvc* svc, IDataProviderSvc* dpsvc = nullptr ) = 0;
64 
71  virtual StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) = 0;
72 
79  virtual StatusCode objectParent( const IRegistry* pRegistry, IRegistry*& refpParent ) = 0;
80 
89  virtual StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& refLeaves ) = 0;
90 
99  virtual StatusCode objectLeaves( const IRegistry* pRegistry, std::vector<IRegistry*>& refLeaves ) = 0;
100 
105  virtual StatusCode clearSubTree( std::string_view sub_path ) = 0;
106 
112  virtual StatusCode clearSubTree( DataObject* pObject ) = 0;
113 
117  virtual StatusCode clearStore() = 0;
118 
123  virtual StatusCode traverseSubTree( std::string_view sub_tree_path, IDataStoreAgent* pAgent ) = 0;
124 
131  template <typename F>
132  requires( !std::is_convertible_v<F, IDataStoreAgent*> )
133  StatusCode traverseSubTree( std::string_view sub_path, F&& f ) {
134  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
135  return traverseSubTree( sub_path, &agent );
136  }
137 
144  virtual StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) = 0;
145 
153  template <typename F>
154  requires( !std::is_convertible_v<F, IDataStoreAgent*> )
155  StatusCode traverseSubTree( DataObject* pObject, F&& f ) {
156  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
157  return traverseSubTree( pObject, &agent );
158  }
159 
163  virtual StatusCode traverseTree( IDataStoreAgent* pAgent ) = 0;
164 
170  template <typename F>
171  requires( !std::is_convertible_v<F, IDataStoreAgent*> )
172  StatusCode traverseTree( F&& f ) {
173  auto agent = makeDataStoreAgent( std::forward<F>( f ) );
174  return traverseTree( &agent );
175  }
176 
183  virtual StatusCode setRoot( std::string root_name, DataObject* pObject ) = 0;
184 
191  virtual StatusCode setRoot( std::string root_path, IOpaqueAddress* pRootAddr ) = 0;
192 
200  virtual StatusCode registerAddress( std::string_view fullPath, IOpaqueAddress* pAddress ) = 0;
201 
210  StatusCode registerAddress( DataObject* parentObj, std::string_view objectPath, IOpaqueAddress* pAddress ) {
211  return registerAddress( parentObj ? parentObj->registry() : nullptr, objectPath, pAddress );
212  }
213 
222  virtual StatusCode registerAddress( IRegistry* parentObj, std::string_view objectPath, IOpaqueAddress* pAddress ) = 0;
223 
229  virtual StatusCode unregisterAddress( std::string_view fullPath ) = 0;
230 
238  StatusCode unregisterAddress( DataObject* pParent, std::string_view objPath ) {
239  return unregisterAddress( pParent ? pParent->registry() : nullptr, objPath );
240  }
241 
249  virtual StatusCode unregisterAddress( IRegistry* pParent, std::string_view objPath ) = 0;
250 };
IDataManagerSvc::requires
requires(!std::is_convertible_v< F, IDataStoreAgent * >) StatusCode traverseSubTree(DataObject *pObject
Analyse by traversing all data objects below the sub tree identified by the object.
IDataManagerSvc::registerAddress
StatusCode registerAddress(DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
Register object address with the data store.
Definition: IDataManagerSvc.h:210
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(IRegistry *pParent, std::string_view objPath)=0
Unregister object address from the data store.
IDataManagerSvc
Definition: IDataManagerSvc.h:47
IOpaqueAddress
Definition: IOpaqueAddress.h:28
IDataManagerSvc::unregisterAddress
StatusCode unregisterAddress(DataObject *pParent, std::string_view objPath)
Unregister object address from the data store.
Definition: IDataManagerSvc.h:238
ClassID.h
IDataManagerSvc::setDataLoader
virtual StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr)=0
Pass a default data loader to the service.
IDataManagerSvc::objectLeaves
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
IDataManagerSvc::rootCLID
virtual CLID rootCLID() const =0
Get class ID of root Event.
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const IRegistry *pRegistry, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
IRegistry
Definition: IRegistry.h:29
IDataManagerSvc::requires
requires(!std::is_convertible_v< F, IDataStoreAgent * >) StatusCode traverseTree(F &&f)
Analyse by traversing all data objects in the data store.
Definition: IDataManagerSvc.h:171
extend_interfaces
Base class to be used to extend an interface.
Definition: extend_interfaces.h:14
IDataManagerSvc::clearStore
virtual StatusCode clearStore()=0
Remove all data objects in the data store.
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
IDataManagerSvc::registerAddress
virtual StatusCode registerAddress(IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_path, IOpaqueAddress *pRootAddr)=0
Initialize data store for new event by giving new event path.
StatusCode
Definition: StatusCode.h:64
IInterface.h
IDataManagerSvc::registerAddress
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
IDataManagerSvc::clearSubTree
virtual StatusCode clearSubTree(DataObject *pObject)=0
Remove all data objects below the sub tree identified by the object.
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:16
IDataManagerSvc::requires
requires(!std::is_convertible_v< F, IDataStoreAgent * >) StatusCode traverseSubTree(std
Analyse by traversing all data objects below the sub tree identified by its full path name.
Definition: IDataManagerSvc.h:132
IDataManagerSvc::rootName
virtual const std::string & rootName() const =0
Get Name of root Event.
DataObject.h
IDataManagerSvc::traverseSubTree
return traverseSubTree(pObject, &agent)
IDataManagerSvc::objectLeaves
virtual StatusCode objectLeaves(const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by the ...
DataObject
Definition: DataObject.h:37
IDataManagerSvc::clearSubTree
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
IDataProviderSvc
Definition: IDataProviderSvc.h:48
makeDataStoreAgent
::details::GenericDataStoreAgent< F > makeDataStoreAgent(F &&f)
Definition: IDataStoreAgent.h:49
IDataStoreAgent.h
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:79
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by the object.
IDataStoreAgent
Definition: IDataStoreAgent.h:24
IDataManagerSvc::DeclareInterfaceID
DeclareInterfaceID(IDataManagerSvc, 4, 0)
InterfaceID.
IConversionSvc
Definition: IConversionSvc.h:43