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)
 
template<>
 StringToEnumParser ()
 
 StringToEnumParser (void)
 
template<>
 StringToEnumParser ()
 

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

◆ StringToEnumParser() [1/3]

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

◆ StringToEnumParser() [2/3]

◆ StringToEnumParser() [3/3]

Definition at line 17 of file HcalTopologyMode.cc.

References HcalTopologyMode::TriggerMode_2009, HcalTopologyMode::TriggerMode_2016, HcalTopologyMode::TriggerMode_2017, HcalTopologyMode::TriggerMode_2017plan1, HcalTopologyMode::TriggerMode_2018, HcalTopologyMode::TriggerMode_2018legacy, and HcalTopologyMode::TriggerMode_2021.

17  {
18  enumMap["HcalTopologyMode::TriggerMode_2009"] = HcalTopologyMode::TriggerMode_2009;
19  enumMap["HcalTopologyMode::TriggerMode_2016"] = HcalTopologyMode::TriggerMode_2016;
20  enumMap["HcalTopologyMode::TriggerMode_2018legacy"] = HcalTopologyMode::TriggerMode_2018legacy;
21  enumMap["HcalTopologyMode::TriggerMode_2017"] = HcalTopologyMode::TriggerMode_2017;
22  enumMap["HcalTopologyMode::TriggerMode_2017plan1"] = HcalTopologyMode::TriggerMode_2017plan1;
23  enumMap["HcalTopologyMode::TriggerMode_2018"] = HcalTopologyMode::TriggerMode_2018;
24  enumMap["HcalTopologyMode::TriggerMode_2021"] = HcalTopologyMode::TriggerMode_2021;
25 }
std::map< std::string, T > enumMap

Member Function Documentation

◆ parseString()

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

Definition at line 16 of file HcalTopologyMode.h.

References StringToEnumParser< T >::enumMap.

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  }
Definition: value.py:1
std::map< std::string, T > enumMap

Member Data Documentation

◆ enumMap

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

Definition at line 11 of file HcalTopologyMode.h.

Referenced by StringToEnumParser< T >::parseString().