ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
CLIDRegistryImpl Class Reference
Collaboration diagram for CLIDRegistryImpl:

Public Member Functions

bool hasNewEntries () const
 
CLIDRegistry::CLIDVector_t newEntries ()
 
const std::type_info * CLIDToTypeinfo (CLID clid) const
 Return the type_info corresponding to a CLID. More...
 
CLID typeinfoToCLID (const std::type_info &ti) const
 Return the CLID corresponding to a type_info. More...
 
bool addEntry (unsigned long clid, const std::type_info &ti, const char *typeName, const std::string &typeInfoName)
 

Private Types

typedef std::mutex mutex_t
 
typedef std::lock_guard< mutex_tlock_t
 
typedef std::unordered_map< CLID, const std::type_info * > clid_ti_map_t
 
typedef std::unordered_map< const std::type_info *, CLIDti_clid_map_t
 

Private Attributes

mutex_t m_mutex
 
CLIDRegistry::CLIDVector_t m_vec
 
size_t m_alreadyDone = 0
 
clid_ti_map_t m_clid_ti_map
 
ti_clid_map_t m_ti_clid_map
 

Detailed Description

Definition at line 11 of file CLIDRegistry.cxx.

Member Typedef Documentation

◆ clid_ti_map_t

typedef std::unordered_map<CLID, const std::type_info*> CLIDRegistryImpl::clid_ti_map_t
private

Definition at line 35 of file CLIDRegistry.cxx.

◆ lock_t

typedef std::lock_guard<mutex_t> CLIDRegistryImpl::lock_t
private

Definition at line 29 of file CLIDRegistry.cxx.

◆ mutex_t

typedef std::mutex CLIDRegistryImpl::mutex_t
private

Definition at line 28 of file CLIDRegistry.cxx.

◆ ti_clid_map_t

typedef std::unordered_map<const std::type_info*, CLID> CLIDRegistryImpl::ti_clid_map_t
private

Definition at line 38 of file CLIDRegistry.cxx.

Member Function Documentation

◆ addEntry()

bool CLIDRegistryImpl::addEntry ( unsigned long  clid,
const std::type_info &  ti,
const char *  typeName,
const std::string &  typeInfoName 
)

Definition at line 94 of file CLIDRegistry.cxx.

98 {
99  lock_t lock (m_mutex);
100  m_vec.emplace_back (clid, std::string(typeName), typeInfoName);
101  m_clid_ti_map[clid] = &ti;
102  m_ti_clid_map[&ti] = clid;
103  return true;
104 }

◆ CLIDToTypeinfo()

const std::type_info * CLIDRegistryImpl::CLIDToTypeinfo ( CLID  clid) const

Return the type_info corresponding to a CLID.

Parameters
clidThe CLID to find.

Returns the corresponding type_info or nullptr.

Definition at line 66 of file CLIDRegistry.cxx.

67 {
68  lock_t lock (m_mutex);
69  auto i = m_clid_ti_map.find (clid);
70  if (i != m_clid_ti_map.end()) {
71  return i->second;
72  }
73  return nullptr;
74 }

◆ hasNewEntries()

bool CLIDRegistryImpl::hasNewEntries ( ) const

Definition at line 43 of file CLIDRegistry.cxx.

44 {
45  lock_t lock (m_mutex);
46  return m_alreadyDone < m_vec.size();
47 }

◆ newEntries()

CLIDRegistry::CLIDVector_t CLIDRegistryImpl::newEntries ( )

Definition at line 51 of file CLIDRegistry.cxx.

52 {
53  lock_t lock (m_mutex);
54  size_t pos = m_alreadyDone;
55  m_alreadyDone = m_vec.size();
56  return CLIDRegistry::CLIDVector_t (m_vec.begin()+pos, m_vec.end());
57 }

◆ typeinfoToCLID()

CLID CLIDRegistryImpl::typeinfoToCLID ( const std::type_info &  ti) const

Return the CLID corresponding to a type_info.

Parameters
tiThe type_info to find.

Returns the corresponding CLID or CLID_NULL.

Definition at line 83 of file CLIDRegistry.cxx.

84 {
85  lock_t lock (m_mutex);
86  auto i = m_ti_clid_map.find (&ti);
87  if (i != m_ti_clid_map.end()) {
88  return i->second;
89  }
90  return CLID_NULL;
91 }

Member Data Documentation

◆ m_alreadyDone

size_t CLIDRegistryImpl::m_alreadyDone = 0
private

Definition at line 33 of file CLIDRegistry.cxx.

◆ m_clid_ti_map

clid_ti_map_t CLIDRegistryImpl::m_clid_ti_map
private

Definition at line 36 of file CLIDRegistry.cxx.

◆ m_mutex

mutex_t CLIDRegistryImpl::m_mutex
mutableprivate

Definition at line 30 of file CLIDRegistry.cxx.

◆ m_ti_clid_map

ti_clid_map_t CLIDRegistryImpl::m_ti_clid_map
private

Definition at line 39 of file CLIDRegistry.cxx.

◆ m_vec

CLIDRegistry::CLIDVector_t CLIDRegistryImpl::m_vec
private

Definition at line 32 of file CLIDRegistry.cxx.


The documentation for this class was generated from the following file:
CLIDRegistryImpl::m_vec
CLIDRegistry::CLIDVector_t m_vec
Definition: CLIDRegistry.cxx:32
CLIDRegistryImpl::m_alreadyDone
size_t m_alreadyDone
Definition: CLIDRegistry.cxx:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CLIDRegistryImpl::lock_t
std::lock_guard< mutex_t > lock_t
Definition: CLIDRegistry.cxx:29
CLIDRegistryImpl::m_ti_clid_map
ti_clid_map_t m_ti_clid_map
Definition: CLIDRegistry.cxx:39
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
CLIDRegistryImpl::m_clid_ti_map
clid_ti_map_t m_clid_ti_map
Definition: CLIDRegistry.cxx:36
CLIDRegistryImpl::m_mutex
mutex_t m_mutex
Definition: CLIDRegistry.cxx:30
CLIDRegistry::CLIDVector_t
std::vector< tuple_t > CLIDVector_t
Definition: CLIDRegistry.h:40