ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | List of all members
TPConverterTypeMap< CONVERTER_BASE > Class Template Reference

class TPConverterTypeMap Converter registry template: a map from type_info to the appropriate converter. More...

#include <ITPConverter.h>

Collaboration diagram for TPConverterTypeMap< CONVERTER_BASE >:

Public Types

typedef std::map< const std::type_index, CONVERTER_BASE * > TId_Map_t
 
typedef TId_Map_t::iterator iterator
 

Public Member Functions

 TPConverterTypeMap ()
 
CONVERTER_BASE * findConverter (const std::type_info &objTypeInfo) const
 Find converter for a given C++ type info. More...
 
void addConverter (CONVERTER_BASE *converter, const std::type_info &objTypeInfo)
 Add a new converter to the map. More...
 
iterator begin ()
 
iterator end ()
 

Protected Attributes

TId_Map_t m_cnvRegistry
 map of the converters, indexed by type_index More...
 

Detailed Description

template<class CONVERTER_BASE>
class TPConverterTypeMap< CONVERTER_BASE >

class TPConverterTypeMap Converter registry template: a map from type_info to the appropriate converter.

Ttemplated for different converter interfaces.

Definition at line 112 of file TPTools/TPTools/ITPConverter.h.

Member Typedef Documentation

◆ iterator

template<class CONVERTER_BASE >
typedef TId_Map_t::iterator TPConverterTypeMap< CONVERTER_BASE >::iterator

Definition at line 115 of file TPTools/TPTools/ITPConverter.h.

◆ TId_Map_t

template<class CONVERTER_BASE >
typedef std::map<const std::type_index, CONVERTER_BASE*> TPConverterTypeMap< CONVERTER_BASE >::TId_Map_t

Definition at line 114 of file TPTools/TPTools/ITPConverter.h.

Constructor & Destructor Documentation

◆ TPConverterTypeMap()

template<class CONVERTER_BASE >
TPConverterTypeMap< CONVERTER_BASE >::TPConverterTypeMap ( )
inline

Definition at line 117 of file TPTools/TPTools/ITPConverter.h.

117 {}

Member Function Documentation

◆ addConverter()

template<class CONVERTER_BASE >
void TPConverterTypeMap< CONVERTER_BASE >::addConverter ( CONVERTER_BASE *  converter,
const std::type_info &  objTypeInfo 
)
inline

Add a new converter to the map.

Parameters
converter[IN] the converter to be added
objTypeInfo[IN] C++ type id of the type the converter is for

Definition at line 162 of file TPTools/TPTools/ITPConverter.h.

163 {
164  m_cnvRegistry[std::type_index(objTypeInfo)] = converter;
165 }

◆ begin()

template<class CONVERTER_BASE >
iterator TPConverterTypeMap< CONVERTER_BASE >::begin ( )
inline
Returns
map iterator to the beginning of the converter list

Definition at line 133 of file TPTools/TPTools/ITPConverter.h.

133 { return m_cnvRegistry.begin(); }

◆ end()

template<class CONVERTER_BASE >
iterator TPConverterTypeMap< CONVERTER_BASE >::end ( )
inline
Returns
map iterator to the end of the converter list

Definition at line 136 of file TPTools/TPTools/ITPConverter.h.

136 { return m_cnvRegistry.end(); }

◆ findConverter()

template<class CONVERTER_BASE >
CONVERTER_BASE * TPConverterTypeMap< CONVERTER_BASE >::findConverter ( const std::type_info &  objTypeInfo) const
inline

Find converter for a given C++ type info.

Parameters
objTypeInfo[IN] C++ type info
Returns
pointer to the located converter

Definition at line 150 of file TPTools/TPTools/ITPConverter.h.

151 {
152  typename TId_Map_t::const_iterator iter = m_cnvRegistry.find( std::type_index(objTypeInfo) );
153  return (iter == m_cnvRegistry.end())?
154  0 : iter->second;
155 }

Member Data Documentation

◆ m_cnvRegistry

template<class CONVERTER_BASE >
TId_Map_t TPConverterTypeMap< CONVERTER_BASE >::m_cnvRegistry
protected

map of the converters, indexed by type_index

Definition at line 139 of file TPTools/TPTools/ITPConverter.h.


The documentation for this class was generated from the following file:
TPConverterTypeMap::m_cnvRegistry
TId_Map_t m_cnvRegistry
map of the converters, indexed by type_index
Definition: TPTools/TPTools/ITPConverter.h:139