ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SG::AuxTypeRegistry Class Reference

Handle mappings between names and auxid_t. More...

#include <AuxTypeRegistry.h>

Collaboration diagram for SG::AuxTypeRegistry:

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< IAuxTypeVectormakeVector (SG::auxid_t auxid, size_t size, size_t capacity) const
 Construct a new vector to hold an aux item. More...
 
std::unique_ptr< IAuxTypeVectormakeVectorFromData (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 IAuxTypeVectorFactorygetFactory (const std::type_info &ti, const std::type_info &ti_alloc)
 Return the vector factory for a given vector element type. More...
 
const IAuxTypeVectorFactorygetFactory (const std::type_info &ti, const std::string &alloc_name)
 Return the vector factory for a given vector element type. More...
 
const IAuxTypeVectorFactorygetFactory (SG::auxid_t auxid) const
 Return the vector factory for a given auxid. More...
 
const IAuxTypeVectorFactoryaddFactory (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 IAuxTypeVectorFactoryaddFactory (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 AuxTypeRegistryinstance ()
 Return the singleton registry instance. More...
 

Private Types

typedef AthContainers_detail::mutex mutex_t
 
typedef AthContainers_detail::lock_guard< mutex_tlock_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...
 
AuxTypeRegistryoperator= (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 IAuxTypeVectorFactoryaddFactory (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 IAuxTypeVectorFactoryaddFactory (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< IAuxTypeVectorFactorymakeFactory () const
 Create an AuxTypeVectorFactory instance. More...
 
std::unique_ptr< IAuxTypeVectorFactorymakeFactoryNull () const
 makeFactory implementation that always returns nullptr. More...
 
const IAuxTypeVectorFactorygetFactory (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_tm_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
 

Detailed Description

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.

Member Typedef Documentation

◆ allocMap_t

using SG::AuxTypeRegistry::allocMap_t = CxxUtils::ConcurrentStrMap<const std::type_info*, CxxUtils::SimpleUpdater>
private

Definition at line 701 of file AuxTypeRegistry.h.

◆ Flags

Additional flags to qualify an auxiliary variable.

Definition at line 66 of file AuxTypeRegistry.h.

◆ id_map_t

using SG::AuxTypeRegistry::id_map_t = CxxUtils::ConcurrentStrMap<SG::auxid_t, CxxUtils::SimpleUpdater>
private

Map from name -> auxid.

Definition at line 675 of file AuxTypeRegistry.h.

◆ lock_t

typedef AthContainers_detail::lock_guard<mutex_t> SG::AuxTypeRegistry::lock_t
private

Definition at line 488 of file AuxTypeRegistry.h.

◆ mutex_t

typedef AthContainers_detail::mutex SG::AuxTypeRegistry::mutex_t
private

Definition at line 487 of file AuxTypeRegistry.h.

◆ renameMap_t

typedef std::unordered_map<std::string, std::string> SG::AuxTypeRegistry::renameMap_t
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.

◆ ti_map_t

Map from type_info name + allocator ti name -> IAuxTypeVectorFactory.

Definition at line 679 of file AuxTypeRegistry.h.

Constructor & Destructor Documentation

◆ AuxTypeRegistry() [1/2]

SG::AuxTypeRegistry::AuxTypeRegistry ( )
private

Constructor.

Populates the type -> factory mappings for standard C++ types.

Definition at line 653 of file AuxTypeRegistry.cxx.

654  : m_auxids (id_map_t::Updater_t()),
655  m_factories (ti_map_t::Updater_t()),
656  m_allocMap (allocMap_t::Updater_t())
657 {
658  m_types.reserve (auxid_set_size_hint);
659 
660  // Make sure we have factories registered for common C++ types.
661 #define ADD_FACTORY(T) addFactory(typeid(T), typeid(AuxAllocator_t<T>), std::make_unique<AuxTypeVectorFactory<T> >())
662  ADD_FACTORY (bool);
663  ADD_FACTORY (char);
664  ADD_FACTORY (unsigned char);
665  ADD_FACTORY (short);
666  ADD_FACTORY (unsigned short);
667  ADD_FACTORY (int);
668  ADD_FACTORY (unsigned int);
669  ADD_FACTORY (long);
670  ADD_FACTORY (unsigned long);
671  ADD_FACTORY (long long);
672  ADD_FACTORY (unsigned long long);
673  ADD_FACTORY (float);
674  ADD_FACTORY (double);
675  ADD_FACTORY (std::string);
676 
677  ADD_FACTORY (std::vector<char>);
678  ADD_FACTORY (std::vector<unsigned char>);
679  ADD_FACTORY (std::vector<int>);
680  ADD_FACTORY (std::vector<unsigned int>);
681  ADD_FACTORY (std::vector<float>);
682  ADD_FACTORY (std::vector<double>);
683 #undef ADD_FACTORY
684 }

◆ ~AuxTypeRegistry()

SG::AuxTypeRegistry::~AuxTypeRegistry ( )
private

Destructor.

Delete factory instances.

Definition at line 692 of file AuxTypeRegistry.cxx.

693 {
694  // not using reference, because our iterator doesn't return a reference
695  for (auto p : m_factories) {
696  if (p.first.find (";TI;") == std::string::npos) {
697  delete p.second;
698  }
699  }
700  for (const IAuxTypeVectorFactory* p : m_oldFactories)
701  delete p;
702 }

◆ AuxTypeRegistry() [2/2]

SG::AuxTypeRegistry::AuxTypeRegistry ( const AuxTypeRegistry )
private

Disallow copy construction and assignment.

Member Function Documentation

◆ addFactory() [1/4]

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.

Parameters
tiType of the vector element.
ti_alloc_nameThe name of the vector allocator type.
factoryThe 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.

557 {
558  lock_t lock (m_mutex);
559  return addFactory (lock, ti, ti_alloc_name, std::move (factory));
560 }

◆ addFactory() [2/4]

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.

Parameters
tiType of the vector element.
ti_allocThe type of the vector allocator
factoryThe 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.

533 {
534  lock_t lock (m_mutex);
535  std::string name = SG::normalizedTypeinfoName (ti_alloc);
536  const IAuxTypeVectorFactory* fac =
537  addFactory (lock, ti, name, std::move(factory));
538  return addFactory (lock, ti, ti_alloc, fac);
539 }

◆ addFactory() [3/4]

const IAuxTypeVectorFactory * SG::AuxTypeRegistry::addFactory ( lock_t ,
const std::type_info &  ti,
const std::string &  ti_alloc_name,
std::unique_ptr< const IAuxTypeVectorFactory factory 
)
private

Add a new type -> factory mapping.

(external locking)

Parameters
lockThe registry lock.
tiType of the vector element.
ti_alloc_nameThe name of the vector allocator type.
factoryThe 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.

623 {
624  std::string key = std::string (ti.name()) + ";" + ti_alloc_name;
625  ti_map_t::const_iterator it = m_factories.find (key);
626  const IAuxTypeVectorFactory* fac = factory.get();
627  if (it != m_factories.end()) {
628  if (it->second->isDynamic() && !factory->isDynamic()) {
629  // Replacing a dynamic factory with a non-dynamic one.
630  // But don't delete the old one, since it might still be referenced.
631  // Instead, push it on a vector to remember it so we can delete
632  // it later.
633  m_oldFactories.push_back (it->second);
634  m_factories.insert_or_assign (key, factory.release());
635  }
636  else {
637  fac = it->second;
638  }
639  }
640  else
641  m_factories.insert_or_assign (key, factory.release());
642 
643  // cppcheck-suppress returnDanglingLifetime; false positive
644  return fac;
645 }

◆ addFactory() [4/4]

const IAuxTypeVectorFactory * SG::AuxTypeRegistry::addFactory ( lock_t lock,
const std::type_info &  ti,
const std::type_info &  ti_alloc,
const IAuxTypeVectorFactory factory 
)
private

Add a new type -> factory mapping.

(external locking)

Parameters
lockThe registry lock.
tiType of the vector element.
ti_allocThe type of the vector allocator
factoryThe 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.

580 {
581  std::string key = std::string (ti.name()) + ";TI;" + ti_alloc.name();
582  ti_map_t::const_iterator it = m_factories.find (key);
583  if (it != m_factories.end()) {
584  if (it->second->isDynamic() && !factory->isDynamic()) {
585  // Replacing a dynamic factory with a non-dynamic one.
586  // The string version should put it to m_oldFactories.
587  m_factories.insert_or_assign (key, factory);
588  }
589  else {
590  factory = it->second;
591  }
592  }
593  else
594  m_factories.insert_or_assign (key, factory);
595 
598  {
599  m_allocMap.insert_or_assign (ti.name(), &ti_alloc);
600  }
601 
602  return factory;
603 }

◆ checkAuxID() [1/2]

template<class T , class ALLOC = AuxAllocator_t<T>>
void SG::AuxTypeRegistry::checkAuxID ( const SG::auxid_t  auxid,
const Flags  flags = Flags::None 
)

Verify type for an aux variable.

Parameters
auxidThe ID of the variable to check.
flagsOptional 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.

◆ checkAuxID() [2/2]

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.

Parameters
auxidThe ID of the variable to check.
tiType of the aux data item.
ti_allocType of the vector allocator.
flagsOptional 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.

181 {
182  typeinfo_t& m = m_types.at (auxid);
183 
184  if ( ! ((&ti == m.m_ti || strcmp(ti.name(), m.m_ti->name()) == 0) &&
185  m.checkAlloc (&ti_alloc, nullptr)))
186  {
187  throw SG::ExcAuxTypeMismatch (auxid, ti, *m.m_ti,
188  SG::normalizedTypeinfoName (ti_alloc),
189  m.m_alloc_name);
190  }
191  if (CxxUtils::test (m.m_flags, Flags::Atomic) &&
193  {
194  throw SG::ExcAtomicMismatch (auxid, ti);
195  }
196 }

◆ checkName()

bool SG::AuxTypeRegistry::checkName ( const std::string &  s)
staticprivate

Check for valid variable name.

Parameters
nameName 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.

930 {
931  static const std::string chars1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
932  static const std::string chars2 = chars1 + "0123456789";
933 
934  if (s.empty()) return false;
935  if (chars1.find (s[0]) == std::string::npos) return false;
936  return s.find_first_not_of (chars2, 1) == std::string::npos;
937 }

◆ clear()

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.

Parameters
auxidThe aux data item being operated on.
dstContainer holding the element
dst_indexIndex of the first element in the vector.
nNumber of elements to clear.

Definition at line 438 of file AuxTypeRegistry.cxx.

441 {
442  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
443  if (factory)
444  factory->clear (auxid, dst, dst_index, n);
445 }

◆ copy() [1/2]

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.

Parameters
auxidThe aux data item being operated on.
dstContainer for the destination vector. Declared as a rvalue reference to allow passing a temporary here (such as from AuxVectorInterface).
dst_indexIndex of the first destination element in the vector.
srcContainer for the source vector.
src_indexIndex of the first source element in the vector.
nNumber of elements to copy.

dst and @ src can be either the same or different.

◆ copy() [2/2]

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.

Parameters
auxidThe aux data item being operated on.
dstContainer for the destination vector.
dst_indexIndex of the first destination element in the vector.
srcContainer for the source vector.
src_indexIndex of the first source element in the vector.
nNumber of elements to copy.

dst and @ src can be either the same or different.

Definition at line 373 of file AuxTypeRegistry.cxx.

377 {
378  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
379  if (factory)
380  factory->copy (auxid, dst, dst_index, src, src_index, n);
381 }

◆ copyForOutput()

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.

Parameters
auxidThe aux data item being operated on.
dstContainer for the destination vector.
dst_indexIndex of the first destination element in the vector.
srcContainer for the source vector.
src_indexIndex of the first source element in the vector.
nNumber of elements to copy.

dst and @ src can be either the same or different.

Definition at line 396 of file AuxTypeRegistry.cxx.

400 {
401  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
402  if (factory) {
403  factory->copyForOutput (auxid, dst, dst_index, src, src_index, n);
404  }
405 }

◆ findAuxID() [1/2]

SG::auxid_t SG::AuxTypeRegistry::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::*)() const  makeFactory 
)
private

Look up a name -> auxid_t mapping.

Parameters
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.
flagsOptional flags qualifying the type. See above.
tiThe type of this aux data item.
ti_allocThe type of the vector allocator.
alloc_nameThe name of the vector allocator. Used only if ti_alloc is null.
makeFactoryFunction 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.

736 {
737 
738  // The extra test here is to avoid having to copy a string
739  // in the common case where clsname is blank.
740  const std::string& key = clsname.empty() ? name : makeKey (name, clsname);
741 
742 
743  // Fast path --- try without acquiring the lock.
744  {
745  id_map_t::const_iterator i = m_auxids.find (key);
746  if (i != m_auxids.end()) {
747  typeinfo_t& m = m_types[i->second];
748  if (!(CxxUtils::test (m.m_flags, Flags::Atomic) &&
750  (&ti == m.m_ti || strcmp(ti.name(), m.m_ti->name()) == 0) &&
751  m.checkAlloc (ti_alloc, alloc_name) &&
752  !(*m.m_factory).isDynamic())
753  {
754  return i->second;
755  }
756  }
757  }
758 
759  // Something went wrong. Acquire the lock and try again.
760  lock_t lock (m_mutex);
761  id_map_t::const_iterator i = m_auxids.find (key);
762  if (i != m_auxids.end()) {
763  typeinfo_t& m = m_types[i->second];
764 
765  if (CxxUtils::test (m.m_flags, Flags::Atomic) &&
767  {
768  throw SG::ExcAtomicMismatch (i->second, ti);
769  }
770 
771  // By all rights, these two tests should be redundant.
772  // However, there are cases where we see distinct @c type_info objects
773  // for the same type. This is usually associated with dictionaries
774  // being loaded `too early,' during python configuration processing.
775  // It's a C++ standard violation for this to ever happen, but it's
776  // not clear that it's feasible to actually eliminate the possibility
777  // of this happening. So if the @c type_info instances differ,
778  // we still accept the match as long as the names are the same.
779  if ((&ti == m.m_ti || strcmp(ti.name(), m.m_ti->name()) == 0) &&
780  m.checkAlloc (ti_alloc, alloc_name))
781  {
782  // Try to upgrade a dynamic factory.
783  if ((*m.m_factory).isDynamic()) {
784  std::unique_ptr<IAuxTypeVectorFactory> fac2 = (*this.*makeFactory)();
785  if (fac2) {
786  if (!ti_alloc) {
787  ti_alloc = fac2->tiAlloc();
788  }
789  std::string allocName = fac2->tiAllocName();
790  m.m_factory = addFactory (lock, ti, allocName, std::move (fac2));
791  if (ti_alloc) {
792  m.m_factory = addFactory (lock, ti, *ti_alloc, m.m_factory);
793  }
794  }
795  }
796  return i->second;
797  }
798  if( *m.m_ti != typeid(SG::AuxTypePlaceholder) ) {
799  throw SG::ExcAuxTypeMismatch (i->second, ti, *m.m_ti,
800  ti_alloc ? SG::normalizedTypeinfoName (*ti_alloc) : (alloc_name ? *alloc_name : ""),
801  m.m_alloc_name);
802  }
803  // fall through, get a new auxid and real type info
804  // new auxid needed so a new data vector is created in the AuxStore
805  }
806 
807  // Verify now that the variable names are ok.
808  if (!(flags & Flags::SkipNameCheck) &&
809  (!checkName (name) ||
810  (!clsname.empty() && !checkName (clsname))))
811  {
812  throw ExcBadVarName (key);
813  }
814 
815  const IAuxTypeVectorFactory* fac = nullptr;
816  if (ti_alloc) {
817  fac = getFactory (lock, ti, *ti_alloc);
818  }
819  else if (alloc_name) {
820  fac = getFactory (ti, *alloc_name);
821  }
822  else {
823  std::string def_alloc_name = SG::auxAllocatorNamePrefix + SG::normalizedTypeinfoName (ti);
824  if (def_alloc_name[def_alloc_name.size()-1] == '>') def_alloc_name += " ";
825  def_alloc_name += ">";
826  fac = getFactory (ti,def_alloc_name);
827  }
828 
829  if (!fac || fac->isDynamic()) {
830  std::unique_ptr<IAuxTypeVectorFactory> fac2 = (*this.*makeFactory)();
831  if (fac2) {
832  if (!ti_alloc) {
833  ti_alloc = fac2->tiAlloc();
834  }
835  std::string allocName = fac2->tiAllocName();
836  fac = addFactory (lock, ti, allocName, std::move (fac2));
837  if (ti_alloc) {
838  fac = addFactory (lock, ti, *ti_alloc, fac);
839  }
840  }
841  }
842  if (!fac) return null_auxid;
843  if (!ti_alloc) ti_alloc = fac->tiAlloc();
844  SG::auxid_t auxid = m_types.size();
845  m_types.resize (auxid+1);
846  typeinfo_t& t = m_types[auxid];
847  t.m_name = name;
848  t.m_clsname = clsname;
849  t.m_ti = &ti;
850  t.m_ti_alloc = ti_alloc;
851  t.m_alloc_name = fac->tiAllocName();
852  t.m_factory = fac;
853  t.m_flags = (flags & ~Flags::SkipNameCheck);
855  m_auxids.insert_or_assign (key, auxid);
856 
857  return auxid;
858 }

◆ findAuxID() [2/2]

SG::auxid_t SG::AuxTypeRegistry::findAuxID ( const std::string &  name,
const std::string &  clsname = "" 
) const

Look up a name -> auxid_t mapping.

Parameters
nameThe name of the aux data item.
clsnameThe 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.

152 {
153  // No locking needed here.
154  // The extra test here is to avoid having to copy a string
155  // in the common case where clsname is blank.
156  id_map_t::const_iterator i = m_auxids.find (clsname.empty() ?
157  name :
158  makeKey (name, clsname));
159  if (i != m_auxids.end()) {
160  return i->second;
161  }
162  return null_auxid;
163 }

◆ getAllocType()

const std::type_info * SG::AuxTypeRegistry::getAllocType ( SG::auxid_t  auxid) const

Return the type of the vector allocator.

Parameters
auxidThe desired aux data item.

Definition at line 341 of file AuxTypeRegistry.cxx.

342 {
343  if (auxid >= m_types.size())
344  return 0;
345  return m_types[auxid].m_ti_alloc;
346 }

◆ getAuxID() [1/4]

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.

Parameters
alloc_nameName of the vector allocator type.
tiType of the aux data item.
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.
flagsOptional 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.

134 {
135  return findAuxID (name, clsname, flags, ti, nullptr, &alloc_type,
137 }

◆ getAuxID() [2/4]

template<class T , class ALLOC = AuxAllocator_t<T>>
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.

Parameters
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.
flagsOptional 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.

◆ getAuxID() [3/4]

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.

Parameters
tiType of the aux data item.
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.
flagsOptional 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.

84 {
85  return findAuxID (name, clsname, flags, ti, nullptr, nullptr,
87 }

◆ getAuxID() [4/4]

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.

Parameters
ti_allocType of the vector allocator.
tiType of the aux data item.
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.
flagsOptional 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.

109 {
110  return findAuxID (name, clsname, flags, ti, &ti_alloc, nullptr,
112 }

◆ getClassName()

std::string SG::AuxTypeRegistry::getClassName ( SG::auxid_t  auxid) const

Return the class name associated with an aux data item (may be blank).

Parameters
auxidThe desired aux data item.

Definition at line 275 of file AuxTypeRegistry.cxx.

276 {
277  if (auxid >= m_types.size())
278  return "";
279  return m_types[auxid].m_clsname;
280 }

◆ getEltSize()

size_t SG::AuxTypeRegistry::getEltSize ( SG::auxid_t  auxid) const

Return size of an element in the STL vector.

Parameters
auxidThe desired aux data item.

Definition at line 353 of file AuxTypeRegistry.cxx.

354 {
355  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
356  if (factory)
357  return factory->getEltSize();
358  return 0;
359 }

◆ getFactory() [1/4]

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.

Parameters
tiThe type of the vector element.
alloc_nameThe 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.

507 {
508  std::string key = std::string (ti.name()) + ";" + alloc_name;
509  ti_map_t::const_iterator it = m_factories.find (key);
510  if (it != m_factories.end()) {
511  return it->second;
512  }
513 
514  return nullptr;
515 }

◆ getFactory() [2/4]

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.

Parameters
tiThe type of the vector element.
ti_allocThe type of the vector allocator.

Returns nullptr if the type is not known. (Use addFactory to add new mappings.)

Parameters
tiThe type of the vector element.
ti_allocThe 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.

459 {
460  lock_t lock (m_mutex);
461  return getFactory (lock, ti, ti_alloc);
462 }

◆ getFactory() [3/4]

const IAuxTypeVectorFactory * SG::AuxTypeRegistry::getFactory ( lock_t lock,
const std::type_info &  ti,
const std::type_info &  ti_alloc 
)
private

Return the vector factory for a given vector element type.

(External locking.)

Parameters
lockThe registry lock.
tiThe type of the vector element.
ti_allocThe 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.

479 {
480  std::string key = std::string (ti.name()) + ";TI;" + ti_alloc.name();
481  ti_map_t::const_iterator it = m_factories.find (key);
482  if (it != m_factories.end())
483  return it->second;
484 
485  std::string name = SG::normalizedTypeinfoName (ti_alloc);
486  const IAuxTypeVectorFactory* fac = getFactory (ti, name);
487  if (fac) {
488  // We only really need to be holding the lock here, but doing things
489  // otherwise would require some code duplication.
490  addFactory (lock, ti, ti_alloc, fac);
491  }
492  return fac;
493 }

◆ getFactory() [4/4]

const IAuxTypeVectorFactory* SG::AuxTypeRegistry::getFactory ( SG::auxid_t  auxid) const

Return the vector factory for a given auxid.

Parameters
auxidThe desired aux data item.

Returns nullptr if the type is not known. (Use addFactory to add new mappings.)

◆ getFlags()

Flags SG::AuxTypeRegistry::getFlags ( SG::auxid_t  auxid) const

Return flags associated with an auxiliary variable.

Parameters
auxidThe desired aux data item.

◆ getName()

std::string SG::AuxTypeRegistry::getName ( SG::auxid_t  auxid) const

Return the name of an aux data item.

Parameters
auxidThe desired aux data item.

Definition at line 262 of file AuxTypeRegistry.cxx.

263 {
264  if (auxid >= m_types.size())
265  return "";
266  return m_types[auxid].m_name;
267 }

◆ getType()

const std::type_info * SG::AuxTypeRegistry::getType ( SG::auxid_t  auxid) const

Return the type of an aux data item.

Parameters
auxidThe desired aux data item.

Definition at line 287 of file AuxTypeRegistry.cxx.

288 {
289  if (auxid >= m_types.size())
290  return 0;
291  return m_types[auxid].m_ti;
292 }

◆ getTypeName()

std::string SG::AuxTypeRegistry::getTypeName ( SG::auxid_t  auxid) const

Return the type name of an aux data item.

Parameters
auxidThe desired aux data item.

Returns an empty string if the type is not known.

Definition at line 301 of file AuxTypeRegistry.cxx.

302 {
303  if (auxid >= m_types.size())
304  return "";
305  return normalizedTypeinfoName (*m_types[auxid].m_ti);
306 }

◆ getVecType()

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.

Parameters
auxidThe desired aux data item.

Definition at line 313 of file AuxTypeRegistry.cxx.

314 {
315  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
316  if (factory)
317  return factory->tiVec();
318  return 0;
319 }

◆ getVecTypeName()

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.

Parameters
auxidThe desired aux data item.

Returns an empty string if the type is not known.

Definition at line 328 of file AuxTypeRegistry.cxx.

329 {
330  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
331  if (factory)
332  return normalizedTypeinfoName (*factory->tiVec());
333  return "";
334 }

◆ inputRename()

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.

Returns
The variable name to use in the transient representation. Will usually be name, but may be different if there was a renaming request.

Definition at line 907 of file AuxTypeRegistry.cxx.

909 {
910  lock_t lock (m_mutex);
911  if (m_renameMap.empty())
912  return name;
913 
914  std::string fullkey = key + "." + name;
915  renameMap_t::const_iterator it = m_renameMap.find (fullkey);
916  if (it != m_renameMap.end())
917  return it->second;
918  return name;
919 }

◆ instance()

AuxTypeRegistry & SG::AuxTypeRegistry::instance ( )
static

Return the singleton registry instance.

Definition at line 49 of file AuxTypeRegistry.cxx.

50 {
51  static AuxTypeRegistry auxTypeRegistry ATLAS_THREAD_SAFE;
52  return auxTypeRegistry;
53 }

◆ makeFactory()

template<class T , class ALLOC = AuxAllocator_t<T>>
std::unique_ptr<IAuxTypeVectorFactory> SG::AuxTypeRegistry::makeFactory ( ) const
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.

◆ makeFactoryNull()

std::unique_ptr<IAuxTypeVectorFactory> SG::AuxTypeRegistry::makeFactoryNull ( ) const
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.

◆ makeKey()

std::string SG::AuxTypeRegistry::makeKey ( const std::string &  name,
const std::string &  clsname 
)
staticprivate

Return the key used to look up an entry in m_auxids.

Parameters
nameThe name of the aux data item.
clsnameThe name of its associated class. May be blank.

Definition at line 247 of file AuxTypeRegistry.cxx.

249 {
250  if (clsname.empty()) {
251  return name;
252  }
253  return clsname + "::" + name;
254 }

◆ makeVector()

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.

Parameters
auxidThe desired aux data item.
sizeInitial size of the new vector.
capacityInitial capacity of the new vector.

Returns a newly-allocated object.

Parameters
auxidThe desired aux data item.
sizeInitial size of the new vector.
capacityInitial capacity of the new vector.

Definition at line 206 of file AuxTypeRegistry.cxx.

209 {
210  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
211  assert (factory != 0);
212  return factory->create (auxid, size, capacity);
213 }

◆ makeVectorFromData()

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.

Parameters
dataThe vector object.
isPackedIf true, data is a PackedContainer.
ownFlagIf 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.

235 {
236  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
237  assert (factory != 0);
238  return factory->createFromData (auxid, data, isPacked, ownMode);
239 }

◆ numVariables()

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.

62 {
63  return m_types.size();
64 }

◆ operator=()

AuxTypeRegistry& SG::AuxTypeRegistry::operator= ( const AuxTypeRegistry )
private

◆ setInputRenameMap()

void SG::AuxTypeRegistry::setInputRenameMap ( const Athena::IInputRename::InputRenameMap_t map,
const IStringPool pool 
)

Declare input renaming requests.

Parameters
mapMap of (hashed) sgkey -> sgkey for renaming requests.
poolString 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.

875 {
876  lock_t lock (m_mutex);
877  m_renameMap.clear();
878  if (!map) return;
879  for (const auto& p : *map) {
880  sgkey_t from_sgkey = p.first;
881  sgkey_t to_sgkey = p.second.m_sgkey;
882 
883  const std::string* from_str = pool.keyToString (from_sgkey);
884  if (!from_str) continue;
885  std::string::size_type from_dpos = from_str->find (".");
886  if (from_dpos == std::string::npos || from_dpos == from_str->size()-1) continue;
887 
888  const std::string* to_str = pool.keyToString (to_sgkey);
889  if (!to_str) continue;
890  std::string::size_type to_dpos = to_str->find (".");
891  if (to_dpos == std::string::npos || to_dpos == to_str->size()-1) continue;
892 
893  m_renameMap[*from_str] = to_str->substr (to_dpos+1, std::string::npos);
894  }
895 }

◆ swap()

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.

Parameters
auxidThe aux data item being operated on.
aContainer for the first vector.
aindexIndex of the first element in the first vector.
bContainer for the second vector.
bindexIndex of the first element in the second vector.
nNumber 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.

424 {
425  const SG::IAuxTypeVectorFactory* factory = getFactory (auxid);
426  if (factory)
427  factory->swap (auxid, a, aindex, b, bindex, n);
428 }

Member Data Documentation

◆ m_allocMap

allocMap_t SG::AuxTypeRegistry::m_allocMap
private

Definition at line 702 of file AuxTypeRegistry.h.

◆ m_auxids

id_map_t SG::AuxTypeRegistry::m_auxids
private

Definition at line 676 of file AuxTypeRegistry.h.

◆ m_factories

ti_map_t SG::AuxTypeRegistry::m_factories
private

Definition at line 680 of file AuxTypeRegistry.h.

◆ m_mutex

mutex_t SG::AuxTypeRegistry::m_mutex
mutableprivate

Mutex controlling access to the registry.

Definition at line 696 of file AuxTypeRegistry.h.

◆ m_oldFactories

std::vector<const IAuxTypeVectorFactory*> SG::AuxTypeRegistry::m_oldFactories
private

Hold additional factory instances we need to delete.

Definition at line 683 of file AuxTypeRegistry.h.

◆ m_renameMap

renameMap_t SG::AuxTypeRegistry::m_renameMap
private

Definition at line 688 of file AuxTypeRegistry.h.

◆ m_types

AthContainers_detail::concurrent_vector<typeinfo_t> SG::AuxTypeRegistry::m_types
private

Table of aux data items, indexed by auxid.

Definition at line 671 of file AuxTypeRegistry.h.


The documentation for this class was generated from the following files:
SG::AuxTypeRegistry::getFactory
const IAuxTypeVectorFactory * getFactory(const std::type_info &ti, const std::type_info &ti_alloc)
Return the vector factory for a given vector element type.
Definition: AuxTypeRegistry.cxx:457
SG::AuxTypeRegistry::m_allocMap
allocMap_t m_allocMap
Definition: AuxTypeRegistry.h:702
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
SG::AuxTypeRegistry::addFactory
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.
Definition: AuxTypeRegistry.cxx:530
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::AuxTypeRegistry::m_oldFactories
std::vector< const IAuxTypeVectorFactory * > m_oldFactories
Hold additional factory instances we need to delete.
Definition: AuxTypeRegistry.h:683
SG::SkipNameCheck
@ SkipNameCheck
Definition: AuxTypes.h:74
SG::IAuxTypeVectorFactory::getEltSize
virtual size_t getEltSize() const =0
Return the size of an element of this vector type.
SG::AuxTypeRegistry::findAuxID
SG::auxid_t findAuxID(const std::string &name, const std::string &clsname="") const
Look up a name -> auxid_t mapping.
Definition: AuxTypeRegistry.cxx:150
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
SG::normalizedTypeinfoName
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
Definition: normalizedTypeinfoName.cxx:120
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
SG::AuxTypeRegistry::lock_t
AthContainers_detail::lock_guard< mutex_t > lock_t
Definition: AuxTypeRegistry.h:488
SG::AuxTypeRegistry::makeKey
static std::string makeKey(const std::string &name, const std::string &clsname)
Return the key used to look up an entry in m_auxids.
Definition: AuxTypeRegistry.cxx:247
pool
pool namespace
Definition: libname.h:15
skel.it
it
Definition: skel.GENtoEVGEN.py:424
SG::IAuxTypeVectorFactory::clear
virtual void clear(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, size_t n) const =0
Clear a range of elements within a vector.
SG::IAuxTypeVectorFactory::create
virtual std::unique_ptr< IAuxTypeVector > create(SG::auxid_t auxid, size_t size, size_t capacity) const =0
Create a vector object of this type.
ADD_FACTORY
#define ADD_FACTORY(T)
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::AuxTypeRegistry::m_types
AthContainers_detail::concurrent_vector< typeinfo_t > m_types
Table of aux data items, indexed by auxid.
Definition: AuxTypeRegistry.h:671
SG::AuxTypeRegistry::AuxTypeRegistry
AuxTypeRegistry()
Constructor.
Definition: AuxTypeRegistry.cxx:653
AthContainers_detail::fence_seq_cst
void fence_seq_cst()
A sequentially-consistent fence.
SG::IAuxTypeVectorFactory::swap
virtual void swap(SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const =0
Swap elements between vectors.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeRegistry::m_factories
ti_map_t m_factories
Definition: AuxTypeRegistry.h:680
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
SG::IAuxTypeVectorFactory
Interface for factory objects that create vectors.
Definition: IAuxTypeVectorFactory.h:50
SG::IAuxTypeVectorFactory::copyForOutput
virtual void copyForOutput(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
Copy elements between vectors, possibly applying thinning.
SG::AuxTypeRegistry::makeFactory
std::unique_ptr< IAuxTypeVectorFactory > makeFactory() const
Create an AuxTypeVectorFactory instance.
SG::AuxTypePlaceholder
Used as type_info when we read an aux data item but it doesn't exist in the registry.
Definition: AuxTypes.h:34
SG::IAuxTypeVectorFactory::copy
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
Copy elements between vectors.
CxxUtils::test
constexpr std::enable_if_t< is_bitmask_v< E >, bool > test(E lhs, E rhs)
Convenience function to test bits in a class enum bitmask.
Definition: bitmask.h:262
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
SG::AuxTypeRegistry::Flags
SG::AuxVarFlags Flags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypeRegistry.h:66
SG::IAuxTypeVectorFactory::tiVec
virtual const std::type_info * tiVec() const =0
Return the type_info of the vector.
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
SG::AuxTypeRegistry::m_mutex
mutex_t m_mutex
Mutex controlling access to the registry.
Definition: AuxTypeRegistry.h:696
SG::Atomic
@ Atomic
Mark that this variable should only be accessed atomically.
Definition: AuxTypes.h:70
SG::AuxTypeRegistry::checkName
static bool checkName(const std::string &s)
Check for valid variable name.
Definition: AuxTypeRegistry.cxx:929
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::AuxTypeRegistry::makeFactoryNull
std::unique_ptr< IAuxTypeVectorFactory > makeFactoryNull() const
makeFactory implementation that always returns nullptr.
SG::IAuxTypeVectorFactory::createFromData
virtual std::unique_ptr< IAuxTypeVector > createFromData(SG::auxid_t auxid, void *data, bool isPacked, bool ownFlag) const =0
Create a vector object of this type from a data blob.
SG::ExcAtomicMismatch
Exception — Non-atomic access to atomic aux variable.
Definition: Control/AthContainers/AthContainers/exceptions.h:376
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
SG::ExcAuxTypeMismatch
Exception — Type mismatch for aux variable.
Definition: Control/AthContainers/AthContainers/exceptions.h:132
SG::AuxTypeRegistry::m_renameMap
renameMap_t m_renameMap
Definition: AuxTypeRegistry.h:688
SG::auxAllocatorNamePrefix
constexpr const char * auxAllocatorNamePrefix
Definition: AuxDataTraits.h:29
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
SG::AuxTypeRegistry::m_auxids
id_map_t m_auxids
Definition: AuxTypeRegistry.h:676