Cursor class for row-wise data accesses. More...
#include <table.h>
Public Member Functions | |
virtual ibis::table::stringList | columnNames () const =0 |
virtual ibis::table::typeList | columnTypes () const =0 |
virtual int | dump (std::ostream &out, const char *del=", ") const =0 |
Print out the values of the current row. | |
virtual int | fetch ()=0 |
Make the next row of the data set available for retrieval. | |
virtual int | fetch (uint64_t rownum)=0 |
Make the specified row in the data set available for retrieval. | |
virtual int | fetch (ibis::table::row &)=0 |
Fetch the content of the next row and make the next row as the current row as well. | |
virtual int | fetch (uint64_t rownum, ibis::table::row &)=0 |
Fetch the content of the specified row and make that row the current row as well. | |
virtual int | getColumnAsByte (const char *cname, char &) const =0 |
Retrieve the value of the named column. | |
virtual int | getColumnAsByte (uint32_t cnum, char &val) const =0 |
This version of getColumnAsTTT directly use the column number, i.e., the position of a column in the list returned by function columnNames or columnTypes . | |
virtual int | getColumnAsDouble (const char *cname, double &) const =0 |
virtual int | getColumnAsDouble (uint32_t cnum, double &val) const =0 |
virtual int | getColumnAsFloat (const char *cname, float &) const =0 |
virtual int | getColumnAsFloat (uint32_t cnum, float &val) const =0 |
virtual int | getColumnAsInt (const char *cname, int32_t &) const =0 |
virtual int | getColumnAsInt (uint32_t cnum, int32_t &val) const =0 |
virtual int | getColumnAsLong (const char *cname, int64_t &) const =0 |
virtual int | getColumnAsLong (uint32_t cnum, int64_t &val) const =0 |
virtual int | getColumnAsShort (const char *cname, int16_t &) const =0 |
virtual int | getColumnAsShort (uint32_t cnum, int16_t &val) const =0 |
virtual int | getColumnAsString (const char *cname, std::string &) const =0 |
virtual int | getColumnAsString (uint32_t cnum, std::string &val) const =0 |
virtual int | getColumnAsUByte (const char *cname, unsigned char &) const =0 |
virtual int | getColumnAsUByte (uint32_t cnum, unsigned char &val) const =0 |
virtual int | getColumnAsUInt (const char *cname, uint32_t &) const =0 |
virtual int | getColumnAsUInt (uint32_t cnum, uint32_t &val) const =0 |
virtual int | getColumnAsULong (const char *cname, uint64_t &) const =0 |
virtual int | getColumnAsULong (uint32_t cnum, uint64_t &val) const =0 |
virtual int | getColumnAsUShort (const char *cname, uint16_t &) const =0 |
virtual int | getColumnAsUShort (uint32_t cnum, uint16_t &val) const =0 |
virtual uint64_t | getCurrentRowNumber () const =0 |
Return the current row number. | |
virtual uint32_t | nColumns () const =0 |
virtual uint64_t | nRows () const =0 |
Protected Member Functions | |
cursor (const cursor &) | |
cursor & | operator= (const cursor &) |
Cursor class for row-wise data accesses.
virtual int ibis::table::cursor::fetch | ( | ) | [pure virtual] |
Make the next row of the data set available for retrieval.
Returns 0 if successful, returns a negative number to indicate error.
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual int ibis::table::cursor::fetch | ( | uint64_t | rownum | ) | [pure virtual] |
Make the specified row in the data set available for retrieval.
Returns 0 if the specified row is found, returns a negative number to indicate error, such as rownum
out of range (-1).
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual int ibis::table::cursor::fetch | ( | ibis::table::row & | ) | [pure virtual] |
Fetch the content of the next row and make the next row as the current row as well.
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual int ibis::table::cursor::fetch | ( | uint64_t | rownum, |
ibis::table::row & | |||
) | [pure virtual] |
Fetch the content of the specified row and make that row the current row as well.
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual int ibis::table::cursor::getColumnAsByte | ( | const char * | cname, |
char & | |||
) | const [pure virtual] |
Retrieve the value of the named column.
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual int ibis::table::cursor::getColumnAsByte | ( | uint32_t | cnum, |
char & | val | ||
) | const [pure virtual] |
This version of getColumnAsTTT directly use the column number, i.e., the position of a column in the list returned by function columnNames
or columnTypes
.
This version of the data access function may be able to avoid the name lookup and reduce the execution time.
Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
virtual uint64_t ibis::table::cursor::getCurrentRowNumber | ( | ) | const [pure virtual] |
Return the current row number.
Rows in a data set are numbered [0
nRows()-1
]. If the cursor is not ready, such as before the first call to fetch
or function fetch
returned an error, this function return the same value as function nRows
. Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.
![]() |