Column-oriented GPU-accelerated Database Management System
CoGaDB
CoGaDB::RLECompressedColumn< T > Class Template Reference

#include <rle_compressed_column.hpp>

Inheritance diagram for CoGaDB::RLECompressedColumn< T >:
Collaboration diagram for CoGaDB::RLECompressedColumn< T >:

List of all members.

Public Member Functions

 RLECompressedColumn (const std::string &name, AttributeType db_type)
 ~RLECompressedColumn ()
bool insert (const boost::any &new_Value)
 appends a value new_Value to end of column
bool insert (const T &new_value)
template<typename InputIterator >
bool insert (InputIterator first, InputIterator last)
bool update (TID tid, const boost::any &new_value)
 updates the value on position tid with a value new_Value
bool update (PositionListPtr tid, const boost::any &new_value)
 updates the values specified by the position list with a value new_Value
bool remove (TID tid)
 deletes the value on position tid
bool remove (PositionListPtr tid)
 deletes the values defined in the position list
bool clearContent ()
 deletes all values stored in the column
const boost::any get (TID tid)
 generic function for fetching a value form a column (slow)
void print () const throw ()
 prints the content of a column
size_t size () const throw ()
 returns the number of values (rows) in a column
unsigned int getSizeinBytes () const throw ()
 returns the size in bytes the column consumes in main memory
const ColumnPtr copy () const
 virtual copy constructor
bool store (const std::string &path)
 store a column on the disc
bool load (const std::string &path)
 load column from disc
T & operator[] (const int index)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
 RLECompressedColumn (const std::string &name, AttributeType db_type)
 ~RLECompressedColumn ()
bool insert (const boost::any &new_Value)
 appends a value new_Value to end of column
bool insert (const T &new_value)
template<typename InputIterator >
bool insert (InputIterator first, InputIterator last)
bool update (TID tid, const boost::any &new_value)
 updates the value on position tid with a value new_Value
bool update (PositionListPtr tid, const boost::any &new_value)
 updates the values specified by the position list with a value new_Value
bool remove (TID tid)
 deletes the value on position tid
bool remove (PositionListPtr tid)
 deletes the values defined in the position list
bool clearContent ()
 deletes all values stored in the column
const boost::any get (TID tid)
 generic function for fetching a value form a column (slow)
void print () const throw ()
 prints the content of a column
size_t size () const throw ()
 returns the number of values (rows) in a column
unsigned int getSizeinBytes () const throw ()
 returns the size in bytes the column consumes in main memory
const ColumnPtr copy () const
 virtual copy constructor
bool store (const std::string &path)
 store a column on the disc
bool load (const std::string &path)
 load column from disc
T & operator[] (const int index)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
template<>
bool insert (const std::string &new_value)
template<>
std::string & operator[] (const int index)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
template<>
unsigned int getSizeinBytes () const throw()
 returns the size in bytes the column consumes in main memory
template<>
bool insert (const std::string &new_value)
template<>
std::string & operator[] (const int index)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
template<>
unsigned int getSizeinBytes () const throw()
 returns the size in bytes the column consumes in main memory

Private Attributes

std::vector< T > values_
std::vector< unsigned char > count_
std::string last_compressed_value

template<class T>
class CoGaDB::RLECompressedColumn< T >


Constructor & Destructor Documentation

template<class T >
CoGaDB::RLECompressedColumn< T >::RLECompressedColumn ( const std::string &  name,
AttributeType  db_type 
)
template<class T >
CoGaDB::RLECompressedColumn< T >::~RLECompressedColumn ( )
template<class T >
CoGaDB::RLECompressedColumn< T >::RLECompressedColumn ( const std::string &  name,
AttributeType  db_type 
)
template<class T >
CoGaDB::RLECompressedColumn< T >::~RLECompressedColumn ( )

Member Function Documentation

template<class T >
bool CoGaDB::RLECompressedColumn< T >::clearContent ( ) [virtual]

deletes all values stored in the column

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::clearContent ( ) [virtual]

deletes all values stored in the column

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
const ColumnPtr CoGaDB::RLECompressedColumn< T >::copy ( ) const [virtual]

virtual copy constructor

Returns:
a ColumnPtr to an exakt copy of the current column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
const ColumnPtr CoGaDB::RLECompressedColumn< T >::copy ( ) const [virtual]

virtual copy constructor

Returns:
a ColumnPtr to an exakt copy of the current column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
const boost::any CoGaDB::RLECompressedColumn< T >::get ( TID  tid) [virtual]

generic function for fetching a value form a column (slow)

check whether the object is valid (e.g., when a tid is not valid, then the returned object is invalid as well)

Returns:
object of type boost::any containing the value on position tid

Implements CoGaDB::CompressedColumn< T >.

template<class T >
const boost::any CoGaDB::RLECompressedColumn< T >::get ( TID  tid) [virtual]

generic function for fetching a value form a column (slow)

check whether the object is valid (e.g., when a tid is not valid, then the returned object is invalid as well)

Returns:
object of type boost::any containing the value on position tid

Implements CoGaDB::CompressedColumn< T >.

template<class T >
unsigned int CoGaDB::RLECompressedColumn< T >::getSizeinBytes ( ) const throw () [virtual]

returns the size in bytes the column consumes in main memory

Implements CoGaDB::CompressedColumn< T >.

template<class T >
unsigned int CoGaDB::RLECompressedColumn< T >::getSizeinBytes ( ) const throw () [virtual]

returns the size in bytes the column consumes in main memory

Implements CoGaDB::CompressedColumn< T >.

template<>
unsigned int CoGaDB::RLECompressedColumn< std::string >::getSizeinBytes ( ) const throw() [inline, virtual]

returns the size in bytes the column consumes in main memory

Implements CoGaDB::CompressedColumn< T >.

template<>
unsigned int CoGaDB::RLECompressedColumn< std::string >::getSizeinBytes ( ) const throw() [inline, virtual]

returns the size in bytes the column consumes in main memory

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::insert ( const boost::any &  new_Value) [virtual]

appends a value new_Value to end of column

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::insert ( const boost::any &  new_Value) [virtual]

appends a value new_Value to end of column

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::insert ( const T &  new_value) [virtual]
template<class T >
bool CoGaDB::RLECompressedColumn< T >::insert ( const T &  new_value) [virtual]
template<class T >
template<typename InputIterator >
bool CoGaDB::RLECompressedColumn< T >::insert ( InputIterator  first,
InputIterator  last 
)
template<typename T >
template<typename InputIterator >
bool CoGaDB::RLECompressedColumn< T >::insert ( InputIterator  first,
InputIterator  last 
)
template<>
bool CoGaDB::RLECompressedColumn< std::string >::insert ( const std::string &  new_value)

References CoGaDB::rle_encode_string().

Here is the call graph for this function:

template<>
bool CoGaDB::RLECompressedColumn< std::string >::insert ( const std::string &  new_value)
template<class T >
bool CoGaDB::RLECompressedColumn< T >::load ( const std::string &  path) [virtual]

load column from disc

calling load on a column that is not empty yields undefined behaviour

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::load ( const std::string &  path) [virtual]

load column from disc

calling load on a column that is not empty yields undefined behaviour

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
T & CoGaDB::RLECompressedColumn< T >::operator[] ( const int  index) [virtual]

defines operator[] for this class, which enables the user to thread all typed columns as arrays.

Note that this method is pure virtual, so it has to be defined in a derived class.

Returns:
a reference to the value at position index

Implements CoGaDB::CompressedColumn< T >.

template<class T >
T& CoGaDB::RLECompressedColumn< T >::operator[] ( const int  index) [virtual]

defines operator[] for this class, which enables the user to thread all typed columns as arrays.

Note that this method is pure virtual, so it has to be defined in a derived class.

Returns:
a reference to the value at position index

Implements CoGaDB::CompressedColumn< T >.

template<>
std::string & CoGaDB::RLECompressedColumn< std::string >::operator[] ( const int  index) [virtual]

defines operator[] for this class, which enables the user to thread all typed columns as arrays.

Note that this method is pure virtual, so it has to be defined in a derived class.

Returns:
a reference to the value at position index

Implements CoGaDB::CompressedColumn< T >.

References CoGaDB::RLECompressedColumn< T >::last_compressed_value.

template<>
std::string & CoGaDB::RLECompressedColumn< std::string >::operator[] ( const int  index) [virtual]

defines operator[] for this class, which enables the user to thread all typed columns as arrays.

Note that this method is pure virtual, so it has to be defined in a derived class.

Returns:
a reference to the value at position index

Implements CoGaDB::CompressedColumn< T >.

template<class T >
void CoGaDB::RLECompressedColumn< T >::print ( ) const throw () [virtual]

prints the content of a column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
void CoGaDB::RLECompressedColumn< T >::print ( ) const throw () [virtual]

prints the content of a column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::remove ( TID  tid) [virtual]

deletes the value on position tid

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::remove ( TID  tid) [virtual]

deletes the value on position tid

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::remove ( PositionListPtr  tid) [virtual]

deletes the values defined in the position list

assumes tid list is sorted ascending

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::remove ( PositionListPtr  tid) [virtual]

deletes the values defined in the position list

assumes tid list is sorted ascending

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
size_t CoGaDB::RLECompressedColumn< T >::size ( ) const throw () [virtual]

returns the number of values (rows) in a column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
size_t CoGaDB::RLECompressedColumn< T >::size ( ) const throw () [virtual]

returns the number of values (rows) in a column

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::store ( const std::string &  path) [virtual]

store a column on the disc

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::store ( const std::string &  path) [virtual]

store a column on the disc

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::update ( TID  tid,
const boost::any &  new_Value 
) [virtual]

updates the value on position tid with a value new_Value

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::update ( TID  tid,
const boost::any &  new_Value 
) [virtual]

updates the value on position tid with a value new_Value

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::update ( PositionListPtr  tids,
const boost::any &  new_value 
) [virtual]

updates the values specified by the position list with a value new_Value

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.

template<class T >
bool CoGaDB::RLECompressedColumn< T >::update ( PositionListPtr  tids,
const boost::any &  new_value 
) [virtual]

updates the values specified by the position list with a value new_Value

Returns:
true for sucess and false in case an error occured

Implements CoGaDB::CompressedColumn< T >.


Member Data Documentation

template<class T >
std::vector< unsigned char > CoGaDB::RLECompressedColumn< T >::count_ [private]
template<class T >
std::string CoGaDB::RLECompressedColumn< T >::last_compressed_value [private]
template<class T >
std::vector< T > CoGaDB::RLECompressedColumn< T >::values_ [private]

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