42#include "Teuchos_StringToIntMap.hpp"
46StringToIntMap::StringToIntMap(
50 typedef map_t::value_type
val_t;
51 for(
int i = 0;
i < n; ++
i ) {
55 ,
"Teuchos::StringToIntMap::StringToIntMap(...): "
56 <<
"Error, the std::string \"" <<
strings[
i] <<
"\" is a duplicate for "
57 << defaultGroupName_ );
63 map_t::const_iterator
itr = map_.find(
option );
66 ,
"Teuchos::StringToIntMap:::get(\""<<
option<<
"\",...): "
67 <<
"Error, the std::string \"" <<
option <<
"\" is not recongnised for "
68 << ( groupName.length() ? groupName : defaultGroupName_ )
69 <<
"; valid selections include " << this->validSelections() <<
"."
76std::string StringToIntMap::validSelections()
const
78 std::ostringstream
oss;
80 map_t::const_iterator
itr = map_.begin();
81 for(
int i = 0;
itr != map_.end(); ++
itr, ++
i ) {
84 oss <<
"\""<<
itr->first<<
"\":"<<
itr->second;
Smart reference counting pointer class for automatic garbage collection.
int get(const std::string &option, const std::string &groupName="") const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...