CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 58 of file es_Label.h.

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

Definition at line 59 of file es_Label.h.

59 : default_{iString} {}
std::string default_
Definition: es_Label.h:90
edm::es::Label::Label ( const std::string &  iString,
unsigned int const  iIndex 
)
inline

Definition at line 60 of file es_Label.h.

References labels_.

60  : labels_(iIndex + 1, def()) {
61  labels_[iIndex] = iString;
62  }
static const std::string & def()
Definition: es_Label.h:84
std::vector< std::string > labels_
Definition: es_Label.h:89

Member Function Documentation

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

Definition at line 84 of file es_Label.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 64 of file es_Label.h.

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

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

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

Definition at line 90 of file es_Label.h.

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

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