CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HGCalStringToEnumParser< T > Class Template Reference

#include <HGCalGeometryMode.h>

Public Member Functions

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

Private Attributes

std::map< std::string, TenumMap
 

Detailed Description

template<typename T>
class HGCalStringToEnumParser< T >

Definition at line 10 of file HGCalGeometryMode.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file HGCalGeometryMode.cc.

References Hexagon, and Square.

4  {
5  enumMap["HGCalGeometryMode::Square"] = HGCalGeometryMode::Square;
6  enumMap["HGCalGeometryMode::Hexagon"] = HGCalGeometryMode::Hexagon;
7 }
std::map< std::string, T > enumMap

Member Function Documentation

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

Definition at line 16 of file HGCalGeometryMode.h.

References HGCalStringToEnumParser< T >::enumMap.

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

Member Data Documentation

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

Definition at line 11 of file HGCalGeometryMode.h.

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