Column-oriented GPU-accelerated Database Management System
CoGaDB
CoGaDB::Page Class Reference

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>

Collaboration diagram for CoGaDB::Page:

List of all members.

Public Member Functions

 Page (bool, AttributeType, bool)
 Page (const Page &)
Pageoperator= (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

Detailed Description

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.


Constructor & Destructor Documentation

CoGaDB::Page::Page ( bool  compressed,
AttributeType  type,
bool  bigDataSize 
)
CoGaDB::Page::Page ( const Page p)
CoGaDB::Page::Page ( std::ifstream &  source,
char  status 
)
CoGaDB::Page::~Page ( ) [virtual]

Member Function Documentation

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool CoGaDB::Page::appendData ( std::ifstream &  source) [protected]

References append(), appendVarchar(), CoGaDB::BOOLEAN, CoGaDB::FLOAT, getType(), CoGaDB::INT, and CoGaDB::VARCHAR.

Referenced by Page().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short CoGaDB::Page::count ( ) const

References _header, and CoGaDB::Header::Count.

Referenced by printStatus().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

References CoGaDB::BOOLEAN, CoGaDB::FLOAT, getType(), and CoGaDB::INT.

Referenced by append(), getValueByIndex(), isFull(), print(), and printStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

char CoGaDB::Page::getStatusBitAt ( char  pos) const [protected]

References _header, and CoGaDB::Header::Status.

Referenced by getMaxDataSize(), getType(), isCompressed(), isDirty(), and isInUsage().

Here is the caller graph for this function:

char * CoGaDB::Page::getStringByIndex ( unsigned int  index,
unsigned short &  valueSize 
)

References _data, and _value_offsets.

References BIT_TYPE_HIGH, BIT_TYPE_LOW, and getStatusBitAt().

Referenced by appendData(), getSizeOfOneValue(), print(), and printStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

char * CoGaDB::Page::getValueByIndex ( unsigned int  index,
unsigned short &  valueSize 
)

References _data, _value_offsets, and getSizeOfOneValue().

Here is the call graph for this function:

References BIT_COMPRESSED, and getStatusBitAt().

Referenced by printStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CoGaDB::Page::isDirty ( ) const

References BIT_DIRTY, and getStatusBitAt().

Referenced by printStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CoGaDB::Page::isFull ( ) const

References _isFull, getDataSize(), getMaxDataSize(), getSizeOfOneValue(), and CoGaDB::one.

Here is the call graph for this function:

bool CoGaDB::Page::isInUsage ( ) const

References BIT_USAGE, and getStatusBitAt().

Referenced by printStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

Page & CoGaDB::Page::operator= ( const Page )
void CoGaDB::Page::printBool ( unsigned short  pos) const [protected]

References _data.

Referenced by print().

Here is the caller graph for this function:

void CoGaDB::Page::printFloat ( unsigned short  pos) const [protected]

References _data.

Referenced by print().

Here is the caller graph for this function:

void CoGaDB::Page::printInt ( unsigned short  pos) const [protected]

References _data.

Referenced by print().

Here is the caller graph for this function:

int CoGaDB::Page::printVarchar ( unsigned short  pos) const [protected]

References _data, and VARCHAR_LENGTH_BYTES.

Referenced by print().

Here is the caller graph for this function:

void CoGaDB::Page::setStatusBit ( char  pos,
bool  val 
) [protected]

References _header, and CoGaDB::Header::Status.


Member Data Documentation

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

bool CoGaDB::Page::_isFull [private]

Referenced by appendVarchar(), and isFull().

std::vector<unsigned int> CoGaDB::Page::_value_offsets [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines