CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes
CmsMTDStringToEnum Class Reference

#include <CmsMTDStringToEnum.h>

Classes

struct  Impl
 

Public Types

typedef std::map< std::string, GeometricTimingDet::GeometricTimingEnumTypeMapEnumType
 

Public Member Functions

GeometricTimingDet::GeometricTimingEnumType type (std::string const &) const
 

Static Public Attributes

static constexpr size_t kModStrLen = 7
 

Static Private Member Functions

static MapEnumType const & map ()
 

Static Private Attributes

static const Impl m_impl
 

Detailed Description

Builds map between Det type and an enum

Definition at line 10 of file CmsMTDStringToEnum.h.

Member Typedef Documentation

◆ MapEnumType

Definition at line 14 of file CmsMTDStringToEnum.h.

Member Function Documentation

◆ map()

static MapEnumType const& CmsMTDStringToEnum::map ( )
inlinestaticprivate

Definition at line 19 of file CmsMTDStringToEnum.h.

19 { return m_impl._map; }

References CmsMTDStringToEnum::Impl::_map, and m_impl.

Referenced by type().

◆ type()

GeometricTimingDet::GeometricTimingEnumType CmsMTDStringToEnum::type ( std::string const &  s) const

Definition at line 18 of file CmsMTDStringToEnum.cc.

18  {
19  // remove namespace if present
20  std::string_view v = s;
21  auto first = v.find_first_of(":");
22  v.remove_prefix(std::min(first + 1, v.size()));
23  MapEnumType::const_iterator p = map().find({v.data(), v.size()});
24  if (p != map().end())
25  return p->second;
27 }

References dqmdumpme::first, map(), min(), AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, GeometricTimingDet::unknown, and findQualityFiles::v.

Referenced by DDCmsMTDConstruction::construct().

Member Data Documentation

◆ kModStrLen

constexpr size_t CmsMTDStringToEnum::kModStrLen = 7
staticconstexpr

◆ m_impl

const CmsMTDStringToEnum::Impl CmsMTDStringToEnum::m_impl
staticprivate

Definition at line 27 of file CmsMTDStringToEnum.h.

Referenced by map().

CmsMTDStringToEnum::Impl::_map
MapEnumType _map
Definition: CmsMTDStringToEnum.h:24
min
T min(T a, T b)
Definition: MathUtil.h:58
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
findQualityFiles.v
v
Definition: findQualityFiles.py:179
dqmdumpme.first
first
Definition: dqmdumpme.py:55
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CmsMTDStringToEnum::m_impl
static const Impl m_impl
Definition: CmsMTDStringToEnum.h:27
CmsMTDStringToEnum::map
static MapEnumType const & map()
Definition: CmsMTDStringToEnum.h:19
GeometricTimingDet::unknown
Definition: GeometricTimingDet.h:51