OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
Classes | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
oms::Flags Class Reference

#include <Flags.h>

Collaboration diagram for oms::Flags:
Collaboration graph

Classes

struct  Flag
 

Static Public Member Functions

static oms_status_enu_t SetCommandLineOption (const std::string &cmd)
 
static bool DefaultModeIsCS ()
 
static bool IgnoreInitialUnknowns ()
 
static bool InputDerivatives ()
 
static bool ProgressBar ()
 
static bool SuppressPath ()
 
static bool WallTime ()
 
static double StartTime ()
 
static double StopTime ()
 
static double Timeout ()
 
static double Tolerance ()
 
static std::string ResultFile ()
 
static oms_solver_enu_t Solver ()
 
static oms_solver_enu_t MasterAlgorithm ()
 
static unsigned int Intervals ()
 

Private Member Functions

 Flags ()
 
 ~Flags ()
 
void setDefaults ()
 
 Flags (Flags const &)
 not implemented More...
 
Flagsoperator= (Flags const &)
 not implemented More...
 

Static Private Member Functions

static FlagsGetInstance ()
 
static oms_status_enu_t ClearAllOptions (const std::string &value)
 
static oms_status_enu_t FetchAllVars (const std::string &value)
 
static oms_status_enu_t Filename (const std::string &value)
 
static oms_status_enu_t Help (const std::string &value)
 
static oms_status_enu_t IgnoreInitialUnknowns (const std::string &value)
 
static oms_status_enu_t Intervals (const std::string &value)
 
static oms_status_enu_t LogFile (const std::string &value)
 
static oms_status_enu_t LogLevel (const std::string &value)
 
static oms_status_enu_t Mode (const std::string &value)
 
static oms_status_enu_t ProgressBar (const std::string &value)
 
static oms_status_enu_t ResultFile (const std::string &value)
 
static oms_status_enu_t SetInputDerivatives (const std::string &value)
 
static oms_status_enu_t Solver (const std::string &value)
 
static oms_status_enu_t StartTime (const std::string &value)
 
static oms_status_enu_t StopTime (const std::string &value)
 
static oms_status_enu_t SuppressPath (const std::string &value)
 
static oms_status_enu_t TempDir (const std::string &value)
 
static oms_status_enu_t Timeout (const std::string &value)
 
static oms_status_enu_t Tolerance (const std::string &value)
 
static oms_status_enu_t Version (const std::string &value)
 
static oms_status_enu_t WallTime (const std::string &value)
 
static oms_status_enu_t WorkingDir (const std::string &value)
 

Private Attributes

bool ignoreInitialUnknowns
 
bool suppressPath
 
bool progressBar
 
bool inputDerivatives
 
bool defaultModeIsCS
 
bool wallTime
 
unsigned int intervals
 
double startTime
 
double stopTime
 
double timeout
 
double tolerance
 
oms_solver_enu_t solver
 
oms_solver_enu_t masterAlgorithm
 
std::string resultFile
 
std::map< std::string, unsigned int > lookup
 
const std::string re_void = ""
 
const std::string re_default = ".+"
 
const std::string re_bool = "(true|false)"
 
const std::string re_mode = "(me|cs)"
 
const std::string re_double = "((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?"
 
const std::string re_number = "[[:digit:]]+"
 
const std::string re_filename = ".+(\\.fmu|\\.ssp)"
 
const std::vector< Flagflags
 

Constructor & Destructor Documentation

◆ Flags() [1/2]

oms::Flags::Flags ( )
private
Here is the call graph for this function:

◆ ~Flags()

oms::Flags::~Flags ( )
private

◆ Flags() [2/2]

oms::Flags::Flags ( Flags const &  )
private

not implemented

Member Function Documentation

◆ ClearAllOptions()

oms_status_enu_t oms::Flags::ClearAllOptions ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ DefaultModeIsCS()

static bool oms::Flags::DefaultModeIsCS ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FetchAllVars()

oms_status_enu_t oms::Flags::FetchAllVars ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ Filename()

oms_status_enu_t oms::Flags::Filename ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ GetInstance()

oms::Flags & oms::Flags::GetInstance ( )
staticprivate
Here is the caller graph for this function:

◆ Help()

oms_status_enu_t oms::Flags::Help ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ IgnoreInitialUnknowns() [1/2]

static bool oms::Flags::IgnoreInitialUnknowns ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IgnoreInitialUnknowns() [2/2]

oms_status_enu_t oms::Flags::IgnoreInitialUnknowns ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ InputDerivatives()

static bool oms::Flags::InputDerivatives ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Intervals() [1/2]

static unsigned int oms::Flags::Intervals ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Intervals() [2/2]

oms_status_enu_t oms::Flags::Intervals ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ LogFile()

oms_status_enu_t oms::Flags::LogFile ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ LogLevel()

oms_status_enu_t oms::Flags::LogLevel ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ MasterAlgorithm()

static oms_solver_enu_t oms::Flags::MasterAlgorithm ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mode()

oms_status_enu_t oms::Flags::Mode ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ operator=()

Flags& oms::Flags::operator= ( Flags const &  )
private

not implemented

◆ ProgressBar() [1/2]

static bool oms::Flags::ProgressBar ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProgressBar() [2/2]

oms_status_enu_t oms::Flags::ProgressBar ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ ResultFile() [1/2]

static std::string oms::Flags::ResultFile ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResultFile() [2/2]

oms_status_enu_t oms::Flags::ResultFile ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ SetCommandLineOption()

oms_status_enu_t oms::Flags::SetCommandLineOption ( const std::string &  cmd)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaults()

void oms::Flags::setDefaults ( )
private
Here is the caller graph for this function:

◆ SetInputDerivatives()

oms_status_enu_t oms::Flags::SetInputDerivatives ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ Solver() [1/2]

static oms_solver_enu_t oms::Flags::Solver ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Solver() [2/2]

oms_status_enu_t oms::Flags::Solver ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ StartTime() [1/2]

static double oms::Flags::StartTime ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartTime() [2/2]

oms_status_enu_t oms::Flags::StartTime ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ StopTime() [1/2]

static double oms::Flags::StopTime ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StopTime() [2/2]

oms_status_enu_t oms::Flags::StopTime ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ SuppressPath() [1/2]

static bool oms::Flags::SuppressPath ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SuppressPath() [2/2]

oms_status_enu_t oms::Flags::SuppressPath ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ TempDir()

oms_status_enu_t oms::Flags::TempDir ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ Timeout() [1/2]

static double oms::Flags::Timeout ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Timeout() [2/2]

oms_status_enu_t oms::Flags::Timeout ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ Tolerance() [1/2]

static double oms::Flags::Tolerance ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tolerance() [2/2]

oms_status_enu_t oms::Flags::Tolerance ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ Version()

oms_status_enu_t oms::Flags::Version ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ WallTime() [1/2]

static bool oms::Flags::WallTime ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WallTime() [2/2]

oms_status_enu_t oms::Flags::WallTime ( const std::string &  value)
staticprivate
Here is the call graph for this function:

◆ WorkingDir()

oms_status_enu_t oms::Flags::WorkingDir ( const std::string &  value)
staticprivate
Here is the call graph for this function:

Member Data Documentation

◆ defaultModeIsCS

bool oms::Flags::defaultModeIsCS
private

◆ flags

const std::vector<Flag> oms::Flags::flags
private
Initial value:
= {
{"", "", "FMU or SSP file", re_filename, Flags::Filename, false},
{"--clearAllOptions", "", "Reset all flags to default values", re_void, Flags::ClearAllOptions, false},
{"--fetchAllVars", "", "", re_default, Flags::FetchAllVars, false},
{"--help", "-h", "Displays the help text", re_void, Flags::Help, true},
{"--ignoreInitialUnknowns", "", "Ignore the initial unknowns from the modelDesction.xml", re_bool, Flags::IgnoreInitialUnknowns, false},
{"--intervals", "-i", "Specifies the number of communication points (arg > 1)", re_number, Flags::Intervals, false},
{"--logFile", "-l", "Specifies the logfile (stdout is used if no log file is specified)", re_default, Flags::LogFile, false},
{"--logLevel", "", "0 default, 1 default+debug, 2 default+debug+trace", re_number, Flags::LogLevel, false},
{"--mode", "-m", "Forces a certain FMI mode iff the FMU provides cs and me [arg: cs (default) or me]", re_mode, Flags::Mode, false},
{"--progressBar", "", "", re_bool, Flags::ProgressBar, false},
{"--resultFile", "-r", "Specifies the name of the output result file", re_default, Flags::ResultFile, false},
{"--setInputDerivatives", "", "", re_bool, Flags::SetInputDerivatives, false},
{"--solver", "", "Specifies the integration method (internal, euler, cvode)", re_void, Flags::Solver, false},
{"--startTime", "-s", "Specifies the start time", re_double, Flags::StartTime, false},
{"--stopTime", "-t", "Specifies the stop time", re_double, Flags::StopTime, false},
{"--suppressPath", "", "", re_bool, Flags::SuppressPath, false},
{"--tempDir", "", "Specifies the temp directory", re_default, Flags::TempDir, false},
{"--timeout", "", "Specifies the maximum allowed time in seconds for running a simulation (0 disables)", re_number, Flags::Timeout, false},
{"--tolerance", "", "Specifies the relative tolerance", re_double, Flags::Tolerance, false},
{"--version", "-v", "Displays version information", re_void, Flags::Version, false},
{"--wallTime", "", "Add wall time information for to the result file", re_bool, Flags::WallTime, false},
{"--workingDir", "", "Specifies the working directory", re_default, Flags::WorkingDir, false}
}

◆ ignoreInitialUnknowns

bool oms::Flags::ignoreInitialUnknowns
private

◆ inputDerivatives

bool oms::Flags::inputDerivatives
private

◆ intervals

unsigned int oms::Flags::intervals
private

◆ lookup

std::map<std::string, unsigned int> oms::Flags::lookup
private

◆ masterAlgorithm

oms_solver_enu_t oms::Flags::masterAlgorithm
private

◆ progressBar

bool oms::Flags::progressBar
private

◆ re_bool

const std::string oms::Flags::re_bool = "(true|false)"
private

◆ re_default

const std::string oms::Flags::re_default = ".+"
private

◆ re_double

const std::string oms::Flags::re_double = "((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?"
private

◆ re_filename

const std::string oms::Flags::re_filename = ".+(\\.fmu|\\.ssp)"
private

◆ re_mode

const std::string oms::Flags::re_mode = "(me|cs)"
private

◆ re_number

const std::string oms::Flags::re_number = "[[:digit:]]+"
private

◆ re_void

const std::string oms::Flags::re_void = ""
private

◆ resultFile

std::string oms::Flags::resultFile
private

◆ solver

oms_solver_enu_t oms::Flags::solver
private

◆ startTime

double oms::Flags::startTime
private

◆ stopTime

double oms::Flags::stopTime
private

◆ suppressPath

bool oms::Flags::suppressPath
private

◆ timeout

double oms::Flags::timeout
private

◆ tolerance

double oms::Flags::tolerance
private

◆ wallTime

bool oms::Flags::wallTime
private

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