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

#include <Model_Shareinfo.h>

+ Inheritance diagram for Model_Shareinfo:
+ Collaboration diagram for Model_Shareinfo:

Public Member Functions

 Model_Shareinfo ()
 
 ~Model_Shareinfo ()
 
- Public Member Functions inherited from Model< DB_Table_SHAREINFO_V1 >
const DB_Table_SHAREINFO_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_SHAREINFO_V1 ::Data_Set find (const Args &... args)
 Command: find(const Args&... More...
 
const DB_Table_SHAREINFO_V1 ::Data_Set find_or (const Args &... args)
 Command: find_or(const Args&... More...
 
DB_Table_SHAREINFO_V1 ::Dataget (int64 id)
 Return the Data record pointer for the given ID from either memory cache or the database. More...
 
DB_Table_SHAREINFO_V1 ::Dataget (wxLongLong_t id)
 
DB_Table_SHAREINFO_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_SHAREINFO_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_SHAREINFO_V1
 ~DB_Table_SHAREINFO_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_SHAREINFO_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 Model_Shareinfoinstance (wxSQLite3Database *db)
 Initialize the global Model_Shareinfo table on initial call. More...
 
static Model_Shareinfoinstance ()
 Return the static instance address for Model_Shareinfo table Note: Assigning the address to a local variable can destroy the instance. More...
 
static Model_Shareinfo::DataShareEntry (const int64 checking_id)
 
static void ShareEntry (int64 checking_id, double share_number, double share_price, double share_commission, const std::vector< Split > &commission_splits, const wxString &share_lot)
 Create a Share record if it does not exist. More...
 
static void RemoveShareEntry (const int64 checking_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_SHAREINFO_V1
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 ()
 

Additional Inherited Members

- Public Types inherited from Model< DB_Table_SHAREINFO_V1 >
typedef DB_Table_SHAREINFO_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 Types inherited from DB_Table_SHAREINFO_V1
enum  COLUMN {
  COL_SHAREINFOID = 0, COL_CHECKINGACCOUNTID = 1, COL_SHARENUMBER = 2, COL_SHAREPRICE = 3,
  COL_SHARECOMMISSION = 4, COL_SHARELOT = 5
}
 
enum  { NUM_COLUMNS = 6 }
 
typedef DB_Table_SHAREINFO_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 SHAREINFOID PRIMARY
 
- Public Attributes inherited from DB_Table_SHAREINFO_V1
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_
 
- 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_
 

Constructor & Destructor Documentation

◆ Model_Shareinfo()

Model_Shareinfo::Model_Shareinfo ( )

◆ ~Model_Shareinfo()

Model_Shareinfo::~Model_Shareinfo ( )

Member Function Documentation

◆ instance() [1/2]

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

Initialize the global Model_Shareinfo table on initial call.

Initialize the global Model_Shareinfo table.

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

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

◆ instance() [2/2]

Model_Shareinfo & Model_Shareinfo::instance ( )
static

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

Return the static instance of Model_Shareinfo table.

◆ RemoveShareEntry()

void Model_Shareinfo::RemoveShareEntry ( const int64  checking_id)
static

◆ ShareEntry() [1/2]

Model_Shareinfo::Data * Model_Shareinfo::ShareEntry ( const int64  checking_id)
static

◆ ShareEntry() [2/2]

void Model_Shareinfo::ShareEntry ( int64  checking_id,
double  share_number,
double  share_price,
double  share_commission,
const std::vector< Split > &  commission_splits,
const wxString &  share_lot 
)
static

Create a Share record if it does not exist.

save the share record linked to the checking account.


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