To read a list of variables at the same time. More...
#include <part.h>
Public Member Functions | |
barrel (const ibis::part *t=0) | |
virtual long | close () |
!< Open all data files. | |
const ibis::column * | getColumn (uint32_t i) const |
void | getNullMask (ibis::bitvector &mask) const |
Collect the null masks together. | |
virtual long | open (const ibis::part *t=0) |
!< Destructor closes the open files. More... | |
virtual long | read () |
!< Close all open files. More... | |
virtual long | seek (uint32_t pos) |
!< Read one value for each variable. More... | |
uint32_t | tell () const |
virtual | ~barrel () |
Destructor. Member variables clean themselves. | |
Public Member Functions inherited from ibis::math::barrel | |
barrel () | |
Constructor. | |
barrel (const term *const t) | |
Constructor. | |
bool | equivalent (const barrel &rhs) const |
Is the given barrel of variables equivalent to this one? More... | |
const char * | name (uint32_t i) const |
void | recordVariable (const qExpr *const t) |
Record the variable names appear in the query expression. More... | |
void | recordVariable (const term *const t) |
Record the variable names appear in the term . More... | |
uint32_t | recordVariable (const char *name) |
Record the specified name. More... | |
uint32_t | size () const |
const double & | value (uint32_t i) const |
double & | value (uint32_t i) |
Protected Attributes | |
const ibis::part * | _tbl |
std::vector< const ibis::column * > | cols |
std::vector< int > | fdes |
uint32_t | position |
std::vector< ibis::fileManager::storage * > | stores |
Protected Attributes inherited from ibis::math::barrel | |
std::vector< const char * > | namelist |
List of variable names. | |
termMap | varmap |
Associate a variable name with a position in varvalues and namelist . More... | |
std::vector< double > | varvalues |
Cast values to double. | |
Additional Inherited Members | |
Protected Types inherited from ibis::math::barrel | |
typedef std::map< const char *, uint32_t, ibis::lessi > | termMap |
Protected Member Functions inherited from ibis::math::barrel | |
double | getValue (uint32_t i) const |
double | getValue (const char *nm) const |
Return the value of the named variable. | |
To read a list of variables at the same time.
This implementation opens each data file and read the values from the files one at a time.
|
virtual |
!< Destructor closes the open files.
If the data files are on disk, then attempt to read the content through ibis::fileManager::getFile first.
If that fails, open the data file and so that each value can be read one at a time. If the data files are not on disk, it invokes the function getRawData to get a pointer to the raw data in memory. Upon successful completion, it returns 0, otherwise it returns a negative value to indicate error conditions.
The argument t may be left as nil if the barrel object was initialized with a valid pointer to the ibis::part object.
Reimplemented in ibis::part::vault.
References ibis::fileManager::storage::beginUse(), ibis::BLOB, ibis::CATEGORY, ibis::part::currentDataDir(), ibis::part::getColumn(), ibis::column::getRawData(), ibis::fileManager::instance(), ibis::part::name(), ibis::column::name(), ibis::TEXT, ibis::column::type(), ibis::TYPESTRING, and UnixOpen.
Referenced by ibis::part::calculate(), ibis::part::doScan(), and ibis::part::evaluateJoin().
|
virtual |
!< Close all open files.
Read the variable values from the current record.
All values are internally stored as doubles.
Reimplemented in ibis::part::vault.
References ibis::CATEGORY, ibis::DOUBLE, ibis::FLOAT, ibis::INT, ibis::LONG, ibis::OID, ibis::SHORT, ibis::TEXT, ibis::TYPESTRING, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.
Referenced by ibis::part::calculate(), ibis::part::doScan(), and ibis::part::evaluateJoin().
|
virtual |
!< Read one value for each variable.
Seek to the position of the specified record for all variables.
Move the file pointers to the posth record. Return 0 for success and other integer for error.
Reimplemented in ibis::part::vault.
References ibis::part::nRows().
Referenced by ibis::part::calculate(), ibis::part::doScan(), and ibis::part::evaluateJoin().