CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
edm::es::Label Struct Reference

#include <es_Label.h>

Public Member Functions

 Label ()=default
 
 Label (const char *iLabel)
 
 Label (const std::string &iString)
 
 Label (const std::string &iString, unsigned int const iIndex)
 
Labeloperator() (const std::string &iString, unsigned int const iIndex)
 
Labeloperator() (int iIndex, const std::string &iString)
 

Static Public Member Functions

static const std::string & def ()
 

Public Attributes

std::string default_ {}
 
std::vector< std::string > labels_ {}
 

Detailed Description

Definition at line 56 of file es_Label.h.

Constructor & Destructor Documentation

◆ Label() [1/4]

edm::es::Label::Label ( )
default

◆ Label() [2/4]

edm::es::Label::Label ( const char *  iLabel)
inline

Definition at line 58 of file es_Label.h.

58 : default_{iLabel} {}

◆ Label() [3/4]

edm::es::Label::Label ( const std::string &  iString)
inline

Definition at line 59 of file es_Label.h.

59 : default_{iString} {}

◆ Label() [4/4]

edm::es::Label::Label ( const std::string &  iString,
unsigned int const  iIndex 
)
inline

Definition at line 60 of file es_Label.h.

60  : labels_(iIndex + 1, def()) {
61  labels_[iIndex] = iString;
62  }

References labels_.

Member Function Documentation

◆ def()

static const std::string& edm::es::Label::def ( )
inlinestatic

Definition at line 84 of file es_Label.h.

84  {
85  static const std::string s_def("\n\t");
86  return s_def;
87  }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by operator()(), and edm::ESProducer::registerProduct().

◆ operator()() [1/2]

Label& edm::es::Label::operator() ( const std::string &  iString,
unsigned int const  iIndex 
)
inline

Definition at line 64 of file es_Label.h.

64  {
65  if (iIndex == labels_.size()) {
66  labels_.push_back(iString);
67  } else if (iIndex > labels_.size()) {
68  std::vector<std::string> temp(iIndex + 1, def());
69  copy_all(labels_, temp.begin());
70  labels_.swap(temp);
71  } else {
72  if (labels_[iIndex] != def()) {
73  Exception e(errors::Configuration, "Duplicate Label");
74  e << "The index " << iIndex << " was previously assigned the label \"" << labels_[iIndex]
75  << "\" and then was later assigned \"" << iString << "\"";
76  e.raise();
77  }
78  labels_[iIndex] = iString;
79  }
80  return *this;
81  }

References edm::errors::Configuration, edm::copy_all(), def(), MillePedeFileConverter_cfg::e, labels_, and groupFilesInBlocks::temp.

◆ operator()() [2/2]

Label& edm::es::Label::operator() ( int  iIndex,
const std::string &  iString 
)
inline

Definition at line 82 of file es_Label.h.

82 { return (*this)(iString, iIndex); }

Member Data Documentation

◆ default_

std::string edm::es::Label::default_ {}

Definition at line 90 of file es_Label.h.

Referenced by edm::ESProducer::registerProduct().

◆ labels_

std::vector<std::string> edm::es::Label::labels_ {}

Definition at line 89 of file es_Label.h.

Referenced by Label(), operator()(), and edm::ESProducer::registerProduct().

edm::es::Label::default_
std::string default_
Definition: es_Label.h:90
edm::copy_all
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:20
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::es::Label::def
static const std::string & def()
Definition: es_Label.h:84
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
edm::es::Label::labels_
std::vector< std::string > labels_
Definition: es_Label.h:89
edm::errors::Configuration
Definition: EDMException.h:36
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37