OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor Class Reference

Reads from a file and/or parses from the commandline to initalize an OptionsFromStream object. More...

#include <OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp>

List of all members.

Public Member Functions

 CommandLineOptionsFromStreamProcessor (const std::string &options_file_name_opt_name="ofs-options-file", const std::string &options_file_name_opt_doc="The name of the file containing input options for OptionsFromStream object.", const std::string &options_file_name="", const std::string &extra_options_str_opt_name="ofs-extra-options", const std::string &extra_options_str_opt_doc="Extra options in format \"OptGrp1{name1=val1,...,namen=valn}:OptGr2{name1=val1,...,namen=valn}:...\"", const std::string &extra_options_str="")
 Construct with default values for the options file name and extra options.
void set_options (Teuchos::RefCountPtr< OptionsFromStream > const &options)
 Set the OptionsFromStream object that will be used to fill options in to.
Teuchos::RefCountPtr< OptionsFromStreamget_options () const
 Just return the OptionsFromStream object in its current state.
void options_file_name_opt_name (const std::string &options_file_name_opt_name)
 Set the name of the commandline option name that specifies the options file name.
void options_file_name_opt_doc (const std::string &options_file_name_opt_doc)
 Set the documentation of the commandline option name that specifies the options file name.
void options_file_name (const std::string &options_file_name)
 Set the options file name manually (which will be used for default value for "--${options_file_name_opt_name}=???" commandline option).
void extra_options_str_opt_name (const std::string &extra_options_str_opt_name)
 Set the name of the commandline option name that specifies the extra options.
void extra_options_str_opt_doc (const std::string &extra_options_str_opt_doc)
 Set the documentation of the commandline option name that specifies the extra options.
void extra_options_str (const std::string &extra_options_str)
 Set the extra commandline options string (can be used for default value for "--${extra_options_str_opt_name}=???" commandline option).
void setup_commandline_processor (Teuchos::CommandLineProcessor *clp)
 Setup a comandline processor before it processes commandline options or reads form a file.
void process_options ()
 Read the options file and/or process the commandline options.
Teuchos::RefCountPtr< OptionsFromStreamprocess_and_get_options ()
 Calls process_options() and returns get_options().


Detailed Description

Reads from a file and/or parses from the commandline to initalize an OptionsFromStream object.

ToDo: Finish documentation!

Definition at line 44 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.


Constructor & Destructor Documentation

OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::CommandLineOptionsFromStreamProcessor const std::string &  options_file_name_opt_name = "ofs-options-file",
const std::string &  options_file_name_opt_doc = "The name of the file containing input options for OptionsFromStream object.",
const std::string &  options_file_name = "",
const std::string &  extra_options_str_opt_name = "ofs-extra-options",
const std::string &  extra_options_str_opt_doc = "Extra options in format \"OptGrp1{name1=val1,...,namen=valn}:OptGr2{name1=val1,...,namen=valn}:...\"",
const std::string &  extra_options_str = ""
 

Construct with default values for the options file name and extra options.

Postconditions:

  • this->get_options_file_name()==options_file_name
  • this->get_extra_options_str()==extra_options_str

Suggestion: Do not pass in arguments to the consturctor. Instead, construct the object and then call the setup frunction.

Definition at line 36 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.


Member Function Documentation

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::set_options Teuchos::RefCountPtr< OptionsFromStream > const &  options  ) 
 

Set the OptionsFromStream object that will be used to fill options in to.

Postconditions:

Definition at line 52 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.

Teuchos::RefCountPtr< OptionsFromStream > OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::get_options  )  const
 

Just return the OptionsFromStream object in its current state.

This function does not force the options to be processed.

Definition at line 60 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::options_file_name_opt_name const std::string &  options_file_name_opt_name  )  [inline]
 

Set the name of the commandline option name that specifies the options file name.

Postconditions:

Definition at line 98 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::options_file_name_opt_doc const std::string &  options_file_name_opt_doc  )  [inline]
 

Set the documentation of the commandline option name that specifies the options file name.

Postconditions:

Definition at line 107 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::options_file_name const std::string &  options_file_name  )  [inline]
 

Set the options file name manually (which will be used for default value for "--${options_file_name_opt_name}=???" commandline option).

Postconditions:

Definition at line 116 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::extra_options_str_opt_name const std::string &  extra_options_str_opt_name  )  [inline]
 

Set the name of the commandline option name that specifies the extra options.

Postconditions:

Definition at line 125 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::extra_options_str_opt_doc const std::string &  extra_options_str_opt_doc  )  [inline]
 

Set the documentation of the commandline option name that specifies the extra options.

Postconditions:

  • this->oextra_options_str_opt_doc()==extra_options_str_opt_doc

Definition at line 134 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::extra_options_str const std::string &  extra_options_str  )  [inline]
 

Set the extra commandline options string (can be used for default value for "--${extra_options_str_opt_name}=???" commandline option).

Postconditions:

  • this->get_extra_options_str()===extra_options_str

Definition at line 143 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::setup_commandline_processor Teuchos::CommandLineProcessor clp  ) 
 

Setup a comandline processor before it processes commandline options or reads form a file.

Sets up two options on the commandline processor:

Definition at line 65 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.

void OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::process_options  ) 
 

Read the options file and/or process the commandline options.

If this->options_file_name()!="", then this file is read and processed first. Then, if this->extra_options_str()!="", this is followed by the processing of these extra options which may overide options set in the input options file.

Note: If this->get_options().get()==NULL before this function is called and if this->options_file_name()!="" or this->extra_options_str()!="", the an OptionsFromStream object will be created anew to store the parsed options.

Note: Calling this function will result in the options file and extra options to be parsed over and over again and add to or override the options currently already in *this->get_options().

Definition at line 73 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.

Teuchos::RefCountPtr< OptionsFromStream > OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor::process_and_get_options  ) 
 

Calls process_options() and returns get_options().

Definition at line 121 of file OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:33:34 2008 for MoochoPack: Miscellaneous Utilities for MOOCHO by doxygen 1.3.9.1