42 #ifndef TEUCHOS_STRING_TO_INT_MAP_HPP 43 #define TEUCHOS_STRING_TO_INT_MAP_HPP 100 {
public:
AlreadyExists(
const std::string& what_arg) : std::logic_error(what_arg) {}};
104 {
public:
DoesNotExist(
const std::string& what_arg) : std::logic_error(what_arg) {}};
110 int get(
const std::string& option,
const std::string& groupName =
"" )
const;
113 template<
class EnumType>
114 EnumType
get(
const std::string& option,
const std::string& groupName =
"" )
const;
121 typedef std::map< std::string, int >
map_t;
135 template<
class EnumType>
139 ,std::string
const& option
140 ,std::string
const& groupName =
"" 143 return static_cast<EnumType
>(theMap.get(option,groupName));
149 template<
class EnumType>
153 return static_cast<EnumType
>(
get(option,groupName));
164 #endif // TEUCHOS_STRING_TO_INT_MAP_HPP int get(const std::string &option, const std::string &groupName="") const
AlreadyExists(const std::string &what_arg)
std::string validSelections() 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