Column-oriented GPU-accelerated Database Management System
CoGaDB
|
Representation of a Page (content from file). Each page holds data from one column. However, all data at one page will be of same type. More...
#include <page.hpp>
Public Member Functions | |
Page (bool, AttributeType, bool) | |
Page (const Page &) | |
Page & | operator= (const Page &) |
Page (std::ifstream &, char) | |
virtual | ~Page () |
bool | isCompressed () const |
AttributeType | getType () const |
bool | isDirty () const |
bool | isInUsage () const |
unsigned short | getDataSize () const |
int | getFileOffset () const |
unsigned short | getMaxDataSize () const |
void | printStatus () const |
int | getSizeOfOneValue () const |
void | print () const |
bool | isFull () const |
char * | getData () |
unsigned short | count () const |
char * | getStringByIndex (unsigned int index, unsigned short &valueSize) |
char * | getValueByIndex (unsigned int index, unsigned short &valueSize) |
Protected Member Functions | |
bool | appendData (std::ifstream &) |
char | getStatusBitAt (char) const |
bool | append (std::ifstream &) |
bool | appendVarchar (std::ifstream &) |
void | setStatusBit (char, bool) |
void | printInt (unsigned short) const |
void | printFloat (unsigned short) const |
void | printBool (unsigned short) const |
int | printVarchar (unsigned short) const |
Private Attributes | |
Header | _header |
char * | _data |
bool | _isFull |
std::vector< unsigned int > | _value_offsets |
Representation of a Page (content from file). Each page holds data from one column. However, all data at one page will be of same type.
CoGaDB::Page::Page | ( | bool | compressed, |
AttributeType | type, | ||
bool | bigDataSize | ||
) |
References _data, _header, BIT_LENGTH, BIT_TYPE_LOW, CoGaDB::Header::Count, DATA_OFFSET, getMaxDataSize(), CoGaDB::Header::Offset, CoGaDB::Header::Size, and CoGaDB::Header::Status.
CoGaDB::Page::Page | ( | const Page & | p | ) |
CoGaDB::Page::Page | ( | std::ifstream & | source, |
char | status | ||
) |
References _data, _header, appendData(), CoGaDB::Header::Count, getMaxDataSize(), CoGaDB::Header::Offset, CoGaDB::Header::Size, and CoGaDB::Header::Status.
CoGaDB::Page::~Page | ( | ) | [virtual] |
bool CoGaDB::Page::append | ( | std::ifstream & | source | ) | [protected] |
References _data, _header, _value_offsets, CoGaDB::Header::Count, getMaxDataSize(), getSizeOfOneValue(), and CoGaDB::Header::Size.
Referenced by appendData().
bool CoGaDB::Page::appendData | ( | std::ifstream & | source | ) | [protected] |
References append(), appendVarchar(), CoGaDB::BOOLEAN, CoGaDB::FLOAT, getType(), CoGaDB::INT, and CoGaDB::VARCHAR.
Referenced by Page().
bool CoGaDB::Page::appendVarchar | ( | std::ifstream & | source | ) | [protected] |
References _data, _header, _isFull, _value_offsets, CoGaDB::Header::Count, getMaxDataSize(), CoGaDB::Header::Size, and VARCHAR_LENGTH_BYTES.
Referenced by appendData().
unsigned short CoGaDB::Page::count | ( | ) | const |
References _header, and CoGaDB::Header::Count.
Referenced by printStatus().
char * CoGaDB::Page::getData | ( | ) |
References _data.
unsigned short CoGaDB::Page::getDataSize | ( | ) | const |
Gets size of the current holding data (in bytes).
References _header, and CoGaDB::Header::Size.
Referenced by isFull(), and printStatus().
int CoGaDB::Page::getFileOffset | ( | ) | const |
References _header, and CoGaDB::Header::Offset.
unsigned short CoGaDB::Page::getMaxDataSize | ( | ) | const |
Gets the max. size of the data this page can hold (in bytes).
References BIT_LENGTH, and getStatusBitAt().
Referenced by append(), appendVarchar(), isFull(), Page(), and printStatus().
int CoGaDB::Page::getSizeOfOneValue | ( | ) | const |
References CoGaDB::BOOLEAN, CoGaDB::FLOAT, getType(), and CoGaDB::INT.
Referenced by append(), getValueByIndex(), isFull(), print(), and printStatus().
char CoGaDB::Page::getStatusBitAt | ( | char | pos | ) | const [protected] |
References _header, and CoGaDB::Header::Status.
Referenced by getMaxDataSize(), getType(), isCompressed(), isDirty(), and isInUsage().
char * CoGaDB::Page::getStringByIndex | ( | unsigned int | index, |
unsigned short & | valueSize | ||
) |
References _data, and _value_offsets.
AttributeType CoGaDB::Page::getType | ( | ) | const |
References BIT_TYPE_HIGH, BIT_TYPE_LOW, and getStatusBitAt().
Referenced by appendData(), getSizeOfOneValue(), print(), and printStatus().
char * CoGaDB::Page::getValueByIndex | ( | unsigned int | index, |
unsigned short & | valueSize | ||
) |
References _data, _value_offsets, and getSizeOfOneValue().
bool CoGaDB::Page::isCompressed | ( | ) | const |
References BIT_COMPRESSED, and getStatusBitAt().
Referenced by printStatus().
bool CoGaDB::Page::isDirty | ( | ) | const |
References BIT_DIRTY, and getStatusBitAt().
Referenced by printStatus().
bool CoGaDB::Page::isFull | ( | ) | const |
References _isFull, getDataSize(), getMaxDataSize(), getSizeOfOneValue(), and CoGaDB::one.
bool CoGaDB::Page::isInUsage | ( | ) | const |
References BIT_USAGE, and getStatusBitAt().
Referenced by printStatus().
void CoGaDB::Page::print | ( | ) | const |
References _header, CoGaDB::BOOLEAN, CoGaDB::FLOAT, getSizeOfOneValue(), getType(), CoGaDB::INT, printBool(), printFloat(), printInt(), printVarchar(), CoGaDB::Header::Size, and CoGaDB::VARCHAR.
void CoGaDB::Page::printBool | ( | unsigned short | pos | ) | const [protected] |
void CoGaDB::Page::printFloat | ( | unsigned short | pos | ) | const [protected] |
void CoGaDB::Page::printInt | ( | unsigned short | pos | ) | const [protected] |
void CoGaDB::Page::printStatus | ( | ) | const |
References _header, count(), getDataSize(), getMaxDataSize(), getSizeOfOneValue(), getType(), isCompressed(), isDirty(), isInUsage(), and CoGaDB::Header::Offset.
int CoGaDB::Page::printVarchar | ( | unsigned short | pos | ) | const [protected] |
References _data, and VARCHAR_LENGTH_BYTES.
Referenced by print().
void CoGaDB::Page::setStatusBit | ( | char | pos, |
bool | val | ||
) | [protected] |
References _header, and CoGaDB::Header::Status.
char* CoGaDB::Page::_data [private] |
The data of the page -> all of the same type.
Referenced by append(), appendVarchar(), getData(), getStringByIndex(), getValueByIndex(), Page(), printBool(), printFloat(), printInt(), and printVarchar().
Header CoGaDB::Page::_header [private] |
Information of this page (7 bytes).
Referenced by append(), appendVarchar(), count(), getDataSize(), getFileOffset(), getStatusBitAt(), Page(), print(), printStatus(), and setStatusBit().
bool CoGaDB::Page::_isFull [private] |
Referenced by appendVarchar(), and isFull().
std::vector<unsigned int> CoGaDB::Page::_value_offsets [private] |
Referenced by append(), appendVarchar(), getStringByIndex(), and getValueByIndex().