mksqlite  2.5
A MATLAB interface to SQLite
Public Types | Public Member Functions | Public Attributes | List of all members
SQLstack Class Reference

SQLite interface stack. More...

+ Collaboration diagram for SQLstack:

Public Types

enum  { COUNT_DB = CONFIG_MAX_NUM_OF_DBS }
 Stack size.
 

Public Member Functions

 SQLstack ()
 Standard Ctor (first database slot is default)
 
 ~SQLstack ()
 Dtor. More...
 
SQLstackitemcurrent ()
 Returns the handle of the current database.
 
bool isValidId (int newId)
 Checks if database newId is in valid range.
 
void switchTo (int newId)
 Makes newId as current database id.
 
SQLifacecreateInterface ()
 Returns a new interface to the current database.
 
void printStatuses (int dbid_req, int dbid)
 Outputs current status for each database slot.
 
int getNextFreeId ()
 Returns the first next free id slot (base 0). Database must be closed.
 
int closeAllDbs ()
 Closes all open databases and returns the number of closed DBs, if any open.
 

Public Attributes

SQLstackitem m_db [COUNT_DB]
 SQLite database slots.
 
int m_dbid
 recent selected database id, base 0
 

Detailed Description

SQLite interface stack.

Holds a defined number (COUNT_DB) of SQLite slots (with dbids) to facilitate usage of multiple parallel databases. Each database can be accessed by its dbid (database ID) as first optional parameter to mksqlite:

dbid_1 = mksqlite( 1, 'open', 'first.db' ); // open 1st database with dbid=1
dbid_2 = mksqlite( 2, 'open', 'second.db' ); // open 2nd database with dbid=2
assert( dbid_1 == 1 && dbid_2 == 2 );
query = mksqlite( 2, 'SELECT * FROM table' ); // access to 2nd database
mksqlite( 0, 'close' ); // closes all databases

Definition at line 70 of file mksqlite.cpp.

Constructor & Destructor Documentation

◆ ~SQLstack()

SQLstack::~SQLstack ( )
inline

Dtor.

Closes all databases and shuts sqlite engine down.

Definition at line 92 of file mksqlite.cpp.

References closeAllDbs().


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