The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
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>
17#include <string>
18#include <string_view>
19#include <vector>
20
21class IConversionSvc;
22class IOpaqueAddress;
23class IRegistry;
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*> )
156 auto agent = makeDataStoreAgent( std::forward<F>( f ) );
157 return traverseSubTree( pObject, &agent );
158 }
159
164
170 template <typename F>
171 requires( !std::is_convertible_v<F, IDataStoreAgent*> )
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};
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
::details::GenericDataStoreAgent< F > makeDataStoreAgent(F &&f)
#define GAUDI_API
Definition Kernel.h:49
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
IRegistry * registry() const
Get pointer to Registry.
Definition DataObject.h:79
Data provider interface definition.
Generic data agent interface.
Opaque address interface definition.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition IRegistry.h:29
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
StatusCode registerAddress(DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
Register object address with the data store.
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
virtual StatusCode objectParent(const IRegistry *pRegistry, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
StatusCode traverseSubTree(DataObject *pObject, F &&f)
Analyse by traversing all data objects below the sub tree identified by the object.
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual CLID rootCLID() const =0
Get class ID of root Event.
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 ...
StatusCode traverseTree(F &&f)
Analyse by traversing all data objects in the data store.
virtual StatusCode unregisterAddress(IRegistry *pParent, std::string_view objPath)=0
Unregister object address from the data store.
virtual StatusCode setRoot(std::string root_path, IOpaqueAddress *pRootAddr)=0
Initialize data store for new event by giving new event path.
StatusCode unregisterAddress(DataObject *pParent, std::string_view objPath)
Unregister object address from the data store.
DeclareInterfaceID(IDataManagerSvc, 4, 0)
InterfaceID.
virtual StatusCode clearSubTree(DataObject *pObject)=0
Remove all data objects below the sub tree identified by the object.
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 ...
virtual StatusCode registerAddress(IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
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.
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
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.
virtual StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr)=0
Pass a default data loader to the service.
virtual StatusCode clearStore()=0
Remove all data objects in the data store.
virtual const std::string & rootName() const =0
Get Name of root Event.
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
virtual StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by the object.
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
Base class to be used to extend an interface.