Dakota  Version 6.19
Explore and Predict with Confidence
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CommandLineHandler Class Reference

Utility class for managing command line inputs to DAKOTA. More...

Inheritance diagram for CommandLineHandler:
GetLongOpt

Public Member Functions

 CommandLineHandler ()
 default constructor, requires check_usage() call for parsing
 
 CommandLineHandler (int argc, char **argv, int world_rank)
 constructor with parsing
 
 ~CommandLineHandler ()
 destructor
 
void check_usage (int argc, char **argv)
 Verifies that DAKOTA is called with the correct command usage. Prints a descriptive message and exits the program if incorrect.
 
int read_restart_evals () const
 Returns the number of evaluations to be read from the restart file (as specified on the DAKOTA command line) as an integer instead of a const char*.
 
void usage (std::ostream &outfile=Cout) const
 Print usage information to outfile, conditionally on rank.
 
- Public Member Functions inherited from GetLongOpt
 GetLongOpt (const char optmark='-')
 Constructor. More...
 
 ~GetLongOpt ()
 Destructor.
 
int parse (int argc, char *const *argv)
 parse the command line args (argc, argv). More...
 
int parse (char *const str, char *const p)
 parse a string of options (typically given from the environment). More...
 
int enroll (const char *const opt, const OptType t, const char *const desc, const char *const val)
 Add an option to the list of valid command options. More...
 
const char * retrieve (const char *const opt) const
 Retrieve value of option. More...
 
void usage (std::ostream &outfile=Cout) const
 Print usage information to outfile.
 
void usage (const char *str)
 Change header of usage output to str. More...
 
void store (const char *name, const char *value)
 Store a specified option value.
 

Private Member Functions

void initialize_options ()
 enrolls the supported command line inputs.
 
void output_helper (const std::string &message, std::ostream &os) const
 output only on Dakota worldRank 0 if possible More...
 

Private Attributes

int worldRank
 Rank of this process within Dakota's allocation; manages conditional output.
 

Additional Inherited Members

- Public Types inherited from GetLongOpt
enum  OptType { Valueless, OptionalValue, MandatoryValue }
 enum for different types of values associated with command line options. More...
 

Detailed Description

Utility class for managing command line inputs to DAKOTA.

CommandLineHandler provides additional functionality that is specific to DAKOTA's needs for the definition and parsing of command line options. Inheritance is used to allow the class to have all the functionality of the base class, GetLongOpt.

Member Function Documentation

◆ output_helper()

void output_helper ( const std::string &  message,
std::ostream &  os 
) const
private

output only on Dakota worldRank 0 if possible

When there is a valid ParallelLibrary, output only on rank 0

References CommandLineHandler::worldRank.

Referenced by CommandLineHandler::check_usage().


The documentation for this class was generated from the following files: