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:94
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:94
edm::es::Label::Label ( const std::string &  iString,
unsigned int const  iIndex 
)
inline

Definition at line 58 of file es_Label.h.

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

Member Function Documentation

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

Definition at line 88 of file es_Label.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

88  {
89  static const std::string s_def("\n\t");
90  return s_def;
91  }
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, MillePedeFileConverter_cfg::e, cms::Exception::raise(), and groupFilesInBlocks::temp.

65  {
66  if (iIndex == labels_.size()) {
67  labels_.push_back(iString);
68  } else if(iIndex > labels_.size()) {
69  std::vector<std::string> temp(iIndex+1,def());
70  copy_all(labels_, temp.begin());
71  labels_.swap(temp);
72  } else {
73  if( labels_[iIndex] != def() ) {
74  Exception e(errors::Configuration,"Duplicate Label");
75  e <<"The index "<<iIndex<<" was previously assigned the label \""
76  <<labels_[iIndex]<<"\" and then was later assigned \""
77  <<iString<<"\"";
78  e.raise();
79  }
80  labels_[iIndex] = iString;
81  }
82  return *this;
83  }
static const std::string & def()
Definition: es_Label.h:88
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
std::vector< std::string > labels_
Definition: es_Label.h:93
Label& edm::es::Label::operator() ( int  iIndex,
const std::string &  iString 
)
inline

Definition at line 84 of file es_Label.h.

84  {
85  return (*this)(iString, iIndex);
86  }

Member Data Documentation

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

Definition at line 94 of file es_Label.h.

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

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

Definition at line 93 of file es_Label.h.

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