![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef SGTOOLS_TESTSTORE_H
14 #define SGTOOLS_TESTSTORE_H
22 #include <unordered_map>
35 :
key (the_key),
index (the_index) {}
46 {
return m.key +
m.index; }
55 virtual unsigned long addRef()
override;
56 virtual unsigned long release()
override;
58 virtual std::vector<const SG::DataProxy*>
proxies()
const override;
66 virtual const std::string&
name()
const override;
73 sgkey_t& sgkey_out,
size_t& index_out)
override;
79 const std::string&
key,
81 bool returnExisting)
override;
89 DataObject*
obj = SG::asStorable<T>(p_nc);
100 DataObject*
obj = SG::asStorable<T>(std::move (
up));
107 size_t index_in = 0,
size_t index_out = 0);
111 void remap (
const std::string& key_in,
const std::string& key_out,
112 size_t index_in = 0,
size_t index_out = 0)
117 remap (sgkey_in, sgkey_out, index_in, index_out);
122 typedef std::unordered_map<const void*, SG::DataProxy*>
tmap_t;
128 typedef std::unordered_map<TestStoreRemap, TestStoreRemap, TestStoreRemapHash>
remap_t;
145 CLID clid,
const std::string&
key);
161 #endif // not SGTOOLS_TESTSTORE_H
TestStoreRemap(SG::sgkey_t the_key=0, size_t the_index=0)
virtual unsigned long release() override
virtual void boundHandle(IResetable *handle) override
Tell the store that a handle has been bound to a proxy.
SG::DataProxy * record1(lock_t &, const void *p, DataObject *obj, CLID clid, const std::string &key)
std::lock_guard< mutex_t > lock_t
bool operator==(const TestStoreRemap &other) const
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
virtual bool tryELRemap(sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out) override
Test to see if the target of an ElementLink has moved.
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the key for a string/CLID pair.
SG::sgkey_t sgkey_t
Type of the keys.
void remap(sgkey_t sgkey_in, sgkey_t sgkey_out, size_t index_in=0, size_t index_out=0)
void remap(const std::string &key_in, const std::string &key_out, size_t index_in=0, size_t index_out=0)
virtual StatusCode addToStore(CLID, SG::DataProxy *proxy) override
Add a new proxy to the store.
virtual SG::DataProxy * proxy(const void *const pTransient) const override
Get a proxy referencing a given transient object.
static const CLID & ID()
the CLID of T
a resetable object (e.g. a SG DataHandle)
virtual unsigned long addRef() override
std::vector< std::pair< CLID, std::string > > m_missedProxies ATLAS_THREAD_SAFE
::StatusCode StatusCode
StatusCode definition for legacy code.
size_t operator()(const TestStoreRemap &m) const
std::vector< IResetable * > m_boundHandles
virtual std::vector< const SG::DataProxy * > proxies() const override
Return the list of all current proxies in store.
Maintain a mapping of strings to 64-bit ints.
virtual const std::string & name() const override
virtual void unboundHandle(IResetable *handle) override
Tell the store that a handle has been unbound from a proxy.
uint32_t CLID
The Class ID type.
void initTestStore ATLAS_NOT_THREAD_SAFE()
std::unordered_map< TestStoreRemap, TestStoreRemap, TestStoreRemapHash > remap_t
virtual const std::string * keyToString(sgkey_t) const override
Find the string corresponding to a given key.
virtual void registerKey(sgkey_t, const std::string &, CLID) override
Remember an additional mapping from key to string/CLID.
SG::SGKeyMap< SG::DataProxy * > kmap_t
void record(const T *p, const std::string &key)
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
SG::StringPool m_stringPool ATLAS_THREAD_SAFE
virtual StatusCode queryInterface(const InterfaceID &, void **) override
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
std::unique_ptr< TestStore > getTestStore()
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
Smart pointer to manage DataObject reference counts.
std::unordered_map< const void *, SG::DataProxy * > tmap_t
Define macros for attributes used to control the static checker.
void record(std::unique_ptr< T > up, const std::string &key)
void alias(SG::DataProxy *proxy, const std::string &newKey)