OpenM++ runtime library (libopenm)
openm Namespace Reference

openM++ namespace More...

Classes

struct  AccReceive
 
struct  AggregationColumnExpr
 column aggregation expression More...
 
struct  AggregationFnc
 aggregation function names More...
 
struct  ArgKey
 common openM++ keys for runtime arguments More...
 
struct  ArgReader
 arguments reader to get runtime arguments from command line and ini-file. More...
 
class  ChildController
 controller for child process: receive input parameters from root and send output tables. More...
 
struct  CodeValueRow
 generic two string columns: (code, value) table row. More...
 
class  DbExecBase
 base class for database connection wrapper More...
 
class  DbExecSqlite
 db connection wrapper for SQLite. More...
 
union  DbValue
 union to pass value to database methods More...
 
class  DoneVector
 
struct  EmptyPackedAdapter
 pack and unpack adapter for metadata table db rows (empty implementation). More...
 
class  exit_guard
 simple resource exit guard implementation More...
 
struct  GroupLstRow
 group_lst table row. More...
 
class  GroupLstRowAdapter
 
class  GroupLstTable
 
struct  GroupPcRow
 group_pc table row. More...
 
class  GroupPcRowAdapter
 
class  GroupPcTable
 
struct  GroupTxtLangRow
 group_txt table row and language code. More...
 
struct  GroupTxtRow
 group_txt table row. More...
 
class  GroupTxtRowAdapter
 
class  GroupTxtTable
 
class  IDbExec
 database connection wrapper to execute sql commands. More...
 
struct  IFinalState
 final model run state public interface: thread safe More...
 
struct  IGroupLstTable
 group_lst table public interface. More...
 
struct  IGroupPcTable
 group_pc table public interface. More...
 
struct  IGroupTxtTable
 group_txt table public interface. More...
 
struct  ILangLstTable
 lang_lst table public interface. More...
 
struct  ILangWordTable
 lang_word table public interface. More...
 
struct  ILog
 log public interface: log to console and into log files More...
 
struct  ILogBase
 base for log public interface More...
 
struct  IMetaLoadedTable
 base class for preloaded metadata db-tables More...
 
struct  IMetaRow
 base class for model metadata db-rows More...
 
struct  IMetaTable
 base class for metadata db-tables More...
 
struct  IModel
 model sub-value run public interface More...
 
struct  IModelBuilder
 public interface to build model creation script from metadata rows. More...
 
struct  IModelDicTable
 model_dic table public interface. More...
 
struct  IModelDicTxtTable
 model_dic_txt table public interface. More...
 
struct  IModelRunState
 model run state public interface: thread safe More...
 
struct  IModelWordTable
 model_word table public interface. More...
 
class  IMsgExec
 public interface for message passing More...
 
class  IMsgRecv
 public interface for message receiver More...
 
class  IMsgRecvArray
 public interface to receive value array More...
 
class  IMsgRecvPacked
 public interface to receive packed data More...
 
class  IMsgSend
 public interface for message sender More...
 
class  IMsgSendArray
 public interface to send value array More...
 
class  IMsgSendPacked
 public interface to send packed data. More...
 
struct  IniEntry
 Ini-file entry: setcion, key and value. More...
 
class  IniFileReader
 ini-file reader: load all entries in memory and provide search methods. More...
 
struct  IOutputTableWriter
 output table writer public interface More...
 
struct  IPackedAdapter
 public interface to pack and unpack rows of metadata db-table More...
 
struct  IParamDicTable
 parameter_dic table public interface. More...
 
struct  IParamDicTxtTable
 parameter_dic_txt table public interface. More...
 
struct  IParamDimsTable
 parameter_dims table public interface. More...
 
struct  IParamDimsTxtTable
 parameter_dims_txt table public interface. More...
 
struct  IParameterReader
 input parameter reader public interface More...
 
struct  IParameterRunWriter
 public interface of input parameter writer for model run More...
 
struct  IParameterSetWriter
 public interface of input parameter writer into workset More...
 
struct  IProfileLstTable
 profile_lst table public interface. More...
 
struct  IProfileOptionTable
 profile_option table public interface. More...
 
class  IRowAdapter
 row factory and setter interface to select row from database More...
 
struct  IRowBase
 db-row abstract base More...
 
class  IRowProcessor
 public interafce for row processing during select, ie: select and append to row list More...
 
struct  IRunBase
 public interface to initialize model run and input parameters More...
 
struct  IRunLstTable
 run_lst table public interface. More...
 
struct  IRunOptionTable
 run_option table public interface. More...
 
struct  IRunParamTxtTable
 run_parameter_txt table public interface. More...
 
struct  IRunTxtTable
 run_txt table public interface. More...
 
struct  ITableAccTable
 table_acc table public interface. More...
 
struct  ITableAccTxtTable
 table_acc_txt table public interface. More...
 
struct  ITableDicTable
 table_dic table public interface. More...
 
struct  ITableDicTxtTable
 table_dic_txt table public interface. More...
 
struct  ITableDimsTable
 table_dims table public interface. More...
 
struct  ITableDimsTxtTable
 table_dims_txt table public interface. More...
 
struct  ITableExprTable
 table_expr table public interface. More...
 
struct  ITableExprTxtTable
 table_expr_txt table public interface. More...
 
struct  ITaskLstTable
 task_lst table public interface. More...
 
struct  ITaskRunLstTable
 task_run_lst table public interface. More...
 
struct  ITaskRunSetTable
 task_run_set table public interface. More...
 
struct  ITaskSetTable
 task_set table public interface. More...
 
struct  ITaskTxtTable
 task_txt table public interface. More...
 
struct  ITrace
 trace log public interface: model event log to console and into log files More...
 
struct  ITypeDicTable
 type_dic table public interface. More...
 
struct  ITypeDicTxtTable
 type_dic_txt table public interface. More...
 
struct  ITypeEnumLstTable
 type_enum_lst table public interface. More...
 
struct  ITypeEnumTxtTable
 type_enum_txt table public interface. More...
 
class  IUtf8Converter
 UTF-8 converter public interface. More...
 
class  IValueFormatter
 converter for value column (parameter, accumulator or expression value) to string More...
 
struct  IWorksetLstTable
 workset_lst table public interface. More...
 
struct  IWorksetParamTable
 workset_parameter table public interface. More...
 
struct  IWorksetParamTxtTable
 workset_parameter_txt table public interface. More...
 
struct  IWorksetTxtTable
 workset_txt table public interface. More...
 
struct  LangLstRow
 lang_lst table row. More...
 
class  LangLstRowAdapter
 
class  LangLstTable
 
struct  LangWordRow
 lang_word table row. More...
 
class  LangWordRowAdapter
 
class  LangWordTable
 
struct  LessNoCase
 case neutral less comparator for strings More...
 
class  Log
 log implementation class: log to console and into log files. More...
 
class  LogBase
 Log base class: log to console and into log files. More...
 
struct  MessageEllipter
 helper to return ellipted string if source string exceed max size. More...
 
struct  MetaHolder
 Holder for model metadata core part (not include model text). More...
 
class  MetaLoader
 model metadata loader: read and broadcast metadata and run options. More...
 
struct  MetaModelHolder
 Holder for model metadata db rows. More...
 
struct  MetaMpiPackedAdapter
 MPI-based adapter to pack and unpack vector of metadata db rows. More...
 
struct  MetaSetHolder
 Holder for working sets metadata. More...
 
struct  MetaSetLangHolder
 Holder for working sets metadata. More...
 
class  ModelAccumulatorSql
 class to produce accumulators sql subqueries for otput table More...
 
class  ModelAggregationSql
 class to produce aggregation sql for otput table More...
 
class  ModelBase
 model sub-value run base class More...
 
class  ModelBaseExpressionSql
 base class to produce sql expressions and subqueries for otput table More...
 
struct  ModelDicLangRow
 model_dic table row and default model language code. More...
 
struct  ModelDicRow
 model_dic table row. More...
 
class  ModelDicRowAdapter
 
class  ModelDicTable
 
struct  ModelDicTxtLangRow
 model_dic_txt table row and language code. More...
 
struct  ModelDicTxtRow
 model_dic_txt table row. More...
 
class  ModelDicTxtRowAdapter
 
class  ModelDicTxtTable
 
class  ModelInsertSql
 metadata inserter class: produce sql statements and insert metadata rows into db tables. More...
 
class  ModelRunState
 model run state: thread safe More...
 
class  ModelSqlBuilder
 class to build model creation sql from metadata rows. More...
 
struct  ModelSqlWriter
 wrapper around file stream to write into sql script file. More...
 
struct  ModelWordLangRow
 model_word table row and language code. More...
 
struct  ModelWordRow
 model_word table row. More...
 
class  ModelWordRowAdapter
 
class  ModelWordTable
 
class  MpiException
 messaging library MPI exception More...
 
class  MpiExec
 message passing library main class for MPI-based implementation More...
 
class  MpiPacked
 wrapper class around of MPI_Pack and MPI_Unpack More...
 
class  MpiRecvArray
 non-blocking receive of value array More...
 
class  MpiRecvPacked
 non-blocking receive of packed data More...
 
class  MpiSendArray
 non-blocking MPI send of value array More...
 
class  MpiSendBase
 base class for non-blocking MPI send More...
 
class  MpiSendPacked
 non-blocking MPI send of packed data More...
 
class  MsgEmptyExec
 message passing main class. More...
 
class  MsgEmptyRecvArray
 non-blocking receive of value array (empty implementation) More...
 
class  MsgEmptyRecvPacked
 non-blocking receive of packed data (empty implementation) More...
 
class  MsgEmptySendArray
 non-blocking send of value array (empty implementation) More...
 
class  MsgEmptySendBase
 base class for non-blocking send (empty implementation) More...
 
class  MsgEmptySendPacked
 non-blocking send of packed data (empty implementation) More...
 
class  MsgExecBase
 message passing base class More...
 
class  OpenmException
 openM++ exceptions More...
 
class  OutputTableWriter
 
struct  ParamDicRow
 parameter_dic join to model_parameter_dic table row. More...
 
class  ParamDicRowAdapter
 
class  ParamDicTable
 
struct  ParamDicTxtLangRow
 parameter_dic_txt join to model_parameter_dic table row and language code. More...
 
struct  ParamDicTxtRow
 parameter_dic_txt join to model_parameter_dic table row. More...
 
class  ParamDicTxtRowAdapter
 
class  ParamDicTxtTable
 
struct  ParamDimsRow
 parameter_dims join to model_parameter_dic table row. More...
 
class  ParamDimsRowAdapter
 
class  ParamDimsTable
 
struct  ParamDimsTxtLangRow
 parameter_dims_txt table row and language code. More...
 
struct  ParamDimsTxtRow
 parameter_dims_txt join to model_parameter_dic table row. More...
 
class  ParamDimsTxtRowAdapter
 
class  ParamDimsTxtTable
 
struct  ParameterNameSizeItem
 model input parameter name, type and size More...
 
class  ParameterReader
 
class  ParameterRunWriter
 
class  ParameterSetWriter
 
class  ParameterWriter
 
struct  ProcessGroupDef
 
struct  ProfileLstRow
 profile_lst table row. More...
 
class  ProfileLstRowAdapter
 
class  ProfileLstTable
 
struct  ProfileOptionRow
 profile_option table row. More...
 
class  ProfileOptionRowAdapter
 
class  ProfileOptionTable
 
class  RestartController
 controller for "restart run": calculate outstanding sub-values for existing run More...
 
class  RootController
 controller for root process: create new model run(s), send input parameters to children and receieve output tables. More...
 
class  RowContainerInserter
 row processor to append rows to sequence container, ie: to list or vector More...
 
struct  RowMpiPackedAdapter
 MPI-based adapter to pack and unpack metadata db row. More...
 
class  RunController
 run controller: create new model run(s) and support data exchange. More...
 
struct  RunGroup
 
struct  RunLstRow
 run_lst table row. More...
 
class  RunLstRowAdapter
 
class  RunLstTable
 
struct  RunOptionRow
 run_option table row. More...
 
class  RunOptionRowAdapter
 
struct  RunOptions
 model run options More...
 
struct  RunOptionsKey
 keys for model run options More...
 
class  RunOptionTable
 
struct  RunParamTxtLangRow
 run_parameter_txt table row and language code. More...
 
struct  RunParamTxtRow
 run_parameter_txt join to model_parameter_dic table row. More...
 
class  RunParamTxtRowAdapter
 
class  RunParamTxtTable
 
struct  RunShortKey
 keys for model run options (short form) More...
 
struct  RunState
 model run state data: status, progress, update times More...
 
class  RunStateHolder
 sub-value run state for all modeling threads, identified by (run id, sub-value id) pair More...
 
struct  RunStateItem
 run state data for sub-value identified by run id and sub-value id More...
 
struct  RunStatus
 model run status codes More...
 
struct  RunTxtRow
 run_txt table row. More...
 
class  RunTxtRowAdapter
 
class  RunTxtTable
 
class  SingleController
 controller for single process: create new model run(s), read input parameters and write output tables. More...
 
struct  TableAccRow
 table_acc table row. More...
 
class  TableAccRowAdapter
 
class  TableAccTable
 
struct  TableAccTxtLangRow
 table_acc_txt table row and language code. More...
 
struct  TableAccTxtRow
 table_acc_txt table row. More...
 
class  TableAccTxtRowAdapter
 
class  TableAccTxtTable
 
struct  TableDicRow
 table_dic table row. More...
 
class  TableDicRowAdapter
 
class  TableDicTable
 
struct  TableDicTxtLangRow
 table_dic_txt table row and language code. More...
 
struct  TableDicTxtRow
 table_dic_txt table row. More...
 
class  TableDicTxtRowAdapter
 
class  TableDicTxtTable
 
struct  TableDimsRow
 table_dims table row. More...
 
class  TableDimsRowAdapter
 
class  TableDimsTable
 
struct  TableDimsTxtLangRow
 table_dims_txt table row and language code. More...
 
struct  TableDimsTxtRow
 table_dims_txt table row. More...
 
class  TableDimsTxtRowAdapter
 
class  TableDimsTxtTable
 
struct  TableExprRow
 table_expr table row. More...
 
class  TableExprRowAdapter
 
class  TableExprTable
 
struct  TableExprTxtLangRow
 table_expr_txt table row and language code. More...
 
struct  TableExprTxtRow
 table_expr_txt table row. More...
 
class  TableExprTxtRowAdapter
 
class  TableExprTxtTable
 
struct  TaskLstRow
 task_lst table row. More...
 
class  TaskLstRowAdapter
 
class  TaskLstTable
 
struct  TaskRunLstRow
 task_run_lst table row. More...
 
class  TaskRunLstRowAdapter
 
class  TaskRunLstTable
 
struct  TaskRunSetRow
 task_run_set table row. More...
 
class  TaskRunSetRowAdapter
 
class  TaskRunSetTable
 
struct  TaskSetRow
 task_set table row. More...
 
class  TaskSetRowAdapter
 
class  TaskSetTable
 
struct  TaskTxtLangRow
 task_txt table row and language code. More...
 
struct  TaskTxtRow
 task_txt table row. More...
 
class  TaskTxtRowAdapter
 
class  TaskTxtTable
 
class  TraceLog
 trace log implementation class: model event log to console and into log files. More...
 
struct  TypeDicRow
 type_dic join to model_type_dic table row. More...
 
class  TypeDicRowAdapter
 
class  TypeDicTable
 
struct  TypeDicTxtLangRow
 type_dic_txt join to model_type_dic table row and language code. More...
 
struct  TypeDicTxtRow
 type_dic_txt join to model_type_dic table row. More...
 
class  TypeDicTxtRowAdapter
 
class  TypeDicTxtTable
 
struct  TypeEnumLstRow
 type_enum_lst join to model_type_dic table row. More...
 
class  TypeEnumLstRowAdapter
 
class  TypeEnumLstTable
 
struct  TypeEnumTxtLangRow
 type_enum_txt join to model_type_dic table row and language code. More...
 
struct  TypeEnumTxtRow
 type_enum_txt join to model_type_dic table row. More...
 
class  TypeEnumTxtRowAdapter
 
class  TypeEnumTxtTable
 
class  ValueFormatter
 converter for value column (parameter, accumulator or expression value) to string More...
 
struct  ValueRow
 value table row: parameter, accumulators or expression tables More...
 
class  ValueRowAdapter
 Row adapter to select row from value table (parameter, accumulator or expression) More...
 
class  ValueRowDigester
 row processor to calculate digest of value table row (parameter, accumulator or expression) More...
 
struct  WorksetLstRow
 workset_lst table row. More...
 
class  WorksetLstRowAdapter
 
class  WorksetLstTable
 
struct  WorksetParamRow
 workset_parameter join to model_parameter_dic table row. More...
 
class  WorksetParamRowAdapter
 
class  WorksetParamTable
 
struct  WorksetParamTxtLangRow
 workset_parameter_txt table row and language code. More...
 
struct  WorksetParamTxtRow
 workset_parameter_txt join to model_parameter_dic table row. More...
 
class  WorksetParamTxtRowAdapter
 
class  WorksetParamTxtTable
 
struct  WorksetTxtLangRow
 workset_txt table row and language code. More...
 
struct  WorksetTxtRow
 workset_txt table row. More...
 
class  WorksetTxtRowAdapter
 
class  WorksetTxtTable
 

Typedefs

typedef void(DbExecSqlite::* SetFieldHandler) (IRowBase *, int, const IRowAdapter &)
 
typedef OpenmException< 4000, msgUnknownErrorMessageMsgException
 messaging library exception
 
typedef map< string, string, LessNoCaseNoCaseMap
 map of key-value strings with case neutral key search
 
typedef set< string, LessNoCaseNoCaseSet
 set of strings with case neutral key search
 
typedef unique_ptr< IRowBaseIRowBaseUptr
 unique pointer to db row
 
typedef vector< IRowBaseUptrIRowBaseVec
 db rows: vector of unique pointers to db row
 
typedef list< IRowBaseUptrIRowBaseList
 db rows: list of unique pointers to db row
 
typedef OpenmException< 4000, dbUnknownErrorMessageDbException
 db-exception
 
typedef OpenmException< 4000, helperUnknownErrorMessageHelperException
 helper library exception
 
typedef OpenmException< 4000, modelUnknownErrorMessageModelException
 modeling library exception
 
typedef OpenmException< 4000, simulationUnknownErrorMessageSimulationException
 simulation exception
 

Enumerations

enum  CharCvtFrom {
  CharCvtFrom::defaultPage, CharCvtFrom::explicitPage, CharCvtFrom::utf8, CharCvtFrom::utf16Le,
  CharCvtFrom::utf16Be, CharCvtFrom::utf32Le, CharCvtFrom::utf32Be
}
 character conversion from current encoding to UTF-8 More...
 
enum  FncCode {
  FncCode::undefined = 0, FncCode::avg, FncCode::sum, FncCode::count,
  FncCode::min, FncCode::max, FncCode::var, FncCode::sd,
  FncCode::se, FncCode::cv
}
 aggregation function code More...
 
enum  MsgTag {
  MsgTag::unused = 0, MsgTag::statusUpdate, MsgTag::initial, MsgTag::langLst = 32,
  MsgTag::langWord, MsgTag::modelDic, MsgTag::typeDic, MsgTag::typeEnumLst,
  MsgTag::parameterDic, MsgTag::parameterDims, MsgTag::tableDic, MsgTag::tableDims,
  MsgTag::tableAcc, MsgTag::tableExpr, MsgTag::groupLst, MsgTag::groupPc,
  MsgTag::runOption, MsgTag::codeValue, MsgTag::outSubValueBase = 128
}
 tag to identify message content More...
 
enum  ExitStatus : int {
  ExitStatus::OK = 0, ExitStatus::FAIL = 1, ExitStatus::HELPER_ERROR = 4, ExitStatus::MSG_ERROR = 8,
  ExitStatus::DB_ERROR = 12, ExitStatus::MODEL_ERROR = 16, ExitStatus::SIMULATION_ERROR = 32
}
 model exit status More...
 
enum  ModelStatus : int {
  ModelStatus::undefined = 0, ModelStatus::init = 1, ModelStatus::progress, ModelStatus::waitProgress,
  ModelStatus::shutdown, ModelStatus::done = 64, ModelStatus::exit, ModelStatus::error = 128
}
 modeling job status More...
 

Functions

uint32_t calculateNextCrc32 (uint32_t i_initialCrc, const void *i_data, size_t i_dataSize)
 calculate CRC-32 on next data block of bytes
 
string crc32String (const string &i_source)
 return CRC-32 of source string
 
bool isFileExists (const char *i_filePath)
 return true if file or directory exists
 
const string baseDirOf (const string &i_path)
 return base directory of the path or empty string if no / or \ in the path. More...
 
const string baseDirOf (const char *i_path)
 return base directory of the path or empty string if no / or \ in the path. More...
 
const string makeDefaultPath (const char *i_exePath, const char *i_extension)
 make path from current working directory, executable name and specified extension. More...
 
string const makeFilePath (const char *i_dirPath, const char *i_name, const char *i_extension=nullptr)
 make path by join directory, file name and specified extension. More...
 
const string toUtf8 (const char *i_byteArr, const char *i_codePageName=nullptr)
 convert null-terminated bytes from current user (or specified) code page to UTF-8 string. More...
 
const string toUtf8 (size_t i_size, const char *i_byteArr, const char *i_codePageName=nullptr)
 convert bytes from current user (or specified) code page to UTF-8 string. More...
 
bool isUtf8 (size_t i_size, const char *i_byteArr)
 return true if bytes are valid UTF-8 More...
 
const string fileToUtf8 (const char *i_filePath, const char *i_codePageName=nullptr)
 read file and return content as UTF-8 as string More...
 
const list< string > fileToUtf8Lines (const char *i_filePath, const char *i_codePageName=nullptr)
 read file, split by linefeed
and return content as list of UTF-8 as strings More...
 
void toLower (string &io_str, const locale &i_locale=locale(""))
 convert string to lower case
 
void toLower (char *io_str, const locale &i_locale=locale(""))
 convert string to lower case
 
void toUpper (string &io_str, const locale &i_locale=locale(""))
 convert string to upper case
 
void toUpper (char *io_str, const locale &i_locale=locale(""))
 convert string to upper case
 
int compareNoCase (const char *i_left, const char *i_right, size_t i_length=0)
 case neutral string comparison
 
bool equalNoCase (const char *i_left, const char *i_right, size_t i_length=0)
 case neutral string equal comparison
 
bool startWithNoCase (const string &i_str, const char *i_start)
 check if string start with i_start, using case neutral string comparison
 
bool endWithNoCase (const string &i_str, const char *i_end)
 check if string end with i_end, using case neutral string comparison
 
string trimLeft (const string &i_str, const locale &i_locale=locale(""))
 trim leading blank and space characters
 
string trimRight (const string &i_str, const locale &i_locale=locale(""))
 trim trailing blank and space characters
 
string trim (const string &i_str, const locale &i_locale=locale(""))
 trim leading and trailing blank and space characters
 
void blankCrLf (string &io_str)
 replace all <cr> or <lf> with blank space character
 
const string toQuoted (const string &i_str, char i_quote='\'')
 make quoted string using sql single ' quote by default, ie: 'O''Brien'
 
const string toUnQuoted (const string &i_str, char i_quote='\'', const locale &i_locale=locale(""))
 make unquoted string using sql single ' quote by default, ie: 'O''Brien' into O'Brien
 
const string toString (double i_val)
 convert float type to string: exist to fix std::to_string conversion losses. More...
 
const string toAlphaNumeric (const string &i_str, int i_maxSize=0)
 replace all non [A-Z,a-z,0-9] by _ underscore and remove repetitive underscores. More...
 
const string replaceAll (const string &i_src, const char *i_oldValue, const char *i_newValue)
 replace all occurence of i_oldValue by i_newValue, both old and new values must be not empty
 
const string makeDateTime (const chrono::system_clock::time_point &i_time)
 make date-time string, ie: 2012-08-17 16:04:59.148
 
const string makeTimeStamp (const chrono::system_clock::time_point &i_time)
 make timestamp string, ie: 2012_08_17_16_04_59_148
 
const string toDateTimeString (const string &i_timestamp)
 make date-time string from timestamp string, ie: 2012_08_17_16_04_59_148 => 2012-08-17 16:04:59.148
 
void formatTo (size_t i_size, char *io_buffer, const char *i_format, va_list io_args)
 format message into supplied buffer using vsnprintf()
 
const char * elliptString (const char *i_src, size_t i_size, char *io_buffer)
 if source string exceed max size than return ellipted copy into the buffer
 
string regexReplace (const string &i_srcText, const char *i_pattern, const char *i_replaceWith)
 
const string normalizeLanguageName (const string &i_srcLanguage)
 normalize language name by removing encoding part, replace _ by - and lower case: "en-ca" from "en_CA.UTF-8"
 
const list< string > splitLanguageName (const string &i_srcLanguage)
 normalize language name and split it into list of prefered languages: en_CA => [en-ca, en]
 
const string getDefaultLocaleName (void)
 get user prefered locale name: en-CA en-CA or empty "" string on error
 
list< string > splitCsv (const string &i_values, const char *i_delimiters=",", bool i_isUnquote=false, char i_quote='\'')
 split and trim comma-separated list of values (other delimiters can be used too, ie: semicolon). More...
 
void splitCsv (const string &i_values, list< string > &io_resultLst, const char *i_delimiters=",", bool i_isUnquote=false, char i_quote='\'', const locale &i_locale=locale(""))
 split and trim comma-separated list of values (other delimiters can be used too, ie: semicolon). More...
 
template<typename TVal >
vector< TVal > read_om_parameter (IRunBase *const i_runBase, const char *i_name)
 read scalar parameter value or all sub-values for the current process
 
template<typename TVal >
vector< unique_ptr< TVal[]> > read_om_parameter (IRunBase *const i_runBase, const char *i_name, size_t i_size)
 read array parameter value or all sub-values for the current process
 

Variables

recursive_mutex dbMutex
 mutex to lock database operations
 
const char msgUnknownErrorMessage [] = "unknown messaging error"
 messaging library default error message: "unknown messaging error"
 
recursive_mutex msgMutex
 mutex to lock messaging operations
 
const char * SQLITE_DB_PROVIDER = "sqlite"
 SQLite db-provider name.
 
const char * MYSQL_DB_PROVIDER = "mysql"
 MySQL and MariaDB db-provider name.
 
const char * PGSQL_DB_PROVIDER = "postgresql"
 PostgreSQL db-provider name.
 
const char * MSSQL_DB_PROVIDER = "mssql"
 MS SQL db-provider name.
 
const char * ORACLE_DB_PROVIDER = "oracle"
 Oracle db-provider name.
 
const char * DB2_DB_PROVIDER = "db2"
 DB2 db-provider name.
 
const char dbUnknownErrorMessage [] = "unknown db error"
 db-exception default error message: "unknown db error"
 
const char helperUnknownErrorMessage [] = "unknown error in helper method"
 helper library exception default error message: "unknown error in helper method" More...
 
const size_t PARAMETER_NAME_ARR_LEN
 size of parameters list: number of model input parameters
 
const ParameterNameSizeItem parameterNameSizeArr []
 model input parameters name, type and size
 
const char modelUnknownErrorMessage [] = "unknown model error"
 default error message: "unknown model error" More...
 
const char simulationUnknownErrorMessage [] = "unknown error in simulation"
 simulation exception default error message: "unknown error in simulation" More...
 

Detailed Description

openM++ namespace

false boolean value as string

Enumeration Type Documentation

◆ CharCvtFrom

enum openm::CharCvtFrom
strong

character conversion from current encoding to UTF-8

Enumerator
defaultPage 

current user code page (encoding)

explicitPage 

code page (encoding) specified by name

utf8 

UTF-8.

utf16Le 

UTF-16LE.

utf16Be 

UTF-16LE.

utf32Le 

UTF-16LE.

utf32Be 

UTF-16LE.

◆ ExitStatus

enum openm::ExitStatus : int
strong

model exit status

Enumerator
OK 

completed successfully

FAIL 

unknown error

HELPER_ERROR 

helper exception: low level error from openM++ runtime

MSG_ERROR 

messaging exception: message passing (MPI) error

DB_ERROR 

database exception: database error from openM++ runtime or database vendor

MODEL_ERROR 

model exception: top level error from openM++ runtime

SIMULATION_ERROR 

simulation exception raised in model code

◆ FncCode

enum openm::FncCode
strong

aggregation function code

Enumerator
undefined 

undefined aggregation function

avg 

average value

sum 

sum of values

count 

count of values

min 

minimal value

max 

maximum value

var 

variance

sd 

standard deviation

se 

standard error

cv 

coefficient of variation

◆ ModelStatus

enum openm::ModelStatus : int
strong

modeling job status

Enumerator
undefined 

unknown status

init 

initial status

progress 

run in progress

waitProgress 

run in progress, under external supervision

shutdown 

shutdown model process

done 

completed successfully

exit 

exit and not completed (reserved)

error 

error failure

◆ MsgTag

enum openm::MsgTag
strong

tag to identify message content

Enumerator
unused 

reserved and should not be used

statusUpdate 

modeling job status

initial 

initial message at process start

langLst 

lang_lst db rows

langWord 

lang_word db rows

modelDic 

model_dic db rows

typeDic 

type_dic db rows

typeEnumLst 

type_enum_lst db rows

parameterDic 

parameter_dic db rows

parameterDims 

parameter_dims db rows

tableDic 

table_dic db rows

tableDims 

table_dims db rows

tableAcc 

table_acc db rows

tableExpr 

table_expr db rows

groupLst 

group_lst db rows

groupPc 

group_pc db rows

runOption 

run_option db rows

codeValue 

generic (code,value) db rows

outSubValueBase 

input parameter

output table sub-value base

Function Documentation

◆ baseDirOf() [1/2]

const string openm::baseDirOf ( const string &  i_path)

return base directory of the path or empty string if no / or \ in the path.

For example: C:.exe => C:
It is very primitive function and results incorrect if: "special\ path" => "special

◆ baseDirOf() [2/2]

const string openm::baseDirOf ( const char *  i_path)

return base directory of the path or empty string if no / or \ in the path.

◆ fileToUtf8()

const string openm::fileToUtf8 ( const char *  i_filePath,
const char *  i_codePageName = nullptr 
)

read file and return content as UTF-8 as string

read file and return content as UTF-8 as string.

Parameters
[in]i_filePathpath to the file
[in]i_codePageName(optional) name of encoding or Windows code page, ie: English_US.1252
Returns
file content as UTF-8 string.

◆ fileToUtf8Lines()

const list< string > openm::fileToUtf8Lines ( const char *  i_filePath,
const char *  i_codePageName = nullptr 
)

read file, split by linefeed
and return content as list of UTF-8 as strings

read file, split by linefeed
and return content as list of UTF-8 as strings.

Parameters
[in]i_filePathpath to the file
[in]i_codePageName(optional) name of encoding or Windows code page, ie: English_US.1252
Returns
file content as UTF-8 string.

◆ isUtf8()

bool openm::isUtf8 ( size_t  i_size,
const char *  i_byteArr 
)

return true if bytes are valid UTF-8

return true if bytes are valid UTF-8.

See table in Description section of article https://en.wikipedia.org/wiki/UTF-8

Parameters
[in]i_sizenumber of bytes to convert
[in]i_byteArrsource bytes
Returns
true if valid UTF-8.

◆ makeDefaultPath()

const string openm::makeDefaultPath ( const char *  i_exePath,
const char *  i_extension 
)

make path from current working directory, executable name and specified extension.

Parameters
i_exePathfull pathname of the executable file.
i_extensionnew file extension.
Returns
path combined as current working directory, executable name and specified extension.

For example: C:.exe => D:.log

◆ makeFilePath()

const string openm::makeFilePath ( const char *  i_dirPath,
const char *  i_name,
const char *  i_extension = nullptr 
)

make path by join directory, file name and specified extension.

Parameters
i_dirPathpath or directory.
i_namefile name.
i_extensionfile extension, if not a null.
Returns
path combined as directory/name.extension

It does replace all \ with / even in "special\ path/", except of leading \ slashes For example: input\ ageSex csv => input/ageSex.csv \host ageSex.csv => \host/share.ageSex.csv

◆ splitCsv() [1/2]

list< string > openm::splitCsv ( const string &  i_values,
const char *  i_delimiters = ",",
bool  i_isUnquote = false,
char  i_quote = '\'' 
)

split and trim comma-separated list of values (other delimiters can be used too, ie: semicolon).

RFC 4180 difference: it does skip space-only lines and trim values unless it is " quoted ".

Parameters
[in]i_valuessource string of comma separated values.
[in]i_delimiterslist of delimiters, default: comma.
[in]i_isUnquoteif true then do "unquote ""csv"" ", default: false.
[in]i_quotequote character, default: sql single ' quote.

RFC 4180 difference: skip space-only lines, trim values unless it is " quoted ", line can end with CRLF or LF, multi-line strings not supported.

Parameters
[in]i_valuessource string of comma separated values.
[in]i_delimiterslist of delimiters, default: comma.
[in]i_isUnquoteif true then do "unquote ""csv"" ", default: false.
[in]i_quotequote character, default: sql single ' quote.

◆ splitCsv() [2/2]

void openm::splitCsv ( const string &  i_values,
list< string > &  io_resultLst,
const char *  i_delimiters = ",",
bool  i_isUnquote = false,
char  i_quote = '\'',
const locale &  i_locale = locale("") 
)

split and trim comma-separated list of values (other delimiters can be used too, ie: semicolon).

RFC 4180 difference: it does skip space-only lines and trim values unless it is " quoted ".

Parameters
[in]i_valuessource string of comma separated values.
[in,out]io_resultLstsource string of comma separated values.
[in]i_delimiterslist of delimiters, default: comma.
[in]i_isUnquoteif true then do "unquote ""csv"" ", default: false.
[in]i_quotequote character, default: sql single ' quote.
[in]i_localelocale to trim space characters, defaut: user default locale.

◆ toAlphaNumeric()

const string openm::toAlphaNumeric ( const string &  i_str,
int  i_maxSize = 0 
)

replace all non [A-Z,a-z,0-9] by _ underscore and remove repetitive underscores.

◆ toString()

const string openm::toString ( double  i_val)

convert float type to string: exist to fix std::to_string conversion losses.

◆ toUtf8() [1/2]

const string openm::toUtf8 ( const char *  i_byteArr,
const char *  i_codePageName = nullptr 
)

convert null-terminated bytes from current user (or specified) code page to UTF-8 string.

Parameters
[in]i_byteArrsource bytes
[in]i_codePageName(optional) name of encoding or Windows code page, ie: English_US.1252
Returns
UTF-8 string.

◆ toUtf8() [2/2]

const string openm::toUtf8 ( size_t  i_size,
const char *  i_byteArr,
const char *  i_codePageName = nullptr 
)

convert bytes from current user (or specified) code page to UTF-8 string.

Parameters
[in]i_sizenumber of bytes to convert
[in]i_byteArrsource bytes
[in]i_codePageName(optional) name of encoding or Windows code page, ie: English_US.1252
Returns
UTF-8 string.

Variable Documentation

◆ helperUnknownErrorMessage

const char openm::helperUnknownErrorMessage = "unknown error in helper method"

helper library exception default error message: "unknown error in helper method"

helper exception default error message

◆ modelUnknownErrorMessage

const char openm::modelUnknownErrorMessage = "unknown model error"

default error message: "unknown model error"

model exception default error message

◆ simulationUnknownErrorMessage

const char openm::simulationUnknownErrorMessage = "unknown error in simulation"

simulation exception default error message: "unknown error in simulation"

simulation exception default error message