Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SplitsDB Class Reference

class to manipulate the splits database. More...

#include <SplitsDB.h>

Inheritance diagram for SplitsDB:

Database< splitStructure, packedSplitStructure > GenericDB Collaboration diagram for SplitsDB:

Collaboration graph
[legend]
List of all members.

Public Methods

void unpackRecord (splitStructure *spl, packedSplitStructure *packed_spl) DB_SECTION2
 unpacks a Split record. More...

void packRecord (splitStructure *spl, MemHandle db_entry) DB_SECTION2
 packs a Split record. More...

 SplitsDB () DB_SECTION2
 initialize the database. More...

UInt16 locateFirstSplit (UInt32 trans_uid) DB_SECTION2
 locate the first split that belongs to the given transaction. More...

void clearRecord (UInt16 id) DB_SECTION2
 set a record to cleared, update the affected account's cleared balance. More...

void unclearRecord (UInt16 id) DB_SECTION2
 set a record to uncleared and update the affected account's cleared balance. More...

UInt16 newRecord (splitStructure *s, Boolean cleared) DB_SECTION2
 creates a new record and update the balance of the involved account. More...

bool deleteRecord (UInt16 id, Boolean keep_balance=false) DB_SECTION2
 deletes a record, given its id. More...


Static Public Methods

Int16 compareRecords (packedSplitStructure *rec1, packedSplitStructure *rec2, Int16 other, SortRecordInfoPtr sr1, SortRecordInfoPtr sr2, MemHandle app_info) DB_SECTION2
 Compares two packed split structures. More...


Detailed Description

class to manipulate the splits database.

Definition at line 57 of file SplitsDB.h.


Constructor & Destructor Documentation

SplitsDB::SplitsDB  
 

initialize the database.


Member Function Documentation

void SplitsDB::clearRecord UInt16    id
 

set a record to cleared, update the affected account's cleared balance.

Parameters:
id  id of the record to be set

Int16 SplitsDB::compareRecords packedSplitStructure   rec1,
packedSplitStructure   rec2,
Int16    other,
SortRecordInfoPtr    sr1,
SortRecordInfoPtr    sr2,
MemHandle    app_info
[static]
 

Compares two packed split structures.

For parameters see the PalmOS reference

bool SplitsDB::deleteRecord UInt16    id,
Boolean    keep_balance = false
 

deletes a record, given its id.

The balance of the affected account is updated. The transaction that the split belonged to is responsible for keeping the number of splits it has up to date.

Parameters:
id  the id of the record to be deleted
keep_balance  if true then the balances of the account involved in the split will *not* be changed. Use only when necessary, as this results in unbalanced accounts

UInt16 SplitsDB::locateFirstSplit UInt32    trans_uid
 

locate the first split that belongs to the given transaction.

Parameters:
trans_uid  UID of the transaction
Returns:
the index of the first split within the transaction

UInt16 SplitsDB::newRecord splitStructure   s,
Boolean    cleared
 

creates a new record and update the balance of the involved account.

The transaction that the split belongs to is responsible for keeping the number of splits it has up to date.

Parameters:
s  pointer to the structure containing the split data
cleared  indicates if this split affects the cleared balance
Returns:
id of the newly created record

void SplitsDB::packRecord splitStructure   spl,
MemHandle    db_entry
[virtual]
 

packs a Split record.

Implements Database< splitStructure, packedSplitStructure >.

void SplitsDB::unclearRecord UInt16    id
 

set a record to uncleared and update the affected account's cleared balance.

Parameters:
id  id of the record to be set

void SplitsDB::unpackRecord splitStructure   spl,
packedSplitStructure   packed_spl
[virtual]
 

unpacks a Split record.

Implements Database< splitStructure, packedSplitStructure >.


The documentation for this class was generated from the following file:
Generated on Thu Jan 16 23:11:15 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002