OpenM++ runtime library (libopenm)
openm::IMetaLoadedTable< TRow > Struct Template Referenceabstract

base class for preloaded metadata db-tables More...

Inheritance diagram for openm::IMetaLoadedTable< TRow >:
Collaboration diagram for openm::IMetaLoadedTable< TRow >:

Public Types

typedef function< bool(const TRow &i_dbRow)> RowEqual
 db table row comparator. More...
 

Public Member Functions

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. More...
 
vector< TRow > rows (void) const
 get list of loaded table rows. More...
 
const TRow * firstRow (void) const
 return first table row or NULL if table is empty. More...
 
vector< TRow > findAll (RowEqual i_cmp) const
 get list of rows by predicate: all rows where comparator to i_row return true. More...
 
const TRow * findFirst (RowEqual i_cmp) const
 get first row by predicate or NULL if not found: first row where comparator to i_row return true. More...
 
const TRow * byIndex (IRowBaseVec::difference_type i_index) const
 return row value by index or NULL if out of range. More...
 
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. More...
 
IRowBaseVec::size_type countOf (RowEqual i_cmp) const
 count rows by predicate: where comparator to i_row return true. More...
 

Protected Member Functions

const TRow * findKey (const IRowBaseUptr &i_row) const
 binary search row by primary key, return NULL if not found. More...
 

Static Protected Member Functions

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. More...
 
- Static Protected Member Functions inherited from openm::IMetaTable< TRow >
static vector< TRow > rows (const IRowBaseVec &i_rowVec)
 get list of table rows. More...
 

Detailed Description

template<class TRow>
struct openm::IMetaLoadedTable< TRow >

base class for preloaded metadata db-tables

Member Typedef Documentation

◆ RowEqual

template<class TRow>
typedef function<bool(const TRow & i_dbRow)> openm::IMetaLoadedTable< TRow >::RowEqual

db table row comparator.

Member Function Documentation

◆ byIndex()

template<class TRow>
const TRow* openm::IMetaLoadedTable< TRow >::byIndex ( IRowBaseVec::difference_type  i_index) const
inline

return row value by index or NULL if out of range.

◆ countOf()

template<class TRow>
IRowBaseVec::size_type openm::IMetaLoadedTable< TRow >::countOf ( RowEqual  i_cmp) const
inline

count rows by predicate: where comparator to i_row return true.

◆ findAll()

template<class TRow>
vector<TRow> openm::IMetaLoadedTable< TRow >::findAll ( RowEqual  i_cmp) const
inline

get list of rows by predicate: all rows where comparator to i_row return true.

◆ findFirst()

template<class TRow>
const TRow* openm::IMetaLoadedTable< TRow >::findFirst ( RowEqual  i_cmp) const
inline

get first row by predicate or NULL if not found: first row where comparator to i_row return true.

◆ findKey()

template<class TRow>
const TRow* openm::IMetaLoadedTable< TRow >::findKey ( const IRowBaseUptr i_row) const
inlineprotected

binary search row by primary key, return NULL if not found.

◆ firstRow()

template<class TRow>
const TRow* openm::IMetaLoadedTable< TRow >::firstRow ( void  ) const
inline

return first table row or NULL if table is empty.

◆ indexOf()

template<class TRow>
IRowBaseVec::difference_type openm::IMetaLoadedTable< TRow >::indexOf ( RowEqual  i_cmp,
IRowBaseVec::difference_type  i_startPos = 0 
) const
inline

get first row by predicate or -1 if not found: first row where comparator to i_row return true.

◆ load()

template<class TRow>
static IRowBaseVec openm::IMetaLoadedTable< TRow >::load ( const string &  i_sqlSelect,
IDbExec i_dbExec,
const IRowAdapter i_adapter 
)
inlinestaticprotected

load table: return vector of selected rows sorted by primary key.

◆ rowCount()

template<class TRow>
IRowBaseVec::difference_type openm::IMetaLoadedTable< TRow >::rowCount ( void  ) const
inline

return number of rows.

◆ rows()

template<class TRow>
vector<TRow> openm::IMetaLoadedTable< TRow >::rows ( void  ) const
inline

get list of loaded table rows.

◆ rowsCRef()

◆ rowsRef()

template<class TRow>
virtual IRowBaseVec& openm::IMetaLoadedTable< TRow >::rowsRef ( void  )
pure virtual

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