OpenM++ runtime library (libopenm)
openm::MetaLoader Class Referenceabstract

model metadata loader: read and broadcast metadata and run options. More...

Inheritance diagram for openm::MetaLoader:

Classes

struct  ImportOpts
 
struct  ParamImportOpts
 
struct  ParamSubOpts
 
struct  RunImportOpts
 

Public Member Functions

virtual ~MetaLoader (void) noexcept=0
 last cleanup
 
const ArgReaderargOpts (void) const
 arguments from command line and ini-file
 
const MetaHoldermeta (void) const
 model metadata tables
 
const RunOptions modelRunOptions (int i_subCount, int i_subId) const
 return basic model run options
 
int parameterSubCount (int i_paramId) const
 return sub-values count by parameter id
 
int parameterIdByName (const char *i_name) const
 return index of parameter by name More...
 
int tableIdByName (const char *i_name) const
 return id of output table by name
 
bool isSuppressed (const char *i_name) const
 check by name if output table suppressed
 
bool isSuppressed (int i_tableId) const
 check by id if output table suppressed
 

Static Public Member Functions

static const ArgReader getRunOptions (int argc, char **argv)
 initialize run options from command line and ini-file More...
 

Public Attributes

int subValueCount
 total number of sub-values
 
int threadCount
 max number of modeling threads
 

Protected Types

enum class  KindSubIds : int {
  none = 0 , single = 1 , defaultId = 2 , range =3 ,
  list = 4
}
 
enum class  ImportKind : int {
  none = 0 , modelName = 1 , modelId = 2 , modelDigest = 3 ,
  runName = 4 , runId = 5 , runDigest = 6
}
 

Protected Member Functions

 MetaLoader (const ArgReader &i_argStore)
 create metadata loader.
 
const RunOptionsmodelRunOptions (void) const
 return basic model run options
 
void setRunOptions (const RunOptions &i_opts)
 set basic model run options
 
void loadMessages (IDbExec *i_dbExec)
 read model messages from database. More...
 
void mergeOptions (IDbExec *i_dbExec)
 merge command line and ini-file arguments with profile_option table values. More...
 
void setArgOpt (const string &i_key, const string &i_value)
 insert new or update existing argument option.
 

Static Protected Member Functions

static int readMetaTables (IDbExec *i_dbExec, MetaHolder *io_metaStore, const char *i_name, const char *i_digest)
 

Protected Attributes

int modelId
 
unique_ptr< MetaHoldermetaStore
 
vector< int > paramIdSubArr
 
vector< int > tableIdSuppressArr
 
map< int, ParamSubOptssubOptsMap
 
map< string, ImportOptsimportOptsMap
 
map< int, ParamImportOptsparamImportOptsMap
 
map< int, pair< string, string > > langOptsMap
 

Detailed Description

model metadata loader: read and broadcast metadata and run options.

Member Function Documentation

◆ getRunOptions()

const ArgReader MetaLoader::getRunOptions ( int  argc,
char **  argv 
)
static

initialize run options from command line and ini-file

initialize run options from command line and ini-file.

◆ loadMessages()

void MetaLoader::loadMessages ( IDbExec i_dbExec)
protected

read model messages from database.

User preferd language determined by simple match, for example: if user language is en_CA.UTF-8 then search done for lower case ["en-ca", "en", "model-default-language"].

◆ mergeOptions()

void MetaLoader::mergeOptions ( IDbExec i_dbExec)
protected

merge command line and ini-file arguments with profile_option table values.

  • use default values for basic run options, i.e. SparseOutput = false
  • validate scalar parameter value option, eg: Parameter.Age 42
  • parse parameter sub-values options, eg: SubFrom.Age csv SubValues.Age 8 SubValues.Sex default
  • parse parameter import options
  • parse output tables suppress options

◆ parameterIdByName()

int MetaLoader::parameterIdByName ( const char *  i_name) const

return index of parameter by name

return id of parameter by name


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