ATLAS Offline Software
Loading...
Searching...
No Matches
xAODRootAccess/xAODRootAccess/tools/IProxyDict.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef XAODROOTACCESS_TOOLS_IPROXYDICT_H
6#define XAODROOTACCESS_TOOLS_IPROXYDICT_H
7
8#ifdef XAOD_STANDALONE
9
12#include "SGCore/sgkey_t.h"
13#include "xAODCore/CLASS_DEF.h"
14
15// System include(s).
16#include <string>
17#include <vector>
18#include <memory>
19#include <cstdint>
20
21namespace SG {
22
24 struct DataProxy {};
25
27 template< class T >
28 using DataObjectSharedPtr = std::shared_ptr< T >;
29
30} // namespace SG
31
33struct DataObject {};
35struct InterfaceID {};
36
44class IProxyDict {
45
46public:
48 virtual ~IProxyDict() {}
49
51 virtual SG::DataProxy* proxy( const void* const pTransient ) const = 0;
52
54 virtual SG::DataProxy* proxy( const CLID& id,
55 const std::string& key ) const = 0;
56
58 virtual SG::DataProxy* proxy_exact( SG::sgkey_t sgkey ) const = 0;
59
61 virtual StatusCode addToStore( CLID id, SG::DataProxy* proxy ) = 0;
62
64 virtual std::vector< const SG::DataProxy* > proxies() const = 0;
65
67 virtual SG::sgkey_t stringToKey( const std::string& str, CLID clid ) = 0;
68
70 virtual const std::string* keyToString( SG::sgkey_t key ) const = 0;
71
73 virtual const std::string* keyToString( SG::sgkey_t key,
74 CLID& clid ) const = 0;
75
77 virtual void registerKey( SG::sgkey_t key,
78 const std::string& str,
79 CLID clid ) = 0;
80
82 virtual SG::DataProxy*
84 const std::string& key,
85 bool allowMods,
86 bool returnExisting ) = 0;
87
89 virtual const std::string& name() const = 0;
90
91}; // class IProxyDict
92
93#else
94
95// If we're in an offline build, just take the declaration from AthenaKernel.
97#include "SGTools/DataProxy.h"
98
99#endif // XAOD_STANDALONE
100#endif // XAODROOTACCESS_TOOLS_IPROXYDICT_H
File providing the different SG_BASE macros.
uint32_t CLID
The Class ID type.
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting)=0
Record an object in the store.
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy)=0
Add a new proxy to the store.
virtual SG::DataProxy * proxy(const CLID &id, const std::string &key) const =0
Get proxy with given id and key.
virtual std::vector< const SG::DataProxy * > proxies() const =0
Return the list of all current proxies in store.
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const =0
Get proxy given a hashed key+clid.
virtual sgkey_t stringToKey(const std::string &str, CLID clid)=0
Find the key for a string/CLID pair.
virtual const std::string * keyToString(sgkey_t key) const =0
Find the string corresponding to a given key.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clid)=0
Remember an additional mapping from key to string/CLID.
::StatusCode StatusCode
StatusCode definition for legacy code.
Forward declaration.
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32