 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef ATHCONTAINERS_AUXTYPEREGISTRY_H
14 #define ATHCONTAINERS_AUXTYPEREGISTRY_H
21 #ifndef XAOD_STANDALONE
28 #include <unordered_map>
35 class AuxTypeRegistryImpl;
94 template <
class T,
class ALLOC = AuxAllocator_t<T> >
96 const std::string& clsname =
"",
116 const std::string&
name,
117 const std::string& clsname =
"",
140 const std::type_info& ti,
141 const std::string&
name,
142 const std::string& clsname =
"",
164 const std::type_info& ti,
165 const std::string&
name,
166 const std::string& clsname =
"",
181 const std::string& clsname =
"")
const;
193 template <
class T,
class ALLOC = AuxAllocator_t<T> >
210 const std::type_info& ti,
211 const std::type_info& ti_alloc,
225 size_t capacity)
const;
430 const std::type_info& ti_alloc);
442 const std::string& alloc_name);
468 const std::type_info& ti_alloc,
469 std::unique_ptr<const IAuxTypeVectorFactory> factory);
485 const std::string& ti_alloc_name,
486 std::unique_ptr<const IAuxTypeVectorFactory> factory);
489 #ifndef XAOD_STANDALONE
514 const std::string&
name)
const;
541 typedef AthContainers_detail::lock_guard<mutex_t>
lock_t;
571 template <
class T,
class ALLOC = AuxAllocator_t<T> >
589 static std::string
makeKey (
const std::string&
name,
590 const std::string& clsname);
600 #endif // not ATHCONTAINERS_AUXTYPEREGISTRY_H
const IAuxTypeVectorFactory * getFactory(const std::type_info &ti, const std::type_info &ti_alloc)
Return the vector factory for a given vector element type.
char data[hepevt_bytes_allocation_ATLAS]
Abstract interface for looking up strings/CLIDs in a pool.
std::unique_ptr< IAuxTypeVector > makeVectorFromData(SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag) const
Construct an IAuxTypeVector object from a vector.
const IAuxTypeVectorFactory * addFactory(const std::type_info &ti, const std::type_info &ti_alloc, std::unique_ptr< const IAuxTypeVectorFactory > factory)
Add a new type -> factory mapping.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
SG::auxid_t findAuxID(const std::string &name, const std::string &clsname="") const
Look up a name -> auxid_t mapping.
AthContainers_detail::lock_guard< mutex_t > lock_t
static std::string makeKey(const std::string &name, const std::string &clsname)
Return the key used to look up an entry in m_auxids.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Factory object that creates vectors using AuxTypeVector.
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
const std::string & inputRename(const std::string &key, const std::string &name) const
Check for an input renaming of an auxiliary variable.
const std::type_info * getAllocType(SG::auxid_t auxid) const
Return the type of the vector allocator.
static std::string linkedName(const std::string &name)
Given a variable name, return the name of the corresponding linked variable.
static bool classNameHasLink(const std::string &className)
Test to see if a class name corresponds to a class with a linked variable.
AuxTypeRegistry()
Constructor.
void copyForOutput(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const
Copy elements between vectors.
Abstract interface for manipulating vectors of arbitrary types.
~AuxTypeRegistry()
Destructor.
void copy(SG::auxid_t auxid, AuxVectorData &&dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const
Copy elements between vectors.
Handle mappings between names and auxid_t.
AthContainers_detail::mutex mutex_t
size_t auxid_t
Identifier for a particular aux data item.
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
@Brief Implementation class for AuxTypeRegistry.
void swap(SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const
Swap elements between vectors.
SG::SGKeyMap< InputRenameEntry > InputRenameMap_t
Abstract interface for looking up strings/CLIDs in a pool.
std::string getTypeName(SG::auxid_t auxid) const
Return the type name of an aux data item.
Flags getFlags(SG::auxid_t auxid) const
Return flags associated with an auxiliary variable.
Interface for factory objects that create vectors.
SG::auxid_t linkedVariable(SG::auxid_t auxid) const
Return the auxid if the linked variable, if there is one.
size_t getEltSize(SG::auxid_t auxid) const
Return size of an element in the STL vector.
std::unique_ptr< IAuxTypeVectorFactory > makeFactory() const
Create an AuxTypeVectorFactory instance.
static bool isLinkedName(const std::string &name)
Test if a variable name corresponds to a linked variable.
const std::type_info * getVecType(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
size_t numVariables() const
Return the total number of registered auxiliary variable.
AuxVarFlags
Additional flags to qualify an auxiliary variable.
void clear(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, size_t n) const
Clear a range of elements within a vector.
std::string getClassName(SG::auxid_t auxid) const
Return the class name associated with an aux data item (may be blank).
std::unique_ptr< IAuxTypeVector > makeVector(SG::auxid_t auxid, size_t size, size_t capacity) const
Construct a new vector to hold an aux item.
bool isLinked(SG::auxid_t auxid) const
Test whether this is a linked variable.
void setInputRenameMap(const Athena::InputRenameMap_t *map, const IStringPool &pool)
Declare input renaming requests.
void checkAuxID(const SG::auxid_t auxid, const Flags flags=Flags::None)
Verify type for an aux variable.
Basic definitions for auxiliary types.
std::unique_ptr< IAuxTypeVectorFactory > makeFactoryNull() const
makeFactory implementation that always returns nullptr.
Interface for factory objects that create vectors.
Abstract interface for manipulating vectors of arbitrary types.
AuxTypeRegistry & operator=(const AuxTypeRegistry &)
Manage lookup of vectors of auxiliary data.
AuxTypeRegistry(const AuxTypeRegistry &)
Disallow copy construction and assignment.
void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const
Copy elements between vectors.
SG::auxid_t getAuxID(const std::string &name, const std::string &clsname="", const Flags flags=Flags::None, const SG::auxid_t linkedVariable=SG::null_auxid)
Look up a name -> auxid_t mapping.