15 const std::string& defaultGroupName_in,
int n,
const char* strings[]
16 ) : defaultGroupName_(defaultGroupName_in)
18 typedef map_t::value_type val_t;
19 for(
int i = 0; i <
n; ++i ) {
20 const bool unique =
map_.insert( val_t( strings[i], i ) ).second;
23 ,
"Teuchos::StringToIntMap::StringToIntMap(...): "
24 <<
"Error, the std::string \"" << strings[i] <<
"\" is a duplicate for "
31 map_t::const_iterator itr =
map_.find( option );
34 ,
"Teuchos::StringToIntMap:::get(\""<<option<<
"\",...): "
35 <<
"Error, the std::string \"" << option <<
"\" is not recongnised for "
46 std::ostringstream oss;
48 map_t::const_iterator itr =
map_.begin();
49 for(
int i = 0; itr !=
map_.end(); ++itr, ++i ) {
52 oss <<
"\""<<itr->first<<
"\":"<<itr->second;
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
std::string validSelections() const
int get(const std::string &option, const std::string &groupName="") const
std::string defaultGroupName_