ATLAS Offline Software
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SG::BaseInfoBaseImpl Struct Reference
Collaboration diagram for SG::BaseInfoBaseImpl:

Classes

struct  Deleter
 
struct  info
 Structure to hold information about one base. More...
 

Public Types

typedef std::pair< const std::type_info *, infoti_map_pair_type
 Hold base information indexed by type_info. More...
 
typedef std::vector< ti_map_pair_typeti_map_type
 
typedef std::pair< const std::type_info *, const CopyConversionBase * > ti_copyconversion_pair_type
 Hold copy conversion information indexed by @ type_info. More...
 
typedef std::vector< ti_copyconversion_pair_typeti_copyconversion_type
 
typedef std::unordered_map< const std::type_info *, BaseInfoBase * > bi_by_ti_map_type
 Map of all type_info pointers to BaseInfoBase instances. More...
 
typedef std::unordered_map< std::string, const std::type_info * > ti_by_name_map_type
 Used to canonicalize type_info instances. More...
 
typedef std::unordered_multimap< const std::type_info *, BaseInfoBase::init_func_t * > init_list_t
 Holds BaseInfo classes awaiting initialization. More...
 
typedef std::mutex mutex_t
 For thread-safety. More...
 
typedef std::lock_guard< mutex_tlock_t
 

Public Member Functions

const infofindInfo (const std::type_info &tinfo) const
 Find a base by type_info. More...
 

Public Attributes

CLID m_clid
 CLID of this class. More...
 
bool m_needs_init
 Set to true when first created. More...
 
const std::type_info * m_typeinfo
 std::type_info of this class. More...
 
ti_map_type m_timap
 
ti_copyconversion_type m_ti_copyconversion_map
 
mutex_t m_mutex
 
CxxUtils::CachedValue< std::vector< CLID > > m_bases
 CLIDs of known bases, including the class itself. More...
 

Static Public Attributes

static bi_by_ti_map_type *s_bi_by_ti ATLAS_THREAD_SAFE
 
static ti_by_name_map_type *s_ti_by_name ATLAS_THREAD_SAFE
 
static init_list_t *s_init_list ATLAS_THREAD_SAFE
 
static Deleter s_deleter
 
static mutex_t s_mutex ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 29 of file BaseInfo.cxx.

Member Typedef Documentation

◆ bi_by_ti_map_type

typedef std::unordered_map<const std::type_info*, BaseInfoBase*> SG::BaseInfoBaseImpl::bi_by_ti_map_type

Map of all type_info pointers to BaseInfoBase instances.

Definition at line 77 of file BaseInfo.cxx.

◆ init_list_t

typedef std::unordered_multimap<const std::type_info*, BaseInfoBase::init_func_t*> SG::BaseInfoBaseImpl::init_list_t

Holds BaseInfo classes awaiting initialization.

This is used to defer initialization until everything's loaded.

Definition at line 89 of file BaseInfo.cxx.

◆ lock_t

typedef std::lock_guard<mutex_t> SG::BaseInfoBaseImpl::lock_t

Definition at line 101 of file BaseInfo.cxx.

◆ mutex_t

typedef std::mutex SG::BaseInfoBaseImpl::mutex_t

For thread-safety.

Definition at line 100 of file BaseInfo.cxx.

◆ ti_by_name_map_type

typedef std::unordered_map<std::string, const std::type_info*> SG::BaseInfoBaseImpl::ti_by_name_map_type

Used to canonicalize type_info instances.

Definition at line 82 of file BaseInfo.cxx.

◆ ti_copyconversion_pair_type

Hold copy conversion information indexed by @ type_info.

Definition at line 71 of file BaseInfo.cxx.

◆ ti_copyconversion_type

Definition at line 72 of file BaseInfo.cxx.

◆ ti_map_pair_type

typedef std::pair<const std::type_info*, info> SG::BaseInfoBaseImpl::ti_map_pair_type

Hold base information indexed by type_info.

Definition at line 64 of file BaseInfo.cxx.

◆ ti_map_type

Definition at line 65 of file BaseInfo.cxx.

Member Function Documentation

◆ findInfo()

const info* SG::BaseInfoBaseImpl::findInfo ( const std::type_info &  tinfo) const
inline

Find a base by type_info.

Parameters
tinfoThe type_info to find.

Returns the info pointer for the base corresponding to info, or nullptr if there is no match.

Definition at line 118 of file BaseInfo.cxx.

119  {
120  // We don't expect there to be many entries, so just use a linear search.
121  for (const auto& i : m_timap) {
122  if (i.first == &tinfo)
123  return &i.second;
124  }
125 
126  // Sometimes type_info's are not actually unique, depending on how libraries
127  // get loaded. Try again, comparing names.
128  for (const auto& i : m_timap) {
129  if (strcmp (i.first->name(), tinfo.name()) == 0)
130  return &i.second;
131  }
132  return nullptr;
133  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/4]

bi_by_ti_map_type* s_bi_by_ti SG::BaseInfoBaseImpl::ATLAS_THREAD_SAFE
static

Definition at line 78 of file BaseInfo.cxx.

◆ ATLAS_THREAD_SAFE [2/4]

ti_by_name_map_type* s_ti_by_name SG::BaseInfoBaseImpl::ATLAS_THREAD_SAFE
static

Definition at line 83 of file BaseInfo.cxx.

◆ ATLAS_THREAD_SAFE [3/4]

init_list_t* s_init_list SG::BaseInfoBaseImpl::ATLAS_THREAD_SAFE
static

Definition at line 90 of file BaseInfo.cxx.

◆ ATLAS_THREAD_SAFE [4/4]

mutex_t s_mutex SG::BaseInfoBaseImpl::ATLAS_THREAD_SAFE
static

Definition at line 102 of file BaseInfo.cxx.

◆ m_bases

CxxUtils::CachedValue<std::vector<CLID> > SG::BaseInfoBaseImpl::m_bases

CLIDs of known bases, including the class itself.

This can be read without acquiring the mutex.

Definition at line 108 of file BaseInfo.cxx.

◆ m_clid

CLID SG::BaseInfoBaseImpl::m_clid

CLID of this class.

Definition at line 53 of file BaseInfo.cxx.

◆ m_mutex

mutex_t SG::BaseInfoBaseImpl::m_mutex
mutable

Definition at line 103 of file BaseInfo.cxx.

◆ m_needs_init

bool SG::BaseInfoBaseImpl::m_needs_init

Set to true when first created.

Reset after we scan for init functions.

Definition at line 57 of file BaseInfo.cxx.

◆ m_ti_copyconversion_map

ti_copyconversion_type SG::BaseInfoBaseImpl::m_ti_copyconversion_map

Definition at line 73 of file BaseInfo.cxx.

◆ m_timap

ti_map_type SG::BaseInfoBaseImpl::m_timap

Definition at line 66 of file BaseInfo.cxx.

◆ m_typeinfo

const std::type_info* SG::BaseInfoBaseImpl::m_typeinfo

std::type_info of this class.

Definition at line 60 of file BaseInfo.cxx.

◆ s_deleter

BaseInfoBaseImpl::Deleter SG::BaseInfoBaseImpl::s_deleter
static

Definition at line 97 of file BaseInfo.cxx.


The documentation for this struct was generated from the following file:
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::BaseInfoBaseImpl::m_timap
ti_map_type m_timap
Definition: BaseInfo.cxx:66