1 #ifndef _CommonTools_Utils_StringToEnumValue_h_ 2 #define _CommonTools_Utils_StringToEnumValue_h_ 6 #include "TEnumConstant.h" 24 template <
typename MyEnum>
26 TEnum* en = TEnum::GetEnum(
typeid(MyEnum));
28 if (TEnumConstant
const* enc = en->GetConstant(enumConstName.c_str())) {
29 return enc->GetValue();
56 template <
class MyType>
62 vector<string>::const_iterator
str = enumNames.begin();
63 for (;
str != enumNames.end(); ++
str) {
64 ret.push_back(StringToEnumValue<MyType>(*
str));
ret
prodAgent to be discontinued
int StringToEnumValue(std::string const &enumConstName)