Column-oriented GPU-accelerated Database Management System
CoGaDB
|
Representation of a set of rows stored as bytes. More...
#include <row_page.hpp>
Public Member Functions | |
RowPage (unsigned short) | |
RowPage (const RowPage &) | |
RowPage & | operator= (const RowPage &) |
bool | isFull () const |
bool | fillPage (std::vector< BufferObject * >, int) |
void | print (const TableSchema &) const |
unsigned short | getMaxDataSize () const |
unsigned short | getDataSize () const |
unsigned short | count () const |
char * | createRow (std::vector< BufferObject * >, int, unsigned short &, unsigned short &) |
char * | getValue (unsigned int, unsigned int, unsigned short &) const |
char * | getData () const |
Private Member Functions | |
char * | getValueFromPage (BufferObject *, int, unsigned short &) |
Gets from a buffered page the value at 'index'. Also results the size of the value in bytes. | |
char * | getStringFromPage (BufferObject *, int, unsigned short &) |
Gets from a buffered page the string at 'index'. Also results the size of the string in bytes. | |
Private Attributes | |
char * | _rows |
Represents the rwos as bytes. | |
std::vector< unsigned short > | _row_offsets |
Holds the offsets for each row. | |
unsigned short | _col_count |
Number of columns for this rows. | |
unsigned short | _row_count |
Number of rows on this page. | |
bool | _is_full |
true, if the page can't hold a row anymore | |
unsigned short | _current_data_size |
The current data size of all rows (_rows) in bytes. |
Representation of a set of rows stored as bytes.
CoGaDB::RowPage::RowPage | ( | unsigned short | columns | ) |
CoGaDB::RowPage::RowPage | ( | const RowPage & | rp | ) |
unsigned short CoGaDB::RowPage::count | ( | ) | const |
References _row_count.
Referenced by getStringFromPage(), getValueFromPage(), and CoGaDB::RowTable::load().
char * CoGaDB::RowPage::createRow | ( | std::vector< BufferObject * > | pages, |
int | pos, | ||
unsigned short & | offset, | ||
unsigned short & | resRowSize | ||
) |
References getValueFromPage().
Referenced by fillPage().
bool CoGaDB::RowPage::fillPage | ( | std::vector< BufferObject * > | pages, |
int | start | ||
) |
References _current_data_size, _is_full, _row_count, _row_offsets, _rows, createRow(), getMaxDataSize(), and isFull().
Referenced by CoGaDB::RowTable::load().
char * CoGaDB::RowPage::getData | ( | ) | const |
References _rows.
unsigned short CoGaDB::RowPage::getDataSize | ( | ) | const |
References _current_data_size.
unsigned short CoGaDB::RowPage::getMaxDataSize | ( | ) | const |
char * CoGaDB::RowPage::getStringFromPage | ( | BufferObject * | bo, |
int | index, | ||
unsigned short & | valueSize | ||
) | [private] |
Gets from a buffered page the string at 'index'. Also results the size of the string in bytes.
References count(), CoGaDB::BufferObject::getPage(), and CoGaDB::BufferObject::next().
Referenced by getValueFromPage().
char * CoGaDB::RowPage::getValue | ( | unsigned int | page_row, |
unsigned int | col, | ||
unsigned short & | length | ||
) | const |
References _col_count, _row_offsets, and _rows.
char * CoGaDB::RowPage::getValueFromPage | ( | BufferObject * | bo, |
int | index, | ||
unsigned short & | valueSize | ||
) | [private] |
Gets from a buffered page the value at 'index'. Also results the size of the value in bytes.
References count(), CoGaDB::BufferObject::getPage(), getStringFromPage(), CoGaDB::BufferObject::next(), and CoGaDB::VARCHAR.
Referenced by createRow().
bool CoGaDB::RowPage::isFull | ( | ) | const |
void CoGaDB::RowPage::print | ( | const TableSchema & | schema | ) | const |
References _current_data_size, _row_count, _row_offsets, _rows, CoGaDB::BOOLEAN, CoGaDB::FLOAT, CoGaDB::INT, and CoGaDB::VARCHAR.
unsigned short CoGaDB::RowPage::_col_count [private] |
Number of columns for this rows.
Referenced by getValue().
unsigned short CoGaDB::RowPage::_current_data_size [private] |
The current data size of all rows (_rows) in bytes.
Referenced by fillPage(), getDataSize(), and print().
bool CoGaDB::RowPage::_is_full [private] |
true, if the page can't hold a row anymore
Referenced by fillPage(), and isFull().
unsigned short CoGaDB::RowPage::_row_count [private] |
Number of rows on this page.
Referenced by count(), fillPage(), and print().
std::vector<unsigned short> CoGaDB::RowPage::_row_offsets [private] |
Holds the offsets for each row.
Referenced by fillPage(), getValue(), print(), and RowPage().
char* CoGaDB::RowPage::_rows [private] |
Represents the rwos as bytes.
Referenced by fillPage(), getData(), getValue(), print(), and RowPage().