10 #ifndef TEUCHOS_STRING_TO_INT_MAP_HPP
11 #define TEUCHOS_STRING_TO_INT_MAP_HPP
70 {
public:
AlreadyExists(
const std::string& what_arg) : std::logic_error(what_arg) {}};
74 {
public:
DoesNotExist(
const std::string& what_arg) : std::logic_error(what_arg) {}};
80 int get(
const std::string& option,
const std::string& groupName =
"" )
const;
83 template<
class EnumType>
84 EnumType
get(
const std::string& option,
const std::string& groupName =
"" )
const;
91 typedef std::map< std::string, int >
map_t;
105 template<
class EnumType>
109 ,std::string
const& option
110 ,std::string
const& groupName =
""
113 return static_cast<EnumType
>(theMap.get(option,groupName));
119 template<
class EnumType>
121 EnumType
StringToIntMap::get(
const std::string& option,
const std::string& groupName )
const
123 return static_cast<EnumType
>(
get(option,groupName));
134 #endif // TEUCHOS_STRING_TO_INT_MAP_HPP
AlreadyExists(const std::string &what_arg)
std::string validSelections() const
int get(const std::string &option, const std::string &groupName="") const
std::string defaultGroupName_
DoesNotExist(const std::string &what_arg)
Map a std::string to an enumeration.
const std::string & defaultGroupName() const
std::map< std::string, int > map_t