Money Manager EX
An easy to use, money management application built with wxWidgets
Model_Translink Class Reference

#include <Model_Translink.h>

+ Inheritance diagram for Model_Translink:
+ Collaboration diagram for Model_Translink:

Public Types

enum  CHECKING_TYPE { AS_INCOME_EXPENSE = 32701, AS_TRANSFER }
 
- Public Types inherited from Model< DB_Table_TRANSLINK_V1 >
typedef DB_Table_TRANSLINK_V1 ::COLUMN COLUMN
 
- Public Types inherited from ModelBase
enum  REFTYPE_ID {
  REFTYPE_ID_TRANSACTION = 0, REFTYPE_ID_STOCK, REFTYPE_ID_ASSET, REFTYPE_ID_BANKACCOUNT,
  REFTYPE_ID_BILLSDEPOSIT, REFTYPE_ID_PAYEE, REFTYPE_ID_TRANSACTIONSPLIT, REFTYPE_ID_BILLSDEPOSITSPLIT,
  REFTYPE_ID_size
}
 

Public Member Functions

 Model_Translink ()
 
 ~Model_Translink ()
 
- Public Member Functions inherited from Model< DB_Table_TRANSLINK_V1 >
const DB_Table_TRANSLINK_V1 ::Data_Set all (COLUMN col=COLUMN(0), bool asc=true)
 Return a list of Data record addresses (Data_Set) derived directly from the database. More...
 
const DB_Table_TRANSLINK_V1 ::Data_Set find (const Args &... args)
 Command: find(const Args&... More...
 
const DB_Table_TRANSLINK_V1 ::Data_Set find_or (const Args &... args)
 Command: find_or(const Args&... More...
 
DB_Table_TRANSLINK_V1 ::Dataget (int64 id)
 Return the Data record pointer for the given ID from either memory cache or the database. More...
 
DB_Table_TRANSLINK_V1 ::Dataget (wxLongLong_t id)
 
DB_Table_TRANSLINK_V1 ::Dataget_record (int64 id)
 Return the Data record for the given ID directly from the database, bypassing the cache. More...
 
int64 save (typename DB_Table_TRANSLINK_V1 ::Data *r)
 Save the Data record memory instance to the database. More...
 
int save (std::vector< DATA > &rows)
 Save all Data record memory instances contained in the record list (Data_Set) to the database. More...
 
int save (std::vector< DATA * > &rows)
 
bool remove (int64 id)
 Remove the Data record instance from memory and the database. More...
 
void preload (int max_num=1000)
 
wxString GetTableStatsAsJson () const
 
void destroyCache ()
 
void show_statistics () const
 Show table statistics. More...
 
- Public Member Functions inherited from ModelBase
 ModelBase ()
 
virtual ~ModelBase ()
 
void Begin ()
 
void Commit ()
 
void Savepoint (const wxString name="MMEX")
 
void ReleaseSavepoint (const wxString name="MMEX")
 
void Rollback (const wxString name="MMEX")
 
- 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 Model_Translinkinstance (wxSQLite3Database *db)
 Initialize the global Model_Translink table on initial call. More...
 
static Model_Translinkinstance ()
 Return the static instance address for Model_Translink table Note: Assigning the address to a local variable can destroy the instance. More...
 
static CHECKING_TYPE type_checking (const int64 tt)
 
static Model_Translink::DataSetAssetTranslink (const int64 asset_id, const int64 checking_id, const CHECKING_TYPE checking_type=AS_INCOME_EXPENSE)
 
static Model_Translink::DataSetStockTranslink (const int64 stock_id, const int64 checking_id, const CHECKING_TYPE checking_type=AS_INCOME_EXPENSE)
 
template<typename T >
static Model_Translink::Data_Set TranslinkList (const int64 link_id)
 
static Model_Translink::Data_Set TranslinkListBySymbol (const wxString symbol)
 
static bool HasShares (const int64 stock_id)
 
static Model_Translink::Data TranslinkRecord (const int64 checking_id)
 
template<typename T >
static void RemoveTransLinkRecords (const int64 entry_id)
 
static void RemoveTranslinkEntry (const int64 checking_account_id)
 
static void UpdateAssetValue (Model_Asset::Data *asset_entry)
 
static bool ShareAccountId (int64 &stock_entry_id)
 
- Static Public Member Functions inherited from ModelBase
static const wxString reftype_name (int id)
 
static int reftype_id (const wxString &name, int default_id=-1)
 
- Static Public Member Functions inherited from DB_Table
static int64 newId ()
 

Additional Inherited Members

- Public Attributes inherited from DB_Table
wxString query_
 
size_t hit_
 
size_t miss_
 
size_t skip_
 
- Static Public Attributes inherited from ModelBase
static ChoicesName REFTYPE_CHOICES
 
static const wxString REFTYPE_NAME_TRANSACTION = reftype_name(REFTYPE_ID_TRANSACTION)
 
static const wxString REFTYPE_NAME_STOCK = reftype_name(REFTYPE_ID_STOCK)
 
static const wxString REFTYPE_NAME_ASSET = reftype_name(REFTYPE_ID_ASSET)
 
static const wxString REFTYPE_NAME_BANKACCOUNT = reftype_name(REFTYPE_ID_BANKACCOUNT)
 
static const wxString REFTYPE_NAME_BILLSDEPOSIT = reftype_name(REFTYPE_ID_BILLSDEPOSIT)
 
static const wxString REFTYPE_NAME_PAYEE = reftype_name(REFTYPE_ID_PAYEE)
 
static const wxString REFTYPE_NAME_TRANSACTIONSPLIT = reftype_name(REFTYPE_ID_TRANSACTIONSPLIT)
 
static const wxString REFTYPE_NAME_BILLSDEPOSITSPLIT = reftype_name(REFTYPE_ID_BILLSDEPOSITSPLIT)
 
- Static Protected Member Functions inherited from ModelBase
static wxDateTime to_date (const wxString &str_date)
 
- Protected Attributes inherited from ModelBase
wxSQLite3Database * db_
 

Member Enumeration Documentation

◆ CHECKING_TYPE

Enumerator
AS_INCOME_EXPENSE 
AS_TRANSFER 

Constructor & Destructor Documentation

◆ Model_Translink()

Model_Translink::Model_Translink ( )

◆ ~Model_Translink()

Model_Translink::~Model_Translink ( )

Member Function Documentation

◆ HasShares()

bool Model_Translink::HasShares ( const int64  stock_id)
static

◆ instance() [1/2]

Model_Translink & Model_Translink::instance ( wxSQLite3Database *  db)
static

Initialize the global Model_Translink table on initial call.

Initialize the global Model_Translink table.

Resets the global table on subsequent calls. Return the static instance address for Model_Translink table Note: Assigning the address to a local variable can destroy the instance.

Reset the Model_Translink table or create the table if it does not exist.

◆ instance() [2/2]

Model_Translink & Model_Translink::instance ( )
static

Return the static instance address for Model_Translink table Note: Assigning the address to a local variable can destroy the instance.

Return the static instance of Model_Translink table.

◆ RemoveTranslinkEntry()

void Model_Translink::RemoveTranslinkEntry ( const int64  checking_account_id)
static

◆ RemoveTransLinkRecords()

template<typename T >
template void Model_Translink::RemoveTransLinkRecords< Model_Stock > ( const int64  entry_id)
static

◆ SetAssetTranslink()

Model_Translink::Data * Model_Translink::SetAssetTranslink ( const int64  asset_id,
const int64  checking_id,
const CHECKING_TYPE  checking_type = AS_INCOME_EXPENSE 
)
static

◆ SetStockTranslink()

Model_Translink::Data * Model_Translink::SetStockTranslink ( const int64  stock_id,
const int64  checking_id,
const CHECKING_TYPE  checking_type = AS_INCOME_EXPENSE 
)
static

◆ ShareAccountId()

bool Model_Translink::ShareAccountId ( int64 stock_entry_id)
static

◆ TranslinkList()

template<typename T >
Model_Translink::Data_Set Model_Translink::TranslinkList ( const int64  link_id)
static

◆ TranslinkListBySymbol()

Model_Translink::Data_Set Model_Translink::TranslinkListBySymbol ( const wxString  symbol)
static

◆ TranslinkRecord()

Model_Translink::Data Model_Translink::TranslinkRecord ( const int64  checking_id)
static

◆ type_checking()

Model_Translink::CHECKING_TYPE Model_Translink::type_checking ( const int64  tt)
static

◆ UpdateAssetValue()

void Model_Translink::UpdateAssetValue ( Model_Asset::Data asset_entry)
static

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