32 const int CLIPBASE_NUM = MAX_BASES - 1;
41 dbList[CLIPBASE_NUM].setExtraInfo(
"type",
"2");
52 for (
int i = 0, n =
MAX_BASES; i < n; i++) {
53 if (dbList[i].inUse && dbList[i].getFileName() == filename)
60 if (baseHandle < 1 || baseHandle >
MAX_BASES)
return 0;
61 scidBaseT* res = &(dbList[baseHandle - 1]);
62 return res->
inUse ? res : 0;
66 return CLIPBASE_NUM + 1;
70 for (
int i = 0, n =
MAX_BASES; i < n; i++) {
71 if (!dbList[i].inUse) {
return &(dbList[i]); }
78 for (
int i = 0, n =
MAX_BASES; i < n; i++) {
79 if (dbList[i].inUse) res.push_back(i + 1);
85 static int currentBase = 0;
88 if ((dbList + i) == dbase) {
95 return currentBase + 1;
int switchCurrent(scidBaseT *dbase=0)
switchCurrent() - DEPRECATED.
void init()
init() - initialize the pool of databases.
scidBaseT * getBase(int baseHandle)
getBase() - get a database from the pool.
int find(const char *filename)
find() - search for a database.
void closeAll()
closeAll() - close all the databases in the pool.
scidBaseT * getFreeSlot()
getFreeSlot() - search for a free database slot.
int getClipBase()
getClipBase() - return the handle of the clipbase
std::vector< int > getHandles()
getHandles() - get the handles of opened databases.
errorT Open(ICodecDatabase::Codec dbtype, fileModeT mode, const char *filename=0, const Progress &progress=Progress())