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
 

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  KindSubIds : int {
  none = 0, single = 1, defaultId = 2, range =3,
  list = 4
}
 
enum  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. More...
 
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. More...
 

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
 
map< int, ParamSubOptssubOptsMap
 
map< string, ImportOptsimportOptsMap
 
map< int, ParamImportOptsparamImportOptsMap
 

Detailed Description

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

Constructor & Destructor Documentation

◆ MetaLoader()

openm::MetaLoader::MetaLoader ( const ArgReader i_argStore)
inlineprotected

create metadata loader.

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

◆ setArgOpt()

void openm::MetaLoader::setArgOpt ( const string &  i_key,
const string &  i_value 
)
inlineprotected

insert new or update existing argument option.


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