#include "FWCore/Utilities/interface/Exception.h"
#include "TEnum.h"
#include "TEnumConstant.h"
#include <cassert>
#include <string>
#include <sstream>
#include <vector>
Go to the source code of this file.
Functions | |
template<class MyType > | |
std::vector< int > | StringToEnumValue (const std::vector< std::string > &enumNames) |
template<typename MyEnum > | |
int | StringToEnumValue (std::string const &enumConstName) |
std::vector<int> StringToEnumValue | ( | const std::vector< std::string > & | enumNames | ) |
Convert a vector<string> into a vector<int> with the enum values it corresponds to. Example:
std::vector<std::string> names; names.push_back("kWeird"); names.push_back("kGood");
std::vector<int> ints = StringToEnumValue<EcalRecHit::Flags>(names);
std::copy(ints.begin(), ints.end(), std::ostream_iterator<int>(std::cout, "-"));
Definition at line 57 of file StringToEnumValue.h.
References runTheMatrix::ret, str, and AlCaHLTBitMon_QueryRunRegistry::string.
int StringToEnumValue | ( | std::string const & | enumConstName | ) |
Convert a string into the enum value it corresponds to. Example: int value = StringToEnumValue<EcalRecHit::Flags>("kGood");
Definition at line 25 of file StringToEnumValue.h.
References cms::cuda::assert().