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] = iString;
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());
70 if (labels_[iIndex] !=
def()) {
72 e <<
"The index " << iIndex <<
" was previously assigned the label \"" << labels_[iIndex]
73 <<
"\" and then was later assigned \"" << iString <<
"\"";
76 labels_[iIndex] = iString;
87 std::vector<std::string> labels_{};
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)