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

Public Member Functions

 RunOptionTable (IDbExec *i_dbExec, int i_runId=0)
 
 RunOptionTable (IRowBaseVec &io_rowVec)
 
const IRowBaseVecrowsCRef (void) const override
 get const reference to list of all table rows. More...
 
IRowBaseVecrowsRef (void) override
 get reference to list of all table rows. More...
 
const RunOptionRowbyKey (int i_runId, const string &i_key) const override
 binary search row by primary key: run id and option key, return NULL if not found. More...
 
bool isExist (int i_runId, const char *i_key) const noexcept override
 return true if primary key (run id, option key) found. More...
 
string strValue (int i_runId, const char *i_key, const string &i_default="") const noexcept override
 return string value by primary key (run id, option key) or default value if not found. More...
 
bool boolValue (int i_runId, const char *i_key) const noexcept override
 return boolean value by primary key (run id, option key) or false if not found or value not "yes", "1", "true" or empty "" string. More...
 
int boolValueToInt (int i_runId, const char *i_key) const noexcept override
 search for boolean value by primary key (run id, option 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...
 
int intValue (int i_runId, const char *i_key, int i_default) const noexcept override
 return int value by primary key (run id, option key) or default if not found or can not be converted to int. More...
 
long long longValue (int i_runId, const char *i_key, long long i_default) const noexcept override
 return long value by primary key (run id, option key) or default if not found or can not be converted to long. More...
 
double doubleValue (int i_runId, const char *i_key, double i_default) const noexcept override
 return double value by primary key (run id, option key) or default if not found or can not be converted to double. More...
 
virtual const RunOptionRowbyKey (int i_runId, const string &i_key) const =0
 binary search row by primary key: run id and option key, return NULL if not found. More...
 
virtual bool isExist (int i_runId, const char *i_key) const noexcept=0
 return true if primary key (run id, option key) found. More...
 
virtual string strValue (int i_runId, const char *i_key, const string &i_default="") const noexcept=0
 return string value by primary key (run id, option key) or default value if not found. More...
 
virtual bool boolValue (int i_runId, const char *i_key) const noexcept=0
 return boolean value by primary key (run id, option key) or false if not found or value not "yes", "1", "true" or empty "" string. More...
 
virtual int boolValueToInt (int i_runId, const char *i_key) const noexcept=0
 search for boolean value by primary key (run id, option 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 intValue (int i_runId, const char *i_key, int i_default) const noexcept=0
 return int value by primary key (run id, option key) or default if not found or can not be converted to int. More...
 
virtual long long longValue (int i_runId, const char *i_key, long long i_default) const noexcept=0
 return long value by primary key (run id, option key) or default if not found or can not be converted to long. More...
 
virtual double doubleValue (int i_runId, const char *i_key, double i_default) const noexcept=0
 return double value by primary key (run id, option key) or default if not found or can not be converted to double. More...
 
virtual IRowBaseVecrowsRef (void)=0
 get reference to list of all table rows. More...
 
- Public Member Functions inherited from openm::IMetaLoadedTable< RunOptionRow >
virtual const IRowBaseVecrowsCRef (void) const=0
 get const reference to list of all table rows. More...
 
virtual IRowBaseVecrowsRef (void)=0
 get reference to list of all table rows. More...
 
IRowBaseVec::difference_type rowCount (void) const
 return number of rows.
 
vector< RunOptionRowrows (void) const
 get list of loaded table rows.
 
const RunOptionRowfirstRow (void) const
 return first table row or NULL if table is empty.
 
vector< RunOptionRowfindAll (RowEqual i_cmp) const
 get list of rows by predicate: all rows where comparator to i_row return true.
 
const RunOptionRowfindFirst (RowEqual i_cmp) const
 get first row by predicate or NULL if not found: first row where comparator to i_row return true.
 
const RunOptionRowbyIndex (IRowBaseVec::difference_type i_index) const
 return row value by index or NULL if out of range.
 
IRowBaseVec::difference_type indexOf (RowEqual i_cmp, IRowBaseVec::difference_type i_startPos=0) const
 get first row by predicate or -1 if not found: first row where comparator to i_row return true.
 
IRowBaseVec::size_type countOf (RowEqual i_cmp) const
 count rows by predicate: where comparator to i_row return true.
 

Additional Inherited Members

- Public Types inherited from openm::IMetaLoadedTable< RunOptionRow >
typedef function< bool(const RunOptionRow &i_dbRow)> RowEqual
 db table row comparator.
 
- Static Public Member Functions inherited from openm::IRunOptionTable
static IRunOptionTablecreate (IDbExec *i_dbExec, int i_runId=0)
 create new table object and load table rows sorted by primary key: run id and option key. More...
 
static IRunOptionTablecreate (IRowBaseVec &io_rowVec)
 create new table rows by swap with supplied vector of rows.
 
- Protected Member Functions inherited from openm::IMetaLoadedTable< RunOptionRow >
const RunOptionRowfindKey (const IRowBaseUptr &i_row) const
 binary search row by primary key, return NULL if not found.
 
- Static Protected Member Functions inherited from openm::IMetaLoadedTable< RunOptionRow >
static IRowBaseVec load (const string &i_sqlSelect, IDbExec *i_dbExec, const IRowAdapter &i_adapter)
 load table: return vector of selected rows sorted by primary key.
 
- Static Protected Member Functions inherited from openm::IMetaTable< RunOptionRow >
static vector< RunOptionRowrows (const IRowBaseVec &i_rowVec)
 get list of table rows.
 

Member Function Documentation

◆ boolValue()

bool openm::RunOptionTable::boolValue ( int  i_runId,
const char *  i_key 
) const
inlineoverridevirtualnoexcept

return boolean value by primary key (run id, option key) or false if not found or value not "yes", "1", "true" or empty "" string.

Implements openm::IRunOptionTable.

◆ boolValueToInt()

int RunOptionTable::boolValueToInt ( int  i_runId,
const char *  i_key 
) const
overridevirtualnoexcept

search for boolean value by primary key (run id, option 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.

Implements openm::IRunOptionTable.

◆ byKey()

const RunOptionRow * RunOptionTable::byKey ( int  i_runId,
const string &  i_key 
) const
overridevirtual

binary search row by primary key: run id and option key, return NULL if not found.

Implements openm::IRunOptionTable.

◆ doubleValue()

double RunOptionTable::doubleValue ( int  i_runId,
const char *  i_key,
double  i_default 
) const
overridevirtualnoexcept

return double value by primary key (run id, option key) or default if not found or can not be converted to double.

Implements openm::IRunOptionTable.

◆ intValue()

int RunOptionTable::intValue ( int  i_runId,
const char *  i_key,
int  i_default 
) const
overridevirtualnoexcept

return int value by primary key (run id, option key) or default if not found or can not be converted to int.

Implements openm::IRunOptionTable.

◆ isExist()

bool RunOptionTable::isExist ( int  i_runId,
const char *  i_key 
) const
overridevirtualnoexcept

return true if primary key (run id, option key) found.

Implements openm::IRunOptionTable.

◆ longValue()

long long RunOptionTable::longValue ( int  i_runId,
const char *  i_key,
long long  i_default 
) const
overridevirtualnoexcept

return long value by primary key (run id, option key) or default if not found or can not be converted to long.

Implements openm::IRunOptionTable.

◆ rowsCRef()

const IRowBaseVec & openm::RunOptionTable::rowsCRef ( void  ) const
inlineoverridevirtual

get const reference to list of all table rows.

Implements openm::IMetaLoadedTable< RunOptionRow >.

◆ rowsRef()

IRowBaseVec & openm::RunOptionTable::rowsRef ( void  )
inlineoverridevirtual

get reference to list of all table rows.

Implements openm::IRunOptionTable.

◆ strValue()

string RunOptionTable::strValue ( int  i_runId,
const char *  i_key,
const string &  i_default = "" 
) const
overridevirtualnoexcept

return string value by primary key (run id, option key) or default value if not found.

Implements openm::IRunOptionTable.


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