44 #include "OptionsFromStreamPack_SetOptionsFromStreamNode.hpp"
45 #include "OptionsFromStreamPack_OptionsFromStream.hpp"
46 #include "Teuchos_Assert.hpp"
48 namespace OptionsFromStreamPack {
51 ,
int num_options,
const char* option_names[],
bool exists_optional )
52 : name_map_( options_group, num_options, option_names )
53 , exists_optional_(exists_optional)
61 !exists_optional_, std::invalid_argument
62 ,
"SetOptionsFromStreamNode::set_options(...) : "
63 <<
"Error, The options group " << name_map_.
name()
64 <<
" does not exist" );
70 for( ; itr != optgrp.
end(); ++itr ) {
71 setOption( name_map_( option_name(itr) ), option_value(itr).c_str() );
Extracts options from a text stream and then allows convenient access to them.
option_to_value_map_t::const_iterator const_iterator
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void set_options(const OptionsFromStream &options)
Overridden from SetOptionsFromStream and calls setOption(...).
static bool options_group_exists(const options_group_t &options_group)
SetOptionsFromStreamNode(const std::string &options_group, int num_options, const char *option_names[], bool exists_optional=true)
Constructs with the name of the options group and the names of the options.
virtual void setOption(int option_num, const std::string &option_value)=0
To be overridden by the subclass to set an option given its integer position and the option value...
Class used to encapsulate options belonging an options group.
options_group_t options_group(const std::string &options_group_name)
const std::string & name() const