#include <cursor.h>
Inheritance diagram for dbCursor< T >:
Public Methods | |
dbCursor (dbCursorType type=dbCursorViewOnly) | |
dbCursor (dbDatabase *aDb, dbCursorType type=dbCursorViewOnly) | |
T * | get () |
T * | next () |
T * | prev () |
T * | first () |
T * | last () |
T * | operator-> () |
T * | at (dbReference< T > const &ref) |
void | toArray (dbArray< dbReference< T > > &arr) |
dbReference< T > | currentId () |
T * | nextAvailable () |
int | getNumberOfRecords () |
void | remove () |
bool | isEmpty () |
bool | isLimitReached () |
oid_t * | toArrayOfOid (oid_t *arr) |
int | select (dbQuery &query, dbCursorType aType, void *paramStruct=NULL) |
int | select (dbQuery &query, void *paramStruct=NULL) |
int | select (char const *condition, dbCursorType aType, void *paramStruct=NULL) |
int | select (char const *condition, void *paramStruct=NULL) |
int | select (dbCursorType aType) |
int | select () |
void | update () |
void | removeAll () |
void | removeAllSelected () |
void | setSelectionLimit (size_t lim) |
void | unsetSelectionLimit () |
void | setPrefetchMode (bool mode) |
void | reset () |
bool | isLast () |
bool | isFirst () |
void | freeze () |
void | unfreeze () |
dbTableDescriptor * | getTable () |
void | link (dbL2List *elem) |
void | unlink () |
Public Attributes | |
dbL2List * | next |
dbL2List * | prev |
Protected Methods | |
void | checkForDuplicates () |
bool | isMarked (oid_t oid) |
void | mark (oid_t oid) |
bool | add (oid_t oid) |
bool | gotoNext () |
bool | gotoPrev () |
bool | gotoFirst () |
bool | gotoLast () |
void | setCurrent (dbAnyReference const &ref) |
void | fetch () |
void | adjustReferences (size_t base, size_t size, long shift) |
void | setTable (dbTableDescriptor *aTable) |
void | setRecord (byte *rec) |
Protected Attributes | |
T | record |
dbDatabase * | db |
dbTableDescriptor * | table |
dbCursorType | type |
dbCursorType | defaultType |
dbSelection | selection |
bool | allRecords |
oid_t | firstId |
oid_t | lastId |
oid_t | currId |
size_t | limit |
int4 * | bitmap |
size_t | bitmapSize |
bool | eliminateDuplicates |
bool | prefetch |
bool | removed |
bool | updateInProgress |
void * | paramBase |
|
Cursor constructor
|
|
Cursor constructor with explicit specification of database. This cursor should be used for unassigned tables.
|
|
Select record by reference
|
|
Get current object idenitifer
|
|
Get pointer to the first record
|
|
Freeze cursor. This method makes it possible to save current state of cursor, close transaction to allow other threads to proceed, and then later restore state of the cursor using unfreeze method and continue traversal through selected records. |
|
Get pointer to the current record
|
|
Get number of selected records
|
|
Get table for which cursor is opened |
|
Checks whether selection is empty
Reimplemented from dbL2List. |
|
Check whether current record is the first one in the selection
|
|
Check whether current record is the last one in the selection
|
|
Checks whether limit for number of selected reacord is reached
|
|
Get pointer to the last record
|
|
Get next record
|
|
Method nextAvailable allows to iterate through the records in uniform way even when some records are removed. For example: if (cursor.select(q) > 0) { do { if (x) { cursor.remove(); } else { cursor.update(); } } while (cursor.nextAvaiable()); } *
|
|
Overloaded operator for accessing components of the current record
|
|
Get previous record
|
|
Remove current record |
|
Remove all records in the table |
|
Remove all selected records |
|
Reset cursor Reimplemented from dbL2List. |
|
Select all records from the table with default cursor type
|
|
Select all records from the table
|
|
Execute query with default cursor type.
|
|
Execute query.
|
|
Execute query with default cursor type.
|
|
Execute query.
|
|
Set prefetch mode. By default, current record is fetch as soon as it is becomes current. But sometimesyou need only OIDs of selected records. In this case setting prefetchMode to false can help.
|
|
Specify maximal number of records to be selected |
|
Convert selection to array of reference
|
|
Extract OIDs of selected recrods in array
|
|
Unfreeze cursor. This method starts new transaction and restore state of the cursor |
|
Remove selection limit |
|
Update current record. You should changed value of current record before and then call update method to save changes to the database |