CMS 3D CMS Logo

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

#include <HGCalGeometryMode.h>

Public Member Functions

template<>
 HGCalStringToEnumParser ()
 
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

◆ HGCalStringToEnumParser() [1/3]

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

◆ HGCalStringToEnumParser() [2/3]

Definition at line 4 of file HGCalGeometryMode.cc.

4  {
5  enumMap["HGCalGeometryMode::Square"] = HGCalGeometryMode::Square;
6  enumMap["HGCalGeometryMode::Hexagon"] = HGCalGeometryMode::Hexagon;
7  enumMap["HGCalGeometryMode::HexagonFull"] = HGCalGeometryMode::HexagonFull;
8  enumMap["HGCalGeometryMode::Hexagon8"] = HGCalGeometryMode::Hexagon8;
9  enumMap["HGCalGeometryMode::Hexagon8Full"] = HGCalGeometryMode::Hexagon8Full;
10  enumMap["HGCalGeometryMode::Trapezoid"] = HGCalGeometryMode::Trapezoid;
11  enumMap["HGCalGeometryMode::Hexagon8File"] = HGCalGeometryMode::Hexagon8File;
12  enumMap["HGCalGeometryMode::TrapezoidFile"] = HGCalGeometryMode::TrapezoidFile;
13  enumMap["HGCalGeometryMode::Hexagon8Module"] = HGCalGeometryMode::Hexagon8Module;
14  enumMap["HGCalGeometryMode::TrapezoidModule"] = HGCalGeometryMode::TrapezoidModule;
15 }

References HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::Hexagon8Module, HGCalGeometryMode::HexagonFull, HGCalGeometryMode::Square, HGCalGeometryMode::Trapezoid, HGCalGeometryMode::TrapezoidFile, and HGCalGeometryMode::TrapezoidModule.

◆ HGCalStringToEnumParser() [3/3]

Definition at line 18 of file HGCalGeometryMode.cc.

18  {
19  enumMap["HGCalGeometryMode::Polyhedra"] = HGCalGeometryMode::Polyhedra;
20  enumMap["HGCalGeometryMode::ExtrudedPolygon"] = HGCalGeometryMode::ExtrudedPolygon;
21 }

References HGCalGeometryMode::ExtrudedPolygon, and HGCalGeometryMode::Polyhedra.

Member Function Documentation

◆ parseString()

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

Definition at line 16 of file HGCalGeometryMode.h.

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 << " is not defined.";
20  return itr->second;
21  }

References HGCalStringToEnumParser< T >::enumMap.

Member Data Documentation

◆ enumMap

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().

HGCalGeometryMode::TrapezoidFile
Definition: HGCalGeometryMode.h:33
HGCalGeometryMode::Hexagon8Module
Definition: HGCalGeometryMode.h:34
HGCalGeometryMode::Trapezoid
Definition: HGCalGeometryMode.h:31
HGCalGeometryMode::Square
Definition: HGCalGeometryMode.h:26
HGCalGeometryMode::TrapezoidModule
Definition: HGCalGeometryMode.h:35
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:30
value
Definition: value.py:1
HGCalStringToEnumParser::enumMap
std::map< std::string, T > enumMap
Definition: HGCalGeometryMode.h:11
HGCalGeometryMode::Hexagon
Definition: HGCalGeometryMode.h:27
HGCalGeometryMode::HexagonFull
Definition: HGCalGeometryMode.h:28
HGCalGeometryMode::Polyhedra
Definition: HGCalGeometryMode.h:37
HGCalGeometryMode::Hexagon8File
Definition: HGCalGeometryMode.h:32
HGCalGeometryMode::ExtrudedPolygon
Definition: HGCalGeometryMode.h:37
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:29
cms::Exception
Definition: Exception.h:70