5#ifndef XAODROOTACCESS_TSTORE_H
6#define XAODROOTACCESS_TSTORE_H
69 template<
typename T >
70 ::Bool_t
contains(
const std::string& key )
const;
73 template<
typename T >
74 ::Bool_t
isConst(
const std::string& key )
const;
77 template<
typename T >
78 StatusCode
retrieve(
const T*& obj,
const std::string& key )
const;
80 template<
typename T >
81 StatusCode
retrieve( T*& obj,
const std::string& key )
const;
84 template<
typename T >
85 StatusCode
record( T* obj,
const std::string& key );
87 template<
typename T >
88 StatusCode
record( std::unique_ptr< T > obj,
const std::string& key );
91 template<
typename T >
92 StatusCode
record(
const T* obj,
const std::string& key );
94 template<
typename T >
95 StatusCode
record( std::unique_ptr< const T > obj,
const std::string& key );
98 template<
typename T >
99 void keys( std::vector< std::string >& vkeys )
const;
105 StatusCode
remove(
const std::string& key );
107 StatusCode
remove(
void* ptr );
119 ::Bool_t
contains(
const std::string& key,
120 const std::type_info& ti )
const;
122 ::Bool_t
isConst(
const std::string& key,
123 const std::type_info& ti )
const;
125 void*
getObject(
const std::string& key,
const std::type_info& ti )
const;
128 const std::type_info& ti )
const;
130 StatusCode
record(
void* obj,
const std::string& key,
131 const std::string& classname,
132 ::Bool_t isOwner, ::Bool_t
isConst );
134 StatusCode
record(
void* obj,
const std::string& key,
135 const std::type_info& ti,
136 ::Bool_t isOwner, ::Bool_t
isConst );
141 const std::type_info& ti,
142 ::Bool_t isOwner, ::Bool_t
isConst );
152 ::Bool_t
contains(
const void* ptr )
const;
156 const std::string&
getName(
const void* ptr )
const;
158 void getNames(
const std::string& targetClassName,
159 std::vector<std::string>& vkeys )
const;
175 template<
typename T >
177 ::Bool_t isOwner, ::Bool_t
isConst );
DataVector adapter that acts like it holds const pointers.
Base class for the event (xAOD::TEvent and xAOD::REvent) classes.
Tool for accessing xAOD files outside of Athena.
This class takes care of holding EDM objects in memory.
void keys(std::vector< std::string > &vkeys) const
provide a list of keys associated with a type
StatusCode record(std::unique_ptr< const T > obj, const std::string &key)
Add a const object to the store, explicitly taking ownership of it.
StatusCode remove(const std::string &key)
Remove an object from the store by name.
StatusCode record_impl(T *obj, const std::string &key, ::Bool_t isOwner, ::Bool_t isConst)
Internal implementation of the templated record method.
SG::SGKeyMap< std::string > HashedKeys_t
Type of the internal storage for the hashed keys of the object names.
void setActive()
Set this as the active transient store in the application.
void print() const
Print the current contents of the transient store.
StatusCode retrieve(const T *&obj, const std::string &key) const
Retrieve either a constant or non-constant object from the store.
const void * getConstObject(const std::string &key, const std::type_info &ti) const
Function retrieving a const object in a non-template way.
void clear()
Clear the store of all of its contents.
virtual ~TStore()
Destructor.
StatusCode record(T *obj, const std::string &key)
Add an object to the store.
void getNames(const std::string &targetClassName, std::vector< std::string > &vkeys) const
Function determining the list keys associated with a type name.
const std::string & getName(SG::sgkey_t hash) const
Get the name corresponding to a hashed key.
friend class TEvent
Make TEvent a friend of this class.
StatusCode record(std::unique_ptr< T > obj, const std::string &key)
Add an object to the store, explicitly taking ownership of it.
HashedKeys_t m_keys
The key map.
void * getObject(const std::string &key, const std::type_info &ti) const
Function retrieving a non-const object in a non-template way.
std::map< std::string, THolder * > Objects_t
Type of the internal container storing all the objects.
TStore & operator=(const TStore &)=delete
Disallow copying the object.
const THolder * holder(const std::string &key) const
return holder for key
TStore(const TStore &)=delete
Disallow copying the object.
StatusCode retrieve(T *&obj, const std::string &key) const
Retrieve a non-constant object from the store.
::Bool_t contains(const std::string &key) const
Function checking if an object is available from the store.
Objects_t m_objects
The object storage.
StatusCode record(const T *obj, const std::string &key)
Add a const object to the store.
TStore()
Default constructor.
StatusCode record(ConstDataVector< T > *obj, const std::string &key, const std::type_info &ti, ::Bool_t isOwner, ::Bool_t isConst)
Function doing the first step of recording a ConstDataVector object.
::Bool_t isConst(const std::string &key) const
Function checking if an object with a given type is constant.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.