1 #ifndef Framework_es_Label_h
2 #define Framework_es_Label_h
22 #include "boost/shared_ptr.hpp"
34 template<
typename T,
int ILabel>
39 explicit L(boost::shared_ptr<T> iP) :
product_(iP) {}
47 template<
int ILabel,
typename T>
56 Label(
const std::string& iString,
unsigned int iIndex) :
62 }
else if(iIndex >
labels_.size()) {
63 std::vector<std::string>
temp(iIndex+1,
def());
69 e <<
"The index "<<iIndex<<
" was previously assigned the label \""
70 <<
labels_[iIndex]<<
"\" and then was later assigned \""
79 return (*
this)(iString, iIndex);
82 static const std::string&
def() {
83 static const std::string s_def(
"\n\t");
90 inline Label label(
const std::string& iString,
int iIndex) {
91 return Label(iString, iIndex);
93 inline Label label(
int iIndex,
const std::string& iString) {
94 return Label(iString, iIndex);
Label & operator()(const std::string &iString, unsigned int iIndex)
static const std::string & def()
Label label(const std::string &iString, int iIndex)
Label(const char *iLabel)
Label(const std::string &iString)
boost::shared_ptr< T > product_
Label & operator()(int iIndex, const std::string &iString)
L(boost::shared_ptr< T > iP)
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
L(const L< T, ILabel > &iOther)
std::vector< std::string > labels_
L< T, ILabel > l(boost::shared_ptr< T > &iP)
Label(const std::string &iString, unsigned int iIndex)