Scid  4.6.5
Functions
DBasePool Namespace Reference

Functions

void init ()
 init() - initialize the pool of databases. More...
 
void closeAll ()
 closeAll() - close all the databases in the pool. More...
 
int find (const char *filename)
 find() - search for a database. More...
 
scidBaseTgetBase (int baseHandle)
 getBase() - get a database from the pool. More...
 
int getClipBase ()
 getClipBase() - return the handle of the clipbase More...
 
scidBaseTgetFreeSlot ()
 getFreeSlot() - search for a free database slot. More...
 
std::vector< int > getHandles ()
 getHandles() - get the handles of opened databases. More...
 
int switchCurrent (scidBaseT *dbase=0)
 switchCurrent() - DEPRECATED. More...
 

Function Documentation

void DBasePool::closeAll ( )

closeAll() - close all the databases in the pool.

Call this function just once before ending the program. This function close all the managed databases ensuring that resources are released and changes are flushed to disks.

Definition at line 46 of file dbasepool.cpp.

int DBasePool::find ( const char *  filename)

find() - search for a database.

: the filename of the wanted database. Database in native Scid format do not use extension ("example"). Other databases require file extension ("example.pgn").

Return:

  • the handle of the database corresponding to .
  • 0 if not found.

Definition at line 51 of file dbasepool.cpp.

scidBaseT * DBasePool::getBase ( int  baseHandle)

getBase() - get a database from the pool.

: the handle of the wanted database.

Return:

  • a pointer to the scidBaseT object corresponding to .
  • 0 (nullptr) if is invalid.

Definition at line 59 of file dbasepool.cpp.

int DBasePool::getClipBase ( )

getClipBase() - return the handle of the clipbase

The clipbase is a special memory database that is always open and valid. Return:

  • the handle of the clipbase.

Definition at line 65 of file dbasepool.cpp.

scidBaseT * DBasePool::getFreeSlot ( )

getFreeSlot() - search for a free database slot.

Return:

  • a pointer to an available scidBaseT object.
  • 0 (nullptr) if there are no free slots.

Definition at line 69 of file dbasepool.cpp.

std::vector< int > DBasePool::getHandles ( )

getHandles() - get the handles of opened databases.

Return:

  • a std::vector containing the handles of opened databases.

Definition at line 76 of file dbasepool.cpp.

void DBasePool::init ( )

init() - initialize the pool of databases.

Call this function just once at the beginning of the program.

Definition at line 37 of file dbasepool.cpp.

int DBasePool::switchCurrent ( scidBaseT dbase = 0)

switchCurrent() - DEPRECATED.

: a pointer to the new "current" database. If 0 the function just return the "current" database handle.

Some legacy code assume that exist only one database. The hack to use that code is to make a database the "current" one. Return:

  • the handle of the new "current" database.

Definition at line 84 of file dbasepool.cpp.