1 #ifndef Framework_es_Label_h 2 #define Framework_es_Label_h 24 #include <string_view> 35 template<
typename T,
int ILabel>
49 template<
int ILabel,
typename T>
56 Label(
const char* iLabel) : default_{iLabel} {}
59 labels_(iIndex+1,
def())
61 labels_[iIndex] = iString;
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());
73 if( labels_[iIndex] !=
def() ) {
75 e <<
"The index "<<iIndex<<
" was previously assigned the label \"" 76 <<labels_[iIndex]<<
"\" and then was later assigned \"" 80 labels_[iIndex] = iString;
85 return (*
this)(iString, iIndex);
93 std::vector<std::string> labels_{};
98 return Label(iString, iIndex);
101 return Label(iString, iIndex);
static const std::string & def()
Label label(const std::string &iString, int iIndex)
Label(const char *iLabel)
Label(const std::string &iString)
L< T, ILabel > l(std::shared_ptr< T > &iP)
std::shared_ptr< T > product_
L(std::shared_ptr< T > iP)
Label & operator()(int iIndex, const std::string &iString)
Label & operator()(const std::string &iString, unsigned int const iIndex)
L(std::unique_ptr< T > iP)
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Label(const std::string &iString, unsigned int const iIndex)