Class CGCursorIndex can be used to create or use index by column for cursor objects. To create or load index you should use cursor's constructor. You is responsible for synchronization between saved cursors/indexes. Synchronization between opened cursor/indexes will done automatically.

Methods

CGCursorIndex(CGCursor *pCursor, int iColumn, bool (_cdecl *pCallback)(long, long) = 0);
CGCursorIndex(CGCursor *pCursor, const char *szFileName);
Constructor creates (first variant) or loads from file (second variant) the index for the
CGCursor object. During execution time cursor object is not related with any file. No synchronization will file will be done automatically. You should use save method to save modified cursor for future usage.
Parameters
pCursorReference to cursor object, for which index object should be created. Index registers itself in cursor object for synchronization.
iColumnIndex of the column, which should be indexed.
pCallbackCallback function, which can be used to tracking indexing process. Function should have following form
bool _cdecl IndexCallback(long lCurrentRow, long lTotalRows)
Function should return false to terminate indexing process.
szFileNameName of file with previously saved index
Constructor can throw cursor exception.

void save(const char *szFileName);
Method saves current state of the index to specified file. Method can throw
cursor exception.

void go(int iIndexRow);
Method fetches row, which corresponds to specified index row in the associated cursor object. Row index should greater than zero. Method can throw
cursor exception.

int seekForAbsRow(int iAbsRow)
Method return index row (position of row in index) for specified row index in the associated cursor object.

int seekForAbsRow(int iAbsRow);
int seekFor(int iVal);
int seekFor(double dblVal);
int seekFor(const char *szValue, bool bExact);
int seekFor(const CGOdbcStmt::DATE *pVal);
int seekFor(const CGOdbcStmt::TIMESTAMP *pVal);
int seekFor(const GUID *pVal);
Method searches specified value with help of index. Method returns first index row in which value is found or -1 if value is not found.