|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
42 #ifndef TEUCHOS_STRING_TO_INT_MAP_HPP
43 #define TEUCHOS_STRING_TO_INT_MAP_HPP
102 {
public:
AlreadyExists(
const std::string& what_arg) : std::logic_error(what_arg) {}};
106 {
public:
DoesNotExist(
const std::string& what_arg) : std::logic_error(what_arg) {}};
112 int get(
const std::string& option,
const std::string& groupName =
"" )
const;
115 template<
class EnumType>
116 EnumType
get(
const std::string& option,
const std::string& groupName =
"" )
const;
123 typedef std::map< std::string, int >
map_t;
137 template<
class EnumType>
141 ,std::string
const& option
142 ,std::string
const& groupName =
""
145 return static_cast<EnumType
>(theMap.
get(option,groupName));
151 template<
class EnumType>
155 return static_cast<EnumType
>(
get(option,groupName));
166 #endif // TEUCHOS_STRING_TO_INT_MAP_HPP
std::string defaultGroupName_
AlreadyExists(const std::string &what_arg)
DoesNotExist(const std::string &what_arg)
std::map< std::string, int > map_t
int get(const std::string &option, const std::string &groupName="") const
EnumType get(StringToIntMap const &theMap, std::string const &option, std::string const &groupName="")
Nonmember get function.
std::string validSelections() const
Map a std::string to an enumeration.
const std::string & defaultGroupName() const