#include <cursor.h>

Public Member Functions | |
| dbCursor (dbCursorType type=dbCursorViewOnly) | |
| Cursor constructor. | |
| dbCursor (dbDatabase *aDb, dbCursorType type=dbCursorViewOnly) | |
| Cursor constructor with explicit specification of database. | |
| T * | get () |
| Get pointer to the current record. | |
| T * | next () |
| Get next record. | |
| T * | prev () |
| Get previous record. | |
| T * | first () |
| Get pointer to the first record. | |
| T * | last () |
| Get pointer to the last record. | |
| int | seek (dbReference< T > const &ref) |
| Position cursor on the record with the specified OID. | |
| T * | operator-> () |
| Overloaded operator for accessing components of the current record. | |
| T * | at (dbReference< T > const &ref) |
| Select record by reference. | |
| void | toArray (dbArray< dbReference< T > > &arr) const |
| Convert selection to array of reference. | |
| dbReference< T > | currentId () const |
| Get current object idenitifer. | |
| bool | isInSelection (dbReference< T > &ref) |
| Check if record with specified OID is in selection. | |
| T * | nextAvailable () |
| Method nextAvailable allows to iterate through the records in uniform way even when some records are removed. | |
Protected Attributes | |
| T | record |
Private Member Functions | |
| dbCursor< T > | operator= (dbCursor< T > const &src) |
| dbCursor | ( | dbCursorType | type = dbCursorViewOnly |
) | [inline] |
Cursor constructor.
| type | cursor type (dbCursorViewOnly by default) |
| dbCursor | ( | dbDatabase * | aDb, | |
| dbCursorType | type = dbCursorViewOnly | |||
| ) | [inline] |
Cursor constructor with explicit specification of database.
This cursor should be used for unassigned tables.
| aDb | database in which table lookup is performed | |
| type | cursor type (dbCursorViewOnly by default) |
| T* get | ( | ) | [inline] |
Get pointer to the current record.
NULL if there is no current record | T* next | ( | ) | [inline] |
Get next record.
NULL if there is no next record | T* prev | ( | ) | [inline] |
Get previous record.
NULL if there is no previous record | T* first | ( | ) | [inline] |
Get pointer to the first record.
NULL if no records were selected | T* last | ( | ) | [inline] |
Get pointer to the last record.
NULL if no records were selected | int seek | ( | dbReference< T > const & | ref | ) | [inline] |
Position cursor on the record with the specified OID.
| ref | reference to the object |
| T* operator-> | ( | ) | [inline] |
Overloaded operator for accessing components of the current record.
| T* at | ( | dbReference< T > const & | ref | ) | [inline] |
Select record by reference.
| ref | reference to the record |
| void toArray | ( | dbArray< dbReference< T > > & | arr | ) | const [inline] |
Convert selection to array of reference.
| arr | [OUT] array of refeences in which references to selected recrods will be placed |
| dbReference<T> currentId | ( | ) | const [inline] |
Get current object idenitifer.
| bool isInSelection | ( | dbReference< T > & | ref | ) | [inline] |
Check if record with specified OID is in selection.
true if record with such OID was selected | T* nextAvailable | ( | ) | [inline] |
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());
}
T record [protected] |
Reimplemented from dbAnyCursor.