ibis::table::cursor Class Reference

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

#include <table.h>

Inherited by ibis::bord::cursor, ibis::mensa::cursor, ibis::tabele::cursor, and ibis::tabula::cursor.

List of all members.

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 (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 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)=0
 Make the specified row in the data set available for retrieval.
virtual int fetch ()=0
 Make the next row of the data set available for retrieval.
virtual int getColumnAsByte (size_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 getColumnAsByte (const char *cname, char *) const =0
 Retrieve the value of the named column.
virtual int getColumnAsDouble (size_t cnum, double *val) const =0
virtual int getColumnAsDouble (const char *cname, double *) const =0
virtual int getColumnAsFloat (size_t cnum, float *val) const =0
virtual int getColumnAsFloat (const char *cname, float *) const =0
virtual int getColumnAsInt (size_t cnum, int32_t *val) const =0
virtual int getColumnAsInt (const char *cname, int32_t *) const =0
virtual int getColumnAsLong (size_t cnum, int64_t *val) const =0
virtual int getColumnAsLong (const char *cname, int64_t *) const =0
virtual int getColumnAsShort (size_t cnum, int16_t *val) const =0
virtual int getColumnAsShort (const char *cname, int16_t *) const =0
virtual int getColumnAsString (size_t cnum, std::string &val) const =0
virtual int getColumnAsString (const char *cname, std::string &) const =0
virtual int getColumnAsUByte (size_t cnum, unsigned char *val) const =0
virtual int getColumnAsUByte (const char *cname, unsigned char *) const =0
virtual int getColumnAsUInt (size_t cnum, uint32_t *val) const =0
virtual int getColumnAsUInt (const char *cname, uint32_t *) const =0
virtual int getColumnAsULong (size_t cnum, uint64_t *val) const =0
virtual int getColumnAsULong (const char *cname, uint64_t *) const =0
virtual int getColumnAsUShort (size_t cnum, uint16_t *val) const =0
virtual int getColumnAsUShort (const char *cname, uint16_t *) const =0
virtual uint64_t getCurrentRowNumber () const =0
 Return the current row number.
virtual size_t nColumns () const =0
virtual uint64_t nRows () 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 overall 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 ( uint64_t  rownum,
ibis::table::row  
) [pure virtual]

Fetch the content of the specified row and make that row the current row as well.

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.

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).

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.

virtual int ibis::table::cursor::getColumnAsByte ( size_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.

virtual int ibis::table::cursor::getColumnAsByte ( const char *  cname,
char *   
) const [pure virtual]

Retrieve the value of the named column.

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

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.


The documentation for this class was generated from the following file:
Make It A Bit Faster
Disclaimers
FastBit source code
FastBit mailing list archive
Maintainer of this page