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

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

Definition at line 56 of file es_Label.h.

56 : default_{iLabel} {}
std::string default_
Definition: es_Label.h:88
edm::es::Label::Label ( const std::string &  iString)
inline

Definition at line 57 of file es_Label.h.

57 : default_{iString} {}
std::string default_
Definition: es_Label.h:88
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  }
static const std::string & def()
Definition: es_Label.h:82
std::vector< std::string > labels_
Definition: es_Label.h:87

Member Function Documentation

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

Definition at line 82 of file es_Label.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

82  {
83  static const std::string s_def("\n\t");
84  return s_def;
85  }
Label& edm::es::Label::operator() ( const std::string &  iString,
unsigned int const  iIndex 
)
inline

Definition at line 62 of file es_Label.h.

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

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  }
static const std::string & def()
Definition: es_Label.h:82
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:20
std::vector< std::string > labels_
Definition: es_Label.h:87
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

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

Definition at line 88 of file es_Label.h.

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

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

Definition at line 87 of file es_Label.h.

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