Money Manager EX
An easy to use, money management application built with wxWidgets
DB_Table_TRANSLINK_V1 Struct Reference

#include <DB_Table_Translink_V1.h>

+ Inheritance diagram for DB_Table_TRANSLINK_V1:
+ Collaboration diagram for DB_Table_TRANSLINK_V1:

Classes

struct  CHECKINGACCOUNTID
 
struct  Data
 Data is a single record in the database table. More...
 
struct  Data_Set
 A container to hold list of Data records for the table. More...
 
struct  LINKRECORDID
 
struct  LINKTYPE
 
struct  TRANSLINKID
 

Public Types

enum  COLUMN { COL_TRANSLINKID = 0, COL_CHECKINGACCOUNTID = 1, COL_LINKTYPE = 2, COL_LINKRECORDID = 3 }
 
enum  { NUM_COLUMNS = 4 }
 
typedef DB_Table_TRANSLINK_V1 Self
 
typedef std::vector< Self::Data * > Cache
 A container to hold a list of Data record pointers for the table in memory. More...
 
typedef std::map< int64, Self::Data * > Index_By_Id
 
typedef TRANSLINKID PRIMARY
 

Public Member Functions

 ~DB_Table_TRANSLINK_V1 ()
 Destructor: clears any data records stored in memory. More...
 
void destroy_cache ()
 Removes all records stored in memory (cache) for the table. More...
 
bool ensure (wxSQLite3Database *db)
 Creates the database table if the table does not exist. More...
 
bool ensure_index (wxSQLite3Database *db)
 
void ensure_data (wxSQLite3Database *db)
 
size_t num_columns () const
 
wxString name () const
 Name of the table. More...
 
 DB_Table_TRANSLINK_V1 ()
 
Self::Datacreate ()
 Create a new Data record and add to memory table (cache) More...
 
Self::Dataclone (const Data *e)
 Create a copy of the Data record and add to memory table (cache) More...
 
bool save (Self::Data *entity, wxSQLite3Database *db, bool force_insert=false)
 Saves the Data record to the database table. More...
 
bool remove (const int64 id, wxSQLite3Database *db)
 Remove the Data record from the database and the memory table (cache) More...
 
bool remove (Self::Data *entity, wxSQLite3Database *db)
 Remove the Data record from the database and the memory table (cache) More...
 
template<typename... Args>
Self::Dataget_one (const Args &... args)
 
Self::Dataget (const int64 id, wxSQLite3Database *db)
 Search the memory table (Cache) for the data record. More...
 
Self::Dataget_record (const int64 id, wxSQLite3Database *db)
 Search the database for the data record, bypassing the cache. More...
 
const Data_Set all (wxSQLite3Database *db, const COLUMN col=COLUMN(0), const bool asc=true)
 Return a list of Data records (Data_Set) derived directly from the database. More...
 
- Public Member Functions inherited from DB_Table
 DB_Table ()
 
virtual ~DB_Table ()
 
virtual wxString query () const
 
bool exists (wxSQLite3Database *db) const
 
void drop (wxSQLite3Database *db) const
 

Static Public Member Functions

static wxString column_to_name (const COLUMN col)
 Returns the column name as a string. More...
 
static COLUMN name_to_column (const wxString &name)
 Returns the column number from the given column name. More...
 
- Static Public Member Functions inherited from DB_Table
static int64 newId ()
 

Public Attributes

Cache cache_
 
Index_By_Id index_by_id_
 
Datafake_
 
- Public Attributes inherited from DB_Table
wxString query_
 
size_t hit_
 
size_t miss_
 
size_t skip_
 

Member Typedef Documentation

◆ Cache

A container to hold a list of Data record pointers for the table in memory.

◆ Index_By_Id

◆ PRIMARY

◆ Self

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NUM_COLUMNS 

◆ COLUMN

Enumerator
COL_TRANSLINKID 
COL_CHECKINGACCOUNTID 
COL_LINKTYPE 
COL_LINKRECORDID 

Constructor & Destructor Documentation

◆ ~DB_Table_TRANSLINK_V1()

DB_Table_TRANSLINK_V1::~DB_Table_TRANSLINK_V1 ( )
inline

Destructor: clears any data records stored in memory.

◆ DB_Table_TRANSLINK_V1()

DB_Table_TRANSLINK_V1::DB_Table_TRANSLINK_V1 ( )
inline

Member Function Documentation

◆ all()

const Data_Set DB_Table_TRANSLINK_V1::all ( wxSQLite3Database *  db,
const COLUMN  col = COLUMN(0),
const bool  asc = true 
)
inline

Return a list of Data records (Data_Set) derived directly from the database.

The Data_Set is sorted based on the column number.

◆ clone()

Self::Data* DB_Table_TRANSLINK_V1::clone ( const Data e)
inline

Create a copy of the Data record and add to memory table (cache)

◆ column_to_name()

static wxString DB_Table_TRANSLINK_V1::column_to_name ( const COLUMN  col)
inlinestatic

Returns the column name as a string.

◆ create()

Self::Data* DB_Table_TRANSLINK_V1::create ( )
inline

Create a new Data record and add to memory table (cache)

◆ destroy_cache()

void DB_Table_TRANSLINK_V1::destroy_cache ( )
inline

Removes all records stored in memory (cache) for the table.

◆ ensure()

bool DB_Table_TRANSLINK_V1::ensure ( wxSQLite3Database *  db)
inline

Creates the database table if the table does not exist.

◆ ensure_data()

void DB_Table_TRANSLINK_V1::ensure_data ( wxSQLite3Database *  db)
inline

◆ ensure_index()

bool DB_Table_TRANSLINK_V1::ensure_index ( wxSQLite3Database *  db)
inline

◆ get()

Self::Data* DB_Table_TRANSLINK_V1::get ( const int64  id,
wxSQLite3Database *  db 
)
inline

Search the memory table (Cache) for the data record.

If not found in memory, search the database and update the cache.

◆ get_one()

template<typename... Args>
Self::Data* DB_Table_TRANSLINK_V1::get_one ( const Args &...  args)
inline

◆ get_record()

Self::Data* DB_Table_TRANSLINK_V1::get_record ( const int64  id,
wxSQLite3Database *  db 
)
inline

Search the database for the data record, bypassing the cache.

◆ name()

wxString DB_Table_TRANSLINK_V1::name ( ) const
inlinevirtual

Name of the table.

Implements DB_Table.

◆ name_to_column()

static COLUMN DB_Table_TRANSLINK_V1::name_to_column ( const wxString &  name)
inlinestatic

Returns the column number from the given column name.

◆ num_columns()

size_t DB_Table_TRANSLINK_V1::num_columns ( ) const
inlinevirtual

Implements DB_Table.

◆ remove() [1/2]

bool DB_Table_TRANSLINK_V1::remove ( const int64  id,
wxSQLite3Database *  db 
)
inline

Remove the Data record from the database and the memory table (cache)

◆ remove() [2/2]

bool DB_Table_TRANSLINK_V1::remove ( Self::Data entity,
wxSQLite3Database *  db 
)
inline

Remove the Data record from the database and the memory table (cache)

◆ save()

bool DB_Table_TRANSLINK_V1::save ( Self::Data entity,
wxSQLite3Database *  db,
bool  force_insert = false 
)
inline

Saves the Data record to the database table.

Either create a new record or update the existing record. Remove old record from the memory table (cache)

Member Data Documentation

◆ cache_

Cache DB_Table_TRANSLINK_V1::cache_

◆ fake_

Data* DB_Table_TRANSLINK_V1::fake_

◆ index_by_id_

Index_By_Id DB_Table_TRANSLINK_V1::index_by_id_

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