Public Member Functions | Protected Member Functions | List of all members
ibis::table::cursor Class Referenceabstract

Cursor class for row-wise data accesses. More...

#include <table.h>

Inheritance diagram for ibis::table::cursor:
ibis::bord::cursor ibis::mensa::cursor ibis::tabele::cursor ibis::tabula::cursor

Public Member Functions

virtual ibis::table::stringArray columnNames () const =0
 
virtual ibis::table::typeArray 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. More...
 
virtual int fetch (uint64_t rownum)=0
 Make the specified row in the data set available for retrieval. More...
 
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. More...
 
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. More...
 
virtual uint64_t getCurrentRowNumber () const =0
 Return the current row number. More...
 
virtual uint32_t nColumns () const =0
 
virtual uint64_t nRows () const =0
 
virtual int getColumnAsByte (const char *cname, char &) const =0
 
virtual int getColumnAsUByte (const char *cname, unsigned char &) const =0
 
virtual int getColumnAsShort (const char *cname, int16_t &) const =0
 
virtual int getColumnAsUShort (const char *cname, uint16_t &) const =0
 
virtual int getColumnAsInt (const char *cname, int32_t &) const =0
 
virtual int getColumnAsUInt (const char *cname, uint32_t &) const =0
 
virtual int getColumnAsLong (const char *cname, int64_t &) const =0
 
virtual int getColumnAsULong (const char *cname, uint64_t &) const =0
 
virtual int getColumnAsFloat (const char *cname, float &) const =0
 
virtual int getColumnAsDouble (const char *cname, double &) const =0
 
virtual int getColumnAsString (const char *cname, std::string &) const =0
 
virtual int getColumnAsOpaque (const char *cname, ibis::opaque &) const =0
 
virtual int getColumnAsByte (uint32_t cnum, char &val) const =0
 
virtual int getColumnAsUByte (uint32_t cnum, unsigned char &val) const =0
 
virtual int getColumnAsShort (uint32_t cnum, int16_t &val) const =0
 
virtual int getColumnAsUShort (uint32_t cnum, uint16_t &val) const =0
 
virtual int getColumnAsInt (uint32_t cnum, int32_t &val) const =0
 
virtual int getColumnAsUInt (uint32_t cnum, uint32_t &val) const =0
 
virtual int getColumnAsLong (uint32_t cnum, int64_t &val) const =0
 
virtual int getColumnAsULong (uint32_t cnum, uint64_t &val) const =0
 
virtual int getColumnAsFloat (uint32_t cnum, float &val) const =0
 
virtual int getColumnAsDouble (uint32_t cnum, double &val) const =0
 
virtual int getColumnAsString (uint32_t cnum, std::string &val) const =0
 
virtual int getColumnAsOpaque (uint32_t cnum, ibis::opaque &val) const =0
 

Protected Member Functions

 cursor (const cursor &)
 
cursoroperator= (const cursor &)
 

Detailed Description

Cursor class for row-wise data accesses.

Note
Note that this cursor is associated with a table object and can only iterate over all rows of a table. To iterate an arbitrary selection of rows, use the select function to create a new table and then iterate over the new table.

Member Function Documentation

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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsDouble ( const char *  cname,
double &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsDouble ( uint32_t  cnum,
double &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsFloat ( const char *  cname,
float &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsFloat ( uint32_t  cnum,
float &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsInt ( const char *  cname,
int32_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsInt ( uint32_t  cnum,
int32_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsLong ( const char *  cname,
int64_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsLong ( uint32_t  cnum,
int64_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsOpaque ( const char *  cname,
ibis::opaque &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsOpaque ( uint32_t  cnum,
ibis::opaque &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsShort ( const char *  cname,
int16_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsShort ( uint32_t  cnum,
int16_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsString ( const char *  cname,
std::string &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsString ( uint32_t  cnum,
std::string &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUByte ( const char *  cname,
unsigned char &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUByte ( uint32_t  cnum,
unsigned 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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUInt ( const char *  cname,
uint32_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUInt ( uint32_t  cnum,
uint32_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsULong ( const char *  cname,
uint64_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsULong ( uint32_t  cnum,
uint64_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUShort ( const char *  cname,
uint16_t &   
) const
pure virtual

Retrieve the value of the named column.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

Note
Note the cost of name lookup is likely to dominate the total cost of such a function.

Implemented in ibis::bord::cursor, ibis::tabele::cursor, ibis::tabula::cursor, and ibis::mensa::cursor.

virtual int ibis::table::cursor::getColumnAsUShort ( uint32_t  cnum,
uint16_t &  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.

These functions return the number of elements copied upon successful completion, otherwise they return a negative number to indicate failure.

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.


The documentation for this class was generated from the following file:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive