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 54 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 56 of file es_Label.h.

56 : default_{iLabel} {}

◆ Label() [3/4]

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

Definition at line 57 of file es_Label.h.

57 : default_{iString} {}

◆ Label() [4/4]

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

Definition at line 58 of file es_Label.h.

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

References labels_.

Member Function Documentation

◆ def()

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

Definition at line 82 of file es_Label.h.

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

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 62 of file es_Label.h.

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

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 80 of file es_Label.h.

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

Member Data Documentation

◆ default_

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

Definition at line 88 of file es_Label.h.

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

◆ labels_

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

Definition at line 87 of file es_Label.h.

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

edm::es::Label::default_
std::string default_
Definition: es_Label.h:88
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:82
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
edm::es::Label::labels_
std::vector< std::string > labels_
Definition: es_Label.h:87
edm::errors::Configuration
Definition: EDMException.h:36
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37