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

This class represents a compressed column with type T, is the base class for all compressed typed column classes and allows a uniform handling of compressed columns of a certain type T. More...

#include <compressed_column.hpp>

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

List of all members.

Public Member Functions

 CompressedColumn (const std::string &name, AttributeType db_type)
virtual ~CompressedColumn ()
virtual bool insert (const boost::any &new_Value)=0
 appends a value new_Value to end of column
virtual bool insert (const T &new_value)=0
virtual bool update (TID tid, const boost::any &new_value)=0
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tid, const boost::any &new_value)=0
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)=0
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)=0
 deletes the values defined in the position list
virtual bool clearContent ()=0
 deletes all values stored in the column
virtual const boost::any get (TID tid)=0
 generic function for fetching a value form a column (slow)
virtual void print () const =0 throw ()
 prints the content of a column
virtual size_t size () const =0 throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const =0 throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const =0
 virtual copy constructor
virtual bool store (const std::string &path)=0
 store a column on the disc
virtual bool load (const std::string &path)=0
 load column from disc
virtual bool isMaterialized () const throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual bool isCompressed () const throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual T & operator[] (const int index)=0
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
 CompressedColumn (const std::string &name, AttributeType db_type)
virtual ~CompressedColumn ()
virtual bool insert (const boost::any &new_Value)=0
 appends a value new_Value to end of column
virtual bool insert (const T &new_value)=0
virtual bool update (TID tid, const boost::any &new_value)=0
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tid, const boost::any &new_value)=0
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)=0
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)=0
 deletes the values defined in the position list
virtual bool clearContent ()=0
 deletes all values stored in the column
virtual const boost::any get (TID tid)=0
 generic function for fetching a value form a column (slow)
virtual void print () const =0 throw ()
 prints the content of a column
virtual size_t size () const =0 throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const =0 throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const =0
 virtual copy constructor
const ColumnPtr gather (PositionListPtr tid_list)
 creates a new column by fetching all values identified by the tid_list
virtual bool store (const std::string &path)=0
 store a column on the disc
virtual bool load (const std::string &path)=0
 load column from disc
virtual bool isMaterialized () const throw ()
 use this method to determine whether the column is materialized or a Lookup Column
virtual bool isCompressed () const throw ()
 use this method to determine whether the column is materialized or a Lookup Column
const ColumnPtr materialize () throw ()
 materializes a column to a normal uncompressed column with dense values
virtual T & operator[] (const int index)=0
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.

Detailed Description

template<class T>
class CoGaDB::CompressedColumn< T >

This class represents a compressed column with type T, is the base class for all compressed typed column classes and allows a uniform handling of compressed columns of a certain type T.

This class is indentended to be a base class, so it has a virtual destruktor and pure virtual methods, which need to be implemented in a derived class.

Author:
Sebastian Breß
Version:
0.2
Date:
2013

Constructor & Destructor Documentation

template<class T >
CoGaDB::CompressedColumn< T >::CompressedColumn ( const std::string &  name,
AttributeType  db_type 
)
template<class T >
CoGaDB::CompressedColumn< T >::~CompressedColumn ( ) [virtual]
template<class T>
CoGaDB::CompressedColumn< T >::CompressedColumn ( const std::string &  name,
AttributeType  db_type 
)
template<class T>
virtual CoGaDB::CompressedColumn< T >::~CompressedColumn ( ) [virtual]

Member Function Documentation

template<class T >
const ColumnPtr CoGaDB::CompressedColumn< T >::gather ( PositionListPtr  tid_list) [virtual]

creates a new column by fetching all values identified by the tid_list

Returns:
a ColumnPtr that contains only values from the tid_list

Implements CoGaDB::ColumnBaseTyped< T >.

References CoGaDB::ColumnBase::db_type_, CoGaDB::Column< T >::getContent(), and CoGaDB::ColumnBase::name_.

Here is the call graph for this function:

template<class T>
virtual const boost::any CoGaDB::CompressedColumn< T >::get ( TID  tid) [pure 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::ColumnBaseTyped< T >.

Implemented in CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::DictionaryCompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, and CoGaDB::RLECompressedColumn< T >.

template<class T>
virtual const boost::any CoGaDB::CompressedColumn< T >::get ( TID  tid) [pure 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::ColumnBaseTyped< T >.

Implemented in CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::DictionaryCompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, and CoGaDB::RLECompressedColumn< T >.

template<class T >
bool CoGaDB::CompressedColumn< T >::isCompressed ( ) const throw () [virtual]

use this method to determine whether the column is materialized or a Lookup Column

Returns:
true in case the column is storing the compressed values and false otherwise.

Implements CoGaDB::ColumnBaseTyped< T >.

Reimplemented in CoGaDB::DictionaryCompressedColumn< T >.

template<class T>
virtual bool CoGaDB::CompressedColumn< T >::isCompressed ( ) const throw () [virtual]

use this method to determine whether the column is materialized or a Lookup Column

Returns:
true in case the column is storing the compressed values and false otherwise.

Implements CoGaDB::ColumnBaseTyped< T >.

Reimplemented in CoGaDB::DictionaryCompressedColumn< T >.

template<class T >
bool CoGaDB::CompressedColumn< T >::isMaterialized ( ) const throw () [virtual]

use this method to determine whether the column is materialized or a Lookup Column

Returns:
true in case the column is storing the plain values (without compression) and false in case the column is a LookupColumn.

Implements CoGaDB::ColumnBaseTyped< T >.

Reimplemented in CoGaDB::DictionaryCompressedColumn< T >.

template<class T>
virtual bool CoGaDB::CompressedColumn< T >::isMaterialized ( ) const throw () [virtual]

use this method to determine whether the column is materialized or a Lookup Column

Returns:
true in case the column is storing the plain values (without compression) and false in case the column is a LookupColumn.

Implements CoGaDB::ColumnBaseTyped< T >.

Reimplemented in CoGaDB::DictionaryCompressedColumn< T >.

template<class T>
virtual bool CoGaDB::CompressedColumn< T >::load ( const std::string &  path) [pure virtual]
template<class T>
virtual bool CoGaDB::CompressedColumn< T >::load ( const std::string &  path) [pure virtual]
template<class T >
const ColumnPtr CoGaDB::CompressedColumn< T >::materialize ( ) throw () [virtual]

materializes a column to a normal uncompressed column with dense values

Returns:
a ColumnPtr to an materialized column

Implements CoGaDB::ColumnBaseTyped< T >.

References CoGaDB::ColumnBase::db_type_, CoGaDB::Column< T >::getContent(), CoGaDB::ColumnBase::name_, and CoGaDB::CompressedColumn< T >::size().

Here is the call graph for this function:

template<class T>
virtual T& CoGaDB::CompressedColumn< T >::operator[] ( const int  index) [pure 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::ColumnBaseTyped< T >.

Implemented in CoGaDB::RLECompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DictionaryCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, and CoGaDB::RLECompressedColumn< T >.

template<class T>
virtual T& CoGaDB::CompressedColumn< T >::operator[] ( const int  index) [pure 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::ColumnBaseTyped< T >.

Implemented in CoGaDB::RLECompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DeltaCompressedColumn< std::string >, CoGaDB::DictionaryCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::BitVectorCompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, CoGaDB::RLECompressedColumn< T >, CoGaDB::DeltaCompressedColumn< T >, and CoGaDB::RLECompressedColumn< T >.

template<class T>
virtual bool CoGaDB::CompressedColumn< T >::update ( TID  tid,
const boost::any &  new_Value 
) [pure virtual]
template<class T>
virtual bool CoGaDB::CompressedColumn< T >::update ( TID  tid,
const boost::any &  new_Value 
) [pure virtual]
template<class T>
virtual bool CoGaDB::CompressedColumn< T >::update ( PositionListPtr  tids,
const boost::any &  new_value 
) [pure virtual]
template<class T>
virtual bool CoGaDB::CompressedColumn< T >::update ( PositionListPtr  tids,
const boost::any &  new_value 
) [pure virtual]

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