OpenM++ runtime library (libopenm)
openm::ParameterRunWriter Class Reference
Inheritance diagram for openm::ParameterRunWriter:
Collaboration diagram for openm::ParameterRunWriter:

Public Member Functions

 ParameterRunWriter (int i_runId, const char *i_name, IDbExec *i_dbExec, const MetaHolder *i_metaStore, const char *i_doubleFormat="")
 
virtual size_t sizeOf (void) const noexcept override
 return input parameter size for single sub value More...
 
void writeParameter (IDbExec *i_dbExec, const type_info &i_type, int i_subCount, size_t i_size, void *i_valueArr) override
 write parameter: write all sub values of the parameter into db run table More...
 
virtual void loadCsvParameter (IDbExec *i_dbExec, const vector< int > &i_subIdArr, const char *i_filePath, bool i_isIdCsv=false) override
 load parameter values from csv file into run table, it can be any of: .csv .tsv .id.csv .id.tsv file. More...
 
void digestParameter (IDbExec *i_dbExec, int i_subCount, const type_info &i_type) override
 calculate run parameter values digest and store only single copy of parameter values. More...
 
- Public Member Functions inherited from openm::ParameterWriter
 ParameterWriter (const char *i_name, IDbExec *i_dbExec, const MetaHolder *i_metaStore)
 
virtual size_t sizeOf (void) const noexcept=0
 return input parameter size for single sub value More...
 
virtual void writeParameter (IDbExec *i_dbExec, const type_info &i_type, int i_subCount, size_t i_size, void *i_valueArr)=0
 write parameter: write all sub values of the parameter into db run table More...
 
virtual void loadCsvParameter (IDbExec *i_dbExec, const vector< int > &i_subIdArr, const char *i_filePath, bool i_isIdCsv=false)=0
 load parameter values from csv file into run table, it can be any of: .csv .tsv .id.csv .id.tsv file. More...
 
virtual void digestParameter (IDbExec *i_dbExec, int i_subCount, const type_info &i_type)=0
 calculate run parameter values digest and store only single copy of parameter values. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from openm::IParameterRunWriter
static IParameterRunWritercreate (int i_runId, const char *i_name, IDbExec *i_dbExec, const MetaHolder *i_metaStore, const char *i_doubleFormat="")
 input parameter writer factory
 
- Protected Member Functions inherited from openm::ParameterWriter
void writeParameter (IDbExec *i_dbExec, bool i_isToRun, int i_dstId, const type_info &i_type, int i_subCount, size_t i_valueLen, void *i_valueArr)
 
- Protected Attributes inherited from openm::ParameterWriter
int modelId
 
int paramId
 
int dimCount
 
size_t totalSize
 
vector< int > dimSizeVec
 
const ParamDicRowparamRow
 
const TypeDicRowparamTypeRow
 
vector< TypeEnumLstRowparamEnums
 
vector< ParamDimsRowparamDims
 
vector< vector< TypeEnumLstRow > > dimEnums
 

Member Function Documentation

◆ digestParameter()

void ParameterRunWriter::digestParameter ( IDbExec i_dbExec,
int  i_subCount,
const type_info &  i_type 
)
overridevirtual

calculate run parameter values digest and store only single copy of parameter values.

Parameters
[in]i_dbExecdatabase connection
[in]i_subCountnumber of parameter sub-values
[in]i_typeparameter type, use char * for string parameters

Implements openm::IParameterRunWriter.

◆ loadCsvParameter()

void ParameterRunWriter::loadCsvParameter ( IDbExec i_dbExec,
const vector< int > &  i_subIdArr,
const char *  i_filePath,
bool  i_isIdCsv = false 
)
overridevirtual

load parameter values from csv file into run table, it can be any of: .csv .tsv .id.csv .id.tsv file.

Parameters
[in]i_dbExecdatabase connection
[in]i_subIdArrsub-value id's to select from csv
[in]i_filePathpath to parameter.csv file, it can be any of: .csv .tsv .id.csv .id.tsv file.
[in]i_isIdCsvif true then create csv file contains enum id's, default: enum code

if file extension .tsv then it is a tab separated file, by default comma separated file expected. if i_isIdCsv is true or file extension is .id.csv or .id.tsv then file contains enum id's, by default enum codes expected

Implements openm::IParameterRunWriter.

◆ sizeOf()

virtual size_t openm::ParameterRunWriter::sizeOf ( void  ) const
inlineoverridevirtualnoexcept

return input parameter size for single sub value

Implements openm::IParameterRunWriter.

◆ writeParameter()

void ParameterRunWriter::writeParameter ( IDbExec i_dbExec,
const type_info &  i_type,
int  i_subCount,
size_t  i_size,
void *  i_valueArr 
)
overridevirtual

write parameter: write all sub values of the parameter into db run table

Parameters
[in]i_dbExecdatabase connection
[in]i_typeparameter value type, use std::string for string parameters
[in]i_subCountnumber of parameter sub-values
[in]i_sizeparameter size for single sub value
[in,out]i_valueArrarray of parameter values, size must be == i_size * i_subCount

Implements openm::IParameterRunWriter.


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