Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ibis::bord::cursor Class Reference
Inheritance diagram for ibis::bord::cursor:
ibis::table::cursor

Classes

struct  bufferElement
 

Public Member Functions

virtual ibis::table::stringArray columnNames () const
 
virtual ibis::table::typeArray columnTypes () const
 
 cursor (const ibis::bord &t)
 Constructor. More...
 
virtual int dump (std::ostream &out, const char *del) const
 Print the content of the current row.
 
virtual int fetch ()
 Make the next row of the data set available for retrieval. More...
 
virtual int fetch (uint64_t)
 Make the specified row in the data set available for retrieval. More...
 
virtual int fetch (ibis::table::row &)
 Fetch the content of the next row and make the next row as the current row as well. More...
 
virtual int fetch (uint64_t, ibis::table::row &)
 Fetch the content of the specified row and make that row the current row as well. More...
 
virtual int getColumnAsByte (const char *, char &) const
 
virtual int getColumnAsByte (uint32_t, char &) const
 
virtual int getColumnAsDouble (const char *, double &) const
 
virtual int getColumnAsDouble (uint32_t, double &) const
 
virtual int getColumnAsFloat (const char *, float &) const
 
virtual int getColumnAsFloat (uint32_t, float &) const
 
virtual int getColumnAsInt (const char *, int32_t &) const
 
virtual int getColumnAsInt (uint32_t, int32_t &) const
 
virtual int getColumnAsLong (const char *, int64_t &) const
 
virtual int getColumnAsLong (uint32_t, int64_t &) const
 
virtual int getColumnAsOpaque (const char *, ibis::opaque &) const
 
virtual int getColumnAsOpaque (uint32_t, ibis::opaque &) const
 
virtual int getColumnAsShort (const char *, int16_t &) const
 
virtual int getColumnAsShort (uint32_t, int16_t &) const
 
virtual int getColumnAsString (const char *, std::string &) const
 
virtual int getColumnAsString (uint32_t, std::string &) const
 
virtual int getColumnAsUByte (const char *, unsigned char &) const
 
virtual int getColumnAsUByte (uint32_t, unsigned char &) const
 
virtual int getColumnAsUInt (const char *, uint32_t &) const
 
virtual int getColumnAsUInt (uint32_t, uint32_t &) const
 
virtual int getColumnAsULong (const char *, uint64_t &) const
 
virtual int getColumnAsULong (uint32_t, uint64_t &) const
 
virtual int getColumnAsUShort (const char *, uint16_t &) const
 
virtual int getColumnAsUShort (uint32_t, uint16_t &) const
 
virtual uint64_t getCurrentRowNumber () const
 Return the current row number. More...
 
virtual uint32_t nColumns () const
 
virtual uint64_t nRows () const
 

Protected Types

typedef std::map< const char *, uint32_t, ibis::lessi > bufferMap
 

Protected Member Functions

int dumpIJ (std::ostream &, uint32_t, uint32_t) const
 
void fillRow (ibis::table::row &res) const
 
- Protected Member Functions inherited from ibis::table::cursor
 cursor (const cursor &)
 
cursoroperator= (const cursor &)
 

Protected Attributes

std::vector< bufferElementbuffer
 
bufferMap bufmap
 
int64_t curRow
 
const ibis::bordtab
 

Constructor & Destructor Documentation

ibis::bord::cursor::cursor ( const ibis::bord t)

Constructor.

It retrieves the columns from the table object using that function ibis::part::getColumn(uint32_t), which preserves the order specified in the original table construction, but may leave the columns in an arbitrary order.

References cursor(), ibis::part::getColumn(), ibis::bord::column::getDictionary(), ibis::column::name(), ibis::bord::nColumns(), and ibis::column::type().

Referenced by cursor().

Member Function Documentation

int ibis::bord::cursor::fetch ( )
inlinevirtual

Make the next row of the data set available for retrieval.

Returns 0 if successful, returns a negative number to indicate error.

Implements ibis::table::cursor.

int ibis::bord::cursor::fetch ( uint64_t  rownum)
inlinevirtual

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

Implements ibis::table::cursor.

int ibis::bord::cursor::fetch ( ibis::table::row )
inlinevirtual

Fetch the content of the next row and make the next row as the current row as well.

Implements ibis::table::cursor.

int ibis::bord::cursor::fetch ( uint64_t  rownum,
ibis::table::row  
)
inlinevirtual

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

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsByte ( const char *  cname,
char &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsByte ( uint32_t  cnum,
char &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::UBYTE.

int ibis::bord::cursor::getColumnAsDouble ( const char *  cname,
double &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsDouble ( uint32_t  cnum,
double &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::DOUBLE, ibis::FLOAT, ibis::INT, ibis::SHORT, ibis::UBYTE, ibis::UINT, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsFloat ( const char *  cname,
float &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsFloat ( uint32_t  cnum,
float &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::FLOAT, ibis::SHORT, ibis::UBYTE, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsInt ( const char *  cname,
int32_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsInt ( uint32_t  cnum,
int32_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::INT, ibis::SHORT, ibis::UBYTE, ibis::UINT, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsLong ( const char *  cname,
int64_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsLong ( uint32_t  cnum,
int64_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::INT, ibis::LONG, ibis::SHORT, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsOpaque ( const char *  cname,
ibis::opaque &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsOpaque ( uint32_t  cnum,
ibis::opaque &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::BLOB, ibis::CATEGORY, ibis::array_t< T >::copy(), ibis::DOUBLE, ibis::FLOAT, ibis::INT, ibis::LONG, ibis::SHORT, ibis::array_t< T >::size(), ibis::TEXT, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsShort ( const char *  cname,
int16_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsShort ( uint32_t  cnum,
int16_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::SHORT, ibis::UBYTE, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsString ( const char *  cname,
std::string &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsString ( uint32_t  cnum,
std::string &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::CATEGORY, ibis::DOUBLE, ibis::FLOAT, ibis::column::getString(), ibis::INT, ibis::LONG, ibis::SHORT, ibis::TEXT, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsUByte ( const char *  cname,
unsigned char &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsUByte ( uint32_t  cnum,
unsigned char &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::UBYTE.

int ibis::bord::cursor::getColumnAsUInt ( const char *  cname,
uint32_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsUInt ( uint32_t  cnum,
uint32_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::INT, ibis::SHORT, ibis::UBYTE, ibis::UINT, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsULong ( const char *  cname,
uint64_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsULong ( uint32_t  cnum,
uint64_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::INT, ibis::LONG, ibis::SHORT, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.

int ibis::bord::cursor::getColumnAsUShort ( const char *  cname,
uint16_t &   
) const
inlinevirtual

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.

Implements ibis::table::cursor.

int ibis::bord::cursor::getColumnAsUShort ( uint32_t  cnum,
uint16_t &  val 
) const
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.

Implements ibis::table::cursor.

References ibis::SHORT, ibis::UBYTE, and ibis::USHORT.

virtual uint64_t ibis::bord::cursor::getCurrentRowNumber ( ) const
inlinevirtual

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.

Implements ibis::table::cursor.


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

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