ITS.Propagation.LFMF 1.1
Part of the NTIA/ITS Propagation Library
Loading...
Searching...
No Matches
Driver.h File Reference

Interface header for this driver executable. More...

Go to the source code of this file.

Macros

#define PRINT   << std::endl << std::left << std::setw(30) <<
 Shortcut for concise print-to-file statements in driver.
 
#define SETW13   << std::setw(13) <<
 Shortcut for setting fixed whitespace padding in driver file output.
 

Functions

void Help (std::ostream &os=std::cout)
 Print help instructions to the terminal.
 
DrvrReturnCode ParseArguments (int argc, char **argv, DrvrParams &params)
 Parse the command line arguments.
 
DrvrReturnCode ValidateInputs (const DrvrParams &params)
 Validate that required inputs are present for the mode specified by the user.
 
std::string GetDatetimeString ()
 Get a string containing the current date and time information.
 
DrvrReturnCode ParseBoolean (const std::string &str, bool &value)
 Parse a boolean value read from the input parameter file.
 
DrvrReturnCode ParseDouble (const std::string &str, double &value)
 Parse a double value read from the input parameter file.
 
DrvrReturnCode ParseInteger (const std::string &str, int &value)
 Parse an integer value read from the input parameter file.
 
void PrintLabel (std::ostream &os, const std::string &lbl)
 Helper function to standardize printing of text labels to file.
 
void StringToLower (std::string &str)
 Convert a string to lowercase.
 
void Version (std::ostream &os=std::cout)
 Print version information to the specified output stream.
 
ReturnCode CallLFMFModel (LFMFParams &lfmf_params, Result &result)
 Top-level control function for LFMF Model.
 
DrvrReturnCode ParseLFMFInputFile (const std::string &in_file, LFMFParams &lfmf_params)
 Parse LFMF Model input parameter file.
 
void WriteLFMFInputs (std::ofstream &fp, const LFMFParams &params)
 Write LFMF Model inputs to the report file.
 
void WriteLFMFOutputs (std::ofstream &fp, const Result &result)
 Write LFMF Model outputs to the report file.
 

Detailed Description

Interface header for this driver executable.

Function Documentation

◆ CallLFMFModel()

ReturnCode CallLFMFModel ( LFMFParams & lfmf_params,
Result & result )

Top-level control function for LFMF Model.

Parameters
[in]lfmf_paramsLFMF Model input parameter struct
[out]resultLFMF Results in Result struct
Returns
Return code

◆ GetDatetimeString()

std::string GetDatetimeString ( )

Get a string containing the current date and time information.

Returns
A localized standard date and time string (locale dependent)

◆ Help()

void Help ( std::ostream & os)

Print help instructions to the terminal.

Parameters
[in]osOutput stream for writing; defaults to std::cout

◆ ParseArguments()

DrvrReturnCode ParseArguments ( int argc,
char ** argv,
DrvrParams & params )

Parse the command line arguments.

Parameters
[in]argcNumber of arguments
[in]argvCommand line arguments
[out]paramsStructure with user input params
Returns
Return code

◆ ParseBoolean()

DrvrReturnCode ParseBoolean ( const std::string & str,
bool & value )

Parse a boolean value read from the input parameter file.

Supports either "true" or "false" (case-insensitive) or "0" or "1"

Parameters
[in]strInput file value as string
[out]valueInput file value converted to bool
Returns
Return code

◆ ParseDouble()

DrvrReturnCode ParseDouble ( const std::string & str,
double & value )

Parse a double value read from the input parameter file.

Parameters
[in]strInput file value as string
[out]valueInput file value converted to double
Returns
Return code

◆ ParseInteger()

DrvrReturnCode ParseInteger ( const std::string & str,
int & value )

Parse an integer value read from the input parameter file.

Parameters
[in]strInput file value as string
[out]valueInput file value converted to int
Returns
Return code

◆ ParseLFMFInputFile()

DrvrReturnCode ParseLFMFInputFile ( const std::string & in_file,
LFMFParams & lfmf_params )

Parse LFMF Model input parameter file.

Parameters
[in]in_filePath to LFMF input parameter file
[out]lfmf_paramsLFMF input parameter struct
Returns
Return code

◆ PrintLabel()

void PrintLabel ( std::ostream & os,
const std::string & lbl )

Helper function to standardize printing of text labels to file.

Parameters
[in]osOutput stream for writing
[in]lblText message

◆ StringToLower()

void StringToLower ( std::string & str)

Convert a string to lowercase.

Parameters
[in,out]strThe string to convert

◆ ValidateInputs()

DrvrReturnCode ValidateInputs ( const DrvrParams & params)

Validate that required inputs are present for the mode specified by the user.

This function DOES NOT check the validity of the parameter values, only that required parameters have been specified by the user

Parameters
[in]paramsStructure with user input parameters
Returns
Return code

◆ Version()

void Version ( std::ostream & os)

Print version information to the specified output stream.

Parameters
[in]osOutput stream for writing; defaults to std::cout

◆ WriteLFMFInputs()

void WriteLFMFInputs ( std::ofstream & fp,
const LFMFParams & params )

Write LFMF Model inputs to the report file.

Parameters
[in]fpOutput stream, a text file open for writing
[in]paramsLFMF input parameter struct

◆ WriteLFMFOutputs()

void WriteLFMFOutputs ( std::ofstream & fp,
const Result & result )

Write LFMF Model outputs to the report file.

Parameters
[in]fpOutput stream, a text file open for writing
[in]resultLFMF output result struct
Privacy Policy FOIA Accessibility Information Quality