CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
StringToEnumParser< T > Class Template Reference

#include <HcalTopologyMode.h>

Public Member Functions

T parseString (const std::string &value)
 
T parseString (const std::string &value)
 
template<>
 StringToEnumParser ()
 
template<>
 StringToEnumParser ()
 
template<>
 StringToEnumParser ()
 
 StringToEnumParser (void)
 
 StringToEnumParser (void)
 

Private Attributes

std::map< std::string, TenumMap
 

Detailed Description

template<typename T>
class StringToEnumParser< T >

Definition at line 10 of file HcalTopologyMode.h.

Constructor & Destructor Documentation

template<typename T>
StringToEnumParser< T >::StringToEnumParser ( void  )
template<typename T>
StringToEnumParser< T >::StringToEnumParser ( void  )

Definition at line 4 of file HcalTopologyMode.cc.

References HcalTopologyMode::H2, HcalTopologyMode::H2HE, HcalTopologyMode::LHC, and HcalTopologyMode::SLHC.

4  {
5  enumMap["HcalTopologyMode::LHC"] = HcalTopologyMode::LHC;
6  enumMap["HcalTopologyMode::H2"] = HcalTopologyMode::H2;
7  enumMap["HcalTopologyMode::SLHC"] = HcalTopologyMode::SLHC;
8  enumMap["HcalTopologyMode::H2HE"] = HcalTopologyMode::H2HE;
9 }
std::map< std::string, T > enumMap

Definition at line 4 of file HcalTopologyMode.cc.

References HcalTopologyMode::H2, HcalTopologyMode::H2HE, HcalTopologyMode::LHC, and HcalTopologyMode::SLHC.

4  {
5  enumMap["HcalTopologyMode::LHC"] = HcalTopologyMode::LHC;
6  enumMap["HcalTopologyMode::H2"] = HcalTopologyMode::H2;
7  enumMap["HcalTopologyMode::SLHC"] = HcalTopologyMode::SLHC;
8  enumMap["HcalTopologyMode::H2HE"] = HcalTopologyMode::H2HE;
9 }
std::map< std::string, T > enumMap

Member Function Documentation

template<typename T>
T StringToEnumParser< T >::parseString ( const std::string &  value)
inline

Definition at line 16 of file HcalTopologyMode.h.

16  {
17  typename std::map<std::string, T>::const_iterator iValue = enumMap.find(value);
18  if (iValue == enumMap.end())
19  throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
20 
21  return iValue->second;
22  }
std::map< std::string, T > enumMap
Definition: value.py:1
template<typename T>
T StringToEnumParser< T >::parseString ( const std::string &  value)
inline

Definition at line 16 of file HcalTopologyMode.h.

16  {
17  typename std::map<std::string, T>::const_iterator iValue = enumMap.find(value);
18  if (iValue == enumMap.end())
19  throw cms::Exception("Configuration") << "the value " << value << " is not defined.";
20 
21  return iValue->second;
22  }
std::map< std::string, T > enumMap
Definition: value.py:1

Member Data Documentation

template<typename T>
std::map< std::string, T > StringToEnumParser< T >::enumMap
private

Definition at line 11 of file HcalTopologyMode.h.