ATLAS Offline Software
|
Handle mappings between names and auxid_t. More...
#include <AuxTypeRegistry.h>
Classes | |
struct | typeinfo_t |
Hold information about one aux data item. More... | |
Public Types | |
using | Flags = SG::AuxVarFlags |
Additional flags to qualify an auxiliary variable. More... | |
Public Member Functions | |
size_t | numVariables () const |
Return the total number of registered auxiliary variable. More... | |
template<class T , class ALLOC = AuxAllocator_t<T>> | |
SG::auxid_t | getAuxID (const std::string &name, const std::string &clsname="", const Flags flags=Flags::None) |
Look up a name -> auxid_t mapping. More... | |
SG::auxid_t | getAuxID (const std::type_info &ti, const std::string &name, const std::string &clsname="", const Flags flags=Flags::None) |
Look up a name -> auxid_t mapping. More... | |
SG::auxid_t | getAuxID (const std::type_info &ti_alloc, const std::type_info &ti, const std::string &name, const std::string &clsname="", const Flags flags=Flags::None) |
Look up a name -> auxid_t mapping, specifying allocator. More... | |
SG::auxid_t | getAuxID (const std::string &alloc_type, const std::type_info &ti, const std::string &name, const std::string &clsname="", const Flags flags=Flags::None) |
Look up a name -> auxid_t mapping, specifying allocator. More... | |
SG::auxid_t | findAuxID (const std::string &name, const std::string &clsname="") const |
Look up a name -> auxid_t mapping. More... | |
template<class T , class ALLOC = AuxAllocator_t<T>> | |
void | checkAuxID (const SG::auxid_t auxid, const Flags flags=Flags::None) |
Verify type for an aux variable. More... | |
void | checkAuxID (const SG::auxid_t auxid, const std::type_info &ti, const std::type_info &ti_alloc, const Flags flags) |
Verify type for an aux variable. More... | |
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. More... | |
std::unique_ptr< IAuxTypeVector > | makeVectorFromData (SG::auxid_t auxid, void *data, bool isPacked, bool ownFlag) const |
Construct an IAuxTypeVector object from a vector. More... | |
std::string | getName (SG::auxid_t auxid) const |
Return the name of an aux data item. More... | |
std::string | getClassName (SG::auxid_t auxid) const |
Return the class name associated with an aux data item (may be blank). More... | |
const std::type_info * | getType (SG::auxid_t auxid) const |
Return the type of an aux data item. More... | |
std::string | getTypeName (SG::auxid_t auxid) const |
Return the type name of an aux data item. More... | |
const std::type_info * | getVecType (SG::auxid_t auxid) const |
Return the type of the STL vector used to hold an aux data item. More... | |
std::string | getVecTypeName (SG::auxid_t auxid) const |
Return the type of the STL vector used to hold an aux data item. More... | |
const std::type_info * | getAllocType (SG::auxid_t auxid) const |
Return the type of the vector allocator. More... | |
size_t | getEltSize (SG::auxid_t auxid) const |
Return size of an element in the STL vector. More... | |
Flags | getFlags (SG::auxid_t auxid) const |
Return flags associated with an auxiliary variable. More... | |
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. More... | |
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. More... | |
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. More... | |
void | swap (SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const |
Swap elements between vectors. More... | |
void | clear (SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, size_t n) const |
Clear a range of elements within a vector. More... | |
const IAuxTypeVectorFactory * | getFactory (const std::type_info &ti, const std::type_info &ti_alloc) |
Return the vector factory for a given vector element type. More... | |
const IAuxTypeVectorFactory * | getFactory (const std::type_info &ti, const std::string &alloc_name) |
Return the vector factory for a given vector element type. More... | |
const IAuxTypeVectorFactory * | getFactory (SG::auxid_t auxid) const |
Return the vector factory for a given auxid. More... | |
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. More... | |
const IAuxTypeVectorFactory * | addFactory (const std::type_info &ti, const std::string &ti_alloc_name, std::unique_ptr< const IAuxTypeVectorFactory > factory) |
Add a new type -> factory mapping. More... | |
void | setInputRenameMap (const Athena::IInputRename::InputRenameMap_t *map, const IStringPool &pool) |
Declare input renaming requests. More... | |
const std::string & | inputRename (const std::string &key, const std::string &name) const |
Check for an input renaming of an auxiliary variable. More... | |
Static Public Member Functions | |
static AuxTypeRegistry & | instance () |
Return the singleton registry instance. More... | |
Private Types | |
typedef AthContainers_detail::mutex | mutex_t |
typedef AthContainers_detail::lock_guard< mutex_t > | lock_t |
using | id_map_t = CxxUtils::ConcurrentStrMap< SG::auxid_t, CxxUtils::SimpleUpdater > |
Map from name -> auxid. More... | |
using | ti_map_t = CxxUtils::ConcurrentStrMap< const IAuxTypeVectorFactory *, CxxUtils::SimpleUpdater > |
Map from type_info name + allocator ti name -> IAuxTypeVectorFactory. More... | |
typedef std::unordered_map< std::string, std::string > | renameMap_t |
Save the information provided by setInputRenameMap . More... | |
using | allocMap_t = CxxUtils::ConcurrentStrMap< const std::type_info *, CxxUtils::SimpleUpdater > |
Private Member Functions | |
AuxTypeRegistry () | |
Constructor. More... | |
~AuxTypeRegistry () | |
Destructor. More... | |
AuxTypeRegistry (const AuxTypeRegistry &) | |
Disallow copy construction and assignment. More... | |
AuxTypeRegistry & | operator= (const AuxTypeRegistry &) |
SG::auxid_t | findAuxID (const std::string &name, const std::string &clsname, const Flags flags, const std::type_info &ti, const std::type_info *ti_alloc, const std::string *alloc_name, std::unique_ptr< IAuxTypeVectorFactory >(AuxTypeRegistry::*makeFactory)() const) |
Look up a name -> auxid_t mapping. More... | |
const IAuxTypeVectorFactory * | addFactory (lock_t &lock, const std::type_info &ti, const std::type_info &ti_alloc, const IAuxTypeVectorFactory *factory) |
Add a new type -> factory mapping. More... | |
const IAuxTypeVectorFactory * | addFactory (lock_t &, const std::type_info &ti, const std::string &ti_alloc_name, std::unique_ptr< const IAuxTypeVectorFactory > factory) |
Add a new type -> factory mapping. More... | |
template<class T , class ALLOC = AuxAllocator_t<T>> | |
std::unique_ptr< IAuxTypeVectorFactory > | makeFactory () const |
Create an AuxTypeVectorFactory instance. More... | |
std::unique_ptr< IAuxTypeVectorFactory > | makeFactoryNull () const |
makeFactory implementation that always returns nullptr. More... | |
const IAuxTypeVectorFactory * | getFactory (lock_t &lock, const std::type_info &ti, const std::type_info &ti_alloc) |
Return the vector factory for a given vector element type. More... | |
Static Private Member Functions | |
static std::string | makeKey (const std::string &name, const std::string &clsname) |
Return the key used to look up an entry in m_auxids. More... | |
static bool | checkName (const std::string &s) |
Check for valid variable name. More... | |
Private Attributes | |
AthContainers_detail::concurrent_vector< typeinfo_t > | m_types |
Table of aux data items, indexed by auxid . More... | |
id_map_t | m_auxids |
ti_map_t | m_factories |
std::vector< const IAuxTypeVectorFactory * > | m_oldFactories |
Hold additional factory instances we need to delete. More... | |
renameMap_t | m_renameMap |
mutex_t | m_mutex |
Mutex controlling access to the registry. More... | |
allocMap_t | m_allocMap |
Handle mappings between names and auxid_t.
Each auxiliary data item associated with a container has a name. Internally, they are identified by small integers of type auxid_t
. This class handles the mapping between names and auxid_t's
. It also keeps track of the type of each aux data item, and provides some generic methods for operating on this data.
The auxid_t
namespace is global, shared among all classes. It's no problem for two classes to use aux data with the same auxid_t
, as long as the type is the same. If they want to define them as different types, though, that's a problem. To help with this, an optional class name may be supplied; this qualifies the aux data name to make it unique across classes.
This class is meant to be used as a singleton. Use the instance
method to get the singleton instance.
Methods are locked internally as needed, so access is thread-safe. Thread-safety is however not supported in standalone builds.
Definition at line 61 of file AuxTypeRegistry.h.
|
private |
Definition at line 701 of file AuxTypeRegistry.h.
Additional flags to qualify an auxiliary variable.
Definition at line 66 of file AuxTypeRegistry.h.
|
private |
Map from name -> auxid.
Definition at line 675 of file AuxTypeRegistry.h.
|
private |
Definition at line 488 of file AuxTypeRegistry.h.
|
private |
Definition at line 487 of file AuxTypeRegistry.h.
|
private |
Save the information provided by setInputRenameMap
.
Each entry is of the form KEY.DECOR -> DECOR_RENAMED
Definition at line 687 of file AuxTypeRegistry.h.
|
private |
Map from type_info name + allocator ti name -> IAuxTypeVectorFactory.
Definition at line 679 of file AuxTypeRegistry.h.
|
private |
Constructor.
Populates the type -> factory mappings for standard C++ types.
Definition at line 653 of file AuxTypeRegistry.cxx.
|
private |
|
private |
Disallow copy construction and assignment.
const IAuxTypeVectorFactory * SG::AuxTypeRegistry::addFactory | ( | const std::type_info & | ti, |
const std::string & | ti_alloc_name, | ||
std::unique_ptr< const IAuxTypeVectorFactory > | factory | ||
) |
Add a new type -> factory mapping.
ti | Type of the vector element. |
ti_alloc_name | The name of the vector allocator type. |
factory | The factory instance. |
This records that factory
can be used to construct vectors with an element type of ti
. If a mapping already exists, the new factory is discarded, unless the old one is a dynamic factory and the new one isn't, in which case the new replaces the old one.
Definition at line 554 of file AuxTypeRegistry.cxx.
const IAuxTypeVectorFactory * SG::AuxTypeRegistry::addFactory | ( | const std::type_info & | ti, |
const std::type_info & | ti_alloc, | ||
std::unique_ptr< const IAuxTypeVectorFactory > | factory | ||
) |
Add a new type -> factory mapping.
ti | Type of the vector element. |
ti_alloc | The type of the vector allocator |
factory | The factory instance. |
This records that factory
can be used to construct vectors with an element type of ti
. If a mapping already exists, the new factory is discarded, unless the old one is a dynamic factory and the new one isn't, in which case the new replaces the old one.
Definition at line 530 of file AuxTypeRegistry.cxx.
|
private |
Add a new type -> factory mapping.
(external locking)
lock | The registry lock. |
ti | Type of the vector element. |
ti_alloc_name | The name of the vector allocator type. |
factory | The factory instance. |
This records that factory
can be used to construct vectors with an element type of ti
. If a mapping already exists, the new factory is discarded, unless the old one is a dynamic factory and the new one isn't, in which case the new replaces the old one.
Definition at line 619 of file AuxTypeRegistry.cxx.
|
private |
Add a new type -> factory mapping.
(external locking)
lock | The registry lock. |
ti | Type of the vector element. |
ti_alloc | The type of the vector allocator |
factory | The factory instance. Ownership is not taken. |
This records that factory
can be used to construct vectors with an element type of ti
. If a mapping already exists, the new factory is discarded, unless the old one is a dynamic factory and the new one isn't, in which case the new replaces the old one.
Definition at line 576 of file AuxTypeRegistry.cxx.
void SG::AuxTypeRegistry::checkAuxID | ( | const SG::auxid_t | auxid, |
const Flags | flags = Flags::None |
||
) |
Verify type for an aux variable.
auxid | The ID of the variable to check. |
flags | Optional flags qualifying the type. See above. |
If the type of auxid
is not compatible with the supplied types T
/ ALLOC
, then throw a SG::ExcAuxTypeMismatch
exception. Also may throw SG::ExcAtomicMismatch
.
void SG::AuxTypeRegistry::checkAuxID | ( | const SG::auxid_t | auxid, |
const std::type_info & | ti, | ||
const std::type_info & | ti_alloc, | ||
const Flags | flags | ||
) |
Verify type for an aux variable.
auxid | The ID of the variable to check. |
ti | Type of the aux data item. |
ti_alloc | Type of the vector allocator. |
flags | Optional flags qualifying the type. See above. |
If the type of auxid
is not compatible with the supplied types ti
/ ti_alloc
, then throw a SG::ExcAuxTypeMismatch
exception. Also may throw SG::ExcAtomicMismatch
.
Definition at line 177 of file AuxTypeRegistry.cxx.
|
staticprivate |
Check for valid variable name.
name | Name to check. |
Require that NAME be not empty, contains only alphanumeric characters plus underscore, and first character is not a digit.
Definition at line 929 of file AuxTypeRegistry.cxx.
void SG::AuxTypeRegistry::clear | ( | SG::auxid_t | auxid, |
AuxVectorData & | dst, | ||
size_t | dst_index, | ||
size_t | n | ||
) | const |
Clear a range of elements within a vector.
auxid | The aux data item being operated on. |
dst | Container holding the element |
dst_index | Index of the first element in the vector. |
n | Number of elements to clear. |
Definition at line 438 of file AuxTypeRegistry.cxx.
void SG::AuxTypeRegistry::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.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. Declared as a rvalue reference to allow passing a temporary here (such as from AuxVectorInterface). |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
void SG::AuxTypeRegistry::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.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
Definition at line 373 of file AuxTypeRegistry.cxx.
void SG::AuxTypeRegistry::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.
Apply any transformations needed for output.
auxid | The aux data item being operated on. |
dst | Container for the destination vector. |
dst_index | Index of the first destination element in the vector. |
src | Container for the source vector. |
src_index | Index of the first source element in the vector. |
n | Number of elements to copy. |
dst
and @ src can be either the same or different.
Definition at line 396 of file AuxTypeRegistry.cxx.
|
private |
Look up a name -> auxid_t
mapping.
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
flags | Optional flags qualifying the type. See above. |
ti | The type of this aux data item. |
ti_alloc | The type of the vector allocator. |
alloc_name | The name of the vector allocator. Used only if ti_alloc is null. |
makeFactory | Function to create a factory for this type, if needed. May return 0 if the type is unknown. |
If the aux data item already exists, check to see if the provided type matches the type that was used before. If so, then set return the auxid; otherwise, throw SG::ExcAuxTypeMismatch
.
If the aux data item does not already exist, then see if we have a factory registered for this type_info
. If not, then call makeFactory
and use what it returns. If that returns 0, then fail and return null_auxid. Otherwise, assign a new auxid and return it.
Definition at line 729 of file AuxTypeRegistry.cxx.
SG::auxid_t SG::AuxTypeRegistry::findAuxID | ( | const std::string & | name, |
const std::string & | clsname = "" |
||
) | const |
Look up a name -> auxid_t
mapping.
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
Will only find an existing auxid_t
; unlike getAuxID
, this won't make a new one. If the item isn't found, this returns null_auxid
.
Definition at line 150 of file AuxTypeRegistry.cxx.
const std::type_info * SG::AuxTypeRegistry::getAllocType | ( | SG::auxid_t | auxid | ) | const |
Return the type of the vector allocator.
auxid | The desired aux data item. |
Definition at line 341 of file AuxTypeRegistry.cxx.
SG::auxid_t SG::AuxTypeRegistry::getAuxID | ( | const std::string & | alloc_type, |
const std::type_info & | ti, | ||
const std::string & | name, | ||
const std::string & | clsname = "" , |
||
const Flags | flags = Flags::None |
||
) |
Look up a name -> auxid_t
mapping, specifying allocator.
alloc_name | Name of the vector allocator type. |
ti | Type of the aux data item. |
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
flags | Optional flags qualifying the type. See above. |
The type of the item is given by ti. Return null_auxid
if we don't know how to make vectors of ti. (Use addFactory
to register additional types.) If an item with the same name was previously requested with a different type, then throw SG::ExcAuxTypeMismatch
.
Definition at line 129 of file AuxTypeRegistry.cxx.
SG::auxid_t SG::AuxTypeRegistry::getAuxID | ( | const std::string & | name, |
const std::string & | clsname = "" , |
||
const Flags | flags = Flags::None |
||
) |
Look up a name -> auxid_t
mapping.
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
flags | Optional flags qualifying the type. See above. |
The type of the item is given by the template parameter T
, and the ALLOC
gives the type of the vector allocator. If an item with the same name was previously requested with a different type, then throw SG::ExcAuxTypeMismatch
.
SG::auxid_t SG::AuxTypeRegistry::getAuxID | ( | const std::type_info & | ti, |
const std::string & | name, | ||
const std::string & | clsname = "" , |
||
const Flags | flags = Flags::None |
||
) |
Look up a name -> auxid_t
mapping.
ti | Type of the aux data item. |
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
flags | Optional flags qualifying the type. See above. |
The type of the item is given by ti. Return null_auxid
if we don't know how to make vectors of ti. (Use addFactory
to register additional types.) If an item with the same name was previously requested with a different type, then throw SG::ExcAuxTypeMismatch
.
Definition at line 80 of file AuxTypeRegistry.cxx.
SG::auxid_t SG::AuxTypeRegistry::getAuxID | ( | const std::type_info & | ti_alloc, |
const std::type_info & | ti, | ||
const std::string & | name, | ||
const std::string & | clsname = "" , |
||
const Flags | flags = Flags::None |
||
) |
Look up a name -> auxid_t
mapping, specifying allocator.
ti_alloc | Type of the vector allocator. |
ti | Type of the aux data item. |
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
flags | Optional flags qualifying the type. See above. |
The type of the item is given by ti. Return null_auxid
if we don't know how to make vectors of ti. (Use addFactory
to register additional types.) If an item with the same name was previously requested with a different type, then throw SG::ExcAuxTypeMismatch
.
Definition at line 104 of file AuxTypeRegistry.cxx.
std::string SG::AuxTypeRegistry::getClassName | ( | SG::auxid_t | auxid | ) | const |
Return the class name associated with an aux data item (may be blank).
auxid | The desired aux data item. |
Definition at line 275 of file AuxTypeRegistry.cxx.
size_t SG::AuxTypeRegistry::getEltSize | ( | SG::auxid_t | auxid | ) | const |
Return size of an element in the STL vector.
auxid | The desired aux data item. |
Definition at line 353 of file AuxTypeRegistry.cxx.
const IAuxTypeVectorFactory * SG::AuxTypeRegistry::getFactory | ( | const std::type_info & | ti, |
const std::string & | alloc_name | ||
) |
Return the vector factory for a given vector element type.
ti | The type of the vector element. |
alloc_name | The name of the vector allocator type. |
Returns nullptr if the type is not known. (Use addFactory
to add new mappings.)
Definition at line 505 of file AuxTypeRegistry.cxx.
const IAuxTypeVectorFactory * SG::AuxTypeRegistry::getFactory | ( | const std::type_info & | ti, |
const std::type_info & | ti_alloc | ||
) |
Return the vector factory for a given vector element type.
ti | The type of the vector element. |
ti_alloc | The type of the vector allocator. |
Returns nullptr if the type is not known. (Use addFactory
to add new mappings.)
ti | The type of the vector element. |
ti_alloc | The type of the vector allocator |
Returns nullptr if the type is not known. (Use addFactory
to add new mappings.)
Definition at line 457 of file AuxTypeRegistry.cxx.
|
private |
Return the vector factory for a given vector element type.
(External locking.)
lock | The registry lock. |
ti | The type of the vector element. |
ti_alloc | The type of the vector allocator |
Returns nullptr if the type is not known. (Use addFactory
to add new mappings.)
Definition at line 476 of file AuxTypeRegistry.cxx.
const IAuxTypeVectorFactory* SG::AuxTypeRegistry::getFactory | ( | SG::auxid_t | auxid | ) | const |
Return the vector factory for a given auxid.
auxid | The desired aux data item. |
Returns nullptr if the type is not known. (Use addFactory
to add new mappings.)
Flags SG::AuxTypeRegistry::getFlags | ( | SG::auxid_t | auxid | ) | const |
Return flags associated with an auxiliary variable.
auxid | The desired aux data item. |
std::string SG::AuxTypeRegistry::getName | ( | SG::auxid_t | auxid | ) | const |
Return the name of an aux data item.
auxid | The desired aux data item. |
Definition at line 262 of file AuxTypeRegistry.cxx.
const std::type_info * SG::AuxTypeRegistry::getType | ( | SG::auxid_t | auxid | ) | const |
Return the type of an aux data item.
auxid | The desired aux data item. |
Definition at line 287 of file AuxTypeRegistry.cxx.
std::string SG::AuxTypeRegistry::getTypeName | ( | SG::auxid_t | auxid | ) | const |
Return the type name of an aux data item.
auxid | The desired aux data item. |
Returns an empty string if the type is not known.
Definition at line 301 of file AuxTypeRegistry.cxx.
const std::type_info * SG::AuxTypeRegistry::getVecType | ( | SG::auxid_t | auxid | ) | const |
Return the type of the STL vector used to hold an aux data item.
auxid | The desired aux data item. |
Definition at line 313 of file AuxTypeRegistry.cxx.
std::string SG::AuxTypeRegistry::getVecTypeName | ( | SG::auxid_t | auxid | ) | const |
Return the type of the STL vector used to hold an aux data item.
Return the type name of the STL vector used to hold an aux data item.
auxid | The desired aux data item. |
Returns an empty string if the type is not known.
Definition at line 328 of file AuxTypeRegistry.cxx.
const std::string & SG::AuxTypeRegistry::inputRename | ( | const std::string & | key, |
const std::string & | name | ||
) | const |
Check for an input renaming of an auxiliary variable.
key The SG key of the object to which the variable is attached.
name The name of the variable on the input file.
name
, but may be different if there was a renaming request. Definition at line 907 of file AuxTypeRegistry.cxx.
|
static |
Return the singleton registry instance.
Definition at line 49 of file AuxTypeRegistry.cxx.
|
private |
Create an AuxTypeVectorFactory
instance.
This is passed to findAuxID
when we're looking up an item for which we know the type at compile-time.
The ALLOC template parameter is the allocator to use for the resulting vector.
|
private |
makeFactory
implementation that always returns nullptr.
This is passed to findAuxID
when we're looking up an item for which we do not know the type at compile-time.
|
staticprivate |
Return the key used to look up an entry in m_auxids.
name | The name of the aux data item. |
clsname | The name of its associated class. May be blank. |
Definition at line 247 of file AuxTypeRegistry.cxx.
std::unique_ptr< IAuxTypeVector > SG::AuxTypeRegistry::makeVector | ( | SG::auxid_t | auxid, |
size_t | size, | ||
size_t | capacity | ||
) | const |
Construct a new vector to hold an aux item.
auxid | The desired aux data item. |
size | Initial size of the new vector. |
capacity | Initial capacity of the new vector. |
Returns a newly-allocated object.
auxid | The desired aux data item. |
size | Initial size of the new vector. |
capacity | Initial capacity of the new vector. |
Definition at line 206 of file AuxTypeRegistry.cxx.
std::unique_ptr< IAuxTypeVector > SG::AuxTypeRegistry::makeVectorFromData | ( | SG::auxid_t | auxid, |
void * | data, | ||
bool | isPacked, | ||
bool | ownMode | ||
) | const |
Construct an IAuxTypeVector
object from a vector.
data | The vector object. |
isPacked | If true, data is a PackedContainer . |
ownFlag | If true, the newly-created IAuxTypeVector object will take ownership of data . |
If the element type is T, then data
should be a pointer to a std::vector<T> object, which was obtained with new
. But if isPacked
is true
, then data
should instead point at an object of type SG::PackedContainer<T>
.
Returns a newly-allocated object.
Definition at line 231 of file AuxTypeRegistry.cxx.
size_t SG::AuxTypeRegistry::numVariables | ( | ) | const |
Return the total number of registered auxiliary variable.
(This will be one more than the current largest auxid.)
Definition at line 61 of file AuxTypeRegistry.cxx.
|
private |
void SG::AuxTypeRegistry::setInputRenameMap | ( | const Athena::IInputRename::InputRenameMap_t * | map, |
const IStringPool & | pool | ||
) |
Declare input renaming requests.
map | Map of (hashed) sgkey -> sgkey for renaming requests. |
pool | String pool in which the hashed keys are defined. |
This is called by AddressRemappingSvc
when there is a request to rename input objects. It saves any requests involving renaming of auxiliary variables and makes that information available via inputRename
.
Definition at line 873 of file AuxTypeRegistry.cxx.
void SG::AuxTypeRegistry::swap | ( | SG::auxid_t | auxid, |
AuxVectorData & | a, | ||
size_t | aindex, | ||
AuxVectorData & | b, | ||
size_t | bindex, | ||
size_t | n | ||
) | const |
Swap elements between vectors.
auxid | The aux data item being operated on. |
a | Container for the first vector. |
aindex | Index of the first element in the first vector. |
b | Container for the second vector. |
bindex | Index of the first element in the second vector. |
n | Number of elements to swap. |
a
and @ b can be either the same or different. However, the ranges should not overlap.
Definition at line 420 of file AuxTypeRegistry.cxx.
|
private |
Definition at line 702 of file AuxTypeRegistry.h.
|
private |
Definition at line 676 of file AuxTypeRegistry.h.
|
private |
Definition at line 680 of file AuxTypeRegistry.h.
|
mutableprivate |
Mutex controlling access to the registry.
Definition at line 696 of file AuxTypeRegistry.h.
|
private |
Hold additional factory instances we need to delete.
Definition at line 683 of file AuxTypeRegistry.h.
|
private |
Definition at line 688 of file AuxTypeRegistry.h.
|
private |
Table of aux data items, indexed by auxid
.
Definition at line 671 of file AuxTypeRegistry.h.