OpenM++ runtime library (libopenm)
openm::IRunOptions Struct Referenceabstract

public interface to get model run options More...

#include <omModel.h>

Inheritance diagram for openm::IRunOptions:

Public Member Functions

virtual bool isOptionExist (const char *i_key) const noexcept=0
 return true if run option found by i_key in run_option table for the current run id. More...
 
virtual std::string strOption (const char *i_key, const std::string &i_default="") const noexcept=0
 return string value of run option by i_key or default value if not found.
 
virtual bool boolOption (const char *i_key) const noexcept=0
 return boolean value of run option by i_key or false if not found or value is not "yes", "1", "true" or empty "" string. More...
 
virtual int boolOptionToInt (const char *i_key) const noexcept=0
 search for boolean value of run option by i_key and return one of:
return 1 if key found and value is one of: "yes", "1", "true" or empty value,
return 0 if key found and value is one of: "no", "0", "false",
return -1 if key not found,
return -2 otherwise. More...
 
virtual int intOption (const char *i_key, int i_default) const noexcept=0
 return int value of run option by i_key or default if not found or can not be converted to int. More...
 
virtual long long longOption (const char *i_key, long long i_default) const noexcept=0
 return long value of run option by i_key or default if not found or can not be converted to long. More...
 
virtual double doubleOption (const char *i_key, double i_default) const noexcept=0
 return double value of run option by i_key or default if not found or can not be converted to double. More...
 
virtual std::vector< std::pair< std::string, std::string > > allOptions (void) const noexcept=0
 return a copy of all run options as [key, value] pairs, ordered by key. More...
 

Detailed Description

public interface to get model run options

Member Function Documentation

◆ allOptions()

virtual std::vector< std::pair< std::string, std::string > > openm::IRunOptions::allOptions ( void  ) const
pure virtualnoexcept

return a copy of all run options as [key, value] pairs, ordered by key.

Implemented in openm::RunController.

◆ boolOption()

virtual bool openm::IRunOptions::boolOption ( const char *  i_key) const
pure virtualnoexcept

return boolean value of run option by i_key or false if not found or value is not "yes", "1", "true" or empty "" string.

Implemented in openm::RunController.

◆ boolOptionToInt()

virtual int openm::IRunOptions::boolOptionToInt ( const char *  i_key) const
pure virtualnoexcept

search for boolean value of run option by i_key and return one of:
return 1 if key found and value is one of: "yes", "1", "true" or empty value,
return 0 if key found and value is one of: "no", "0", "false",
return -1 if key not found,
return -2 otherwise.

Implemented in openm::RunController.

◆ doubleOption()

virtual double openm::IRunOptions::doubleOption ( const char *  i_key,
double  i_default 
) const
pure virtualnoexcept

return double value of run option by i_key or default if not found or can not be converted to double.

Implemented in openm::RunController.

◆ intOption()

virtual int openm::IRunOptions::intOption ( const char *  i_key,
int  i_default 
) const
pure virtualnoexcept

return int value of run option by i_key or default if not found or can not be converted to int.

Implemented in openm::RunController.

◆ isOptionExist()

virtual bool openm::IRunOptions::isOptionExist ( const char *  i_key) const
pure virtualnoexcept

return true if run option found by i_key in run_option table for the current run id.

Implemented in openm::RunController.

◆ longOption()

virtual long long openm::IRunOptions::longOption ( const char *  i_key,
long long  i_default 
) const
pure virtualnoexcept

return long value of run option by i_key or default if not found or can not be converted to long.

Implemented in openm::RunController.


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