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

#include <column.hpp>

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

List of all members.

Classes

struct  Type_TID_Comparator

Public Member Functions

 Column (const std::string &name, AttributeType db_type)
virtual ~Column ()
virtual 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)
virtual bool update (TID tid, const boost::any &new_value)
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tid, const boost::any &new_value)
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)
 deletes the values defined in the position list
virtual bool clearContent ()
 deletes all values stored in the column
virtual const boost::any get (TID tid)
 generic function for fetching a value form a column (slow)
virtual void print () const throw ()
 prints the content of a column
virtual size_t size () const throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const
 virtual copy constructor
virtual bool store (const std::string &path)
 store a column on the disc
virtual bool load (const std::string &path)
 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)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
std::vector< T > & getContent ()
 Column (const std::string &name, AttributeType db_type)
virtual ~Column ()
virtual 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)
virtual bool update (TID tid, const boost::any &new_value)
 updates the value on position tid with a value new_Value
virtual bool update (PositionListPtr tid, const boost::any &new_value)
 updates the values specified by the position list with a value new_Value
virtual bool remove (TID tid)
 deletes the value on position tid
virtual bool remove (PositionListPtr tid)
 deletes the values defined in the position list
virtual bool clearContent ()
 deletes all values stored in the column
virtual const boost::any get (TID tid)
 generic function for fetching a value form a column (slow)
virtual void print () const throw ()
 prints the content of a column
virtual size_t size () const throw ()
 returns the number of values (rows) in a column
virtual unsigned int getSizeinBytes () const throw ()
 returns the size in bytes the column consumes in main memory
virtual const ColumnPtr copy () const
 virtual copy constructor
virtual const ColumnPtr materialize () throw ()
 materializes a column to a normal uncompressed column with dense values
virtual 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)
 store a column on the disc
virtual bool load (const std::string &path)
 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)
 defines operator[] for this class, which enables the user to thread all typed columns as arrays.
virtual const PositionListPtr selection (const boost::any &value_for_comparison, const ValueComparator comp)
 filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)
virtual const PositionListPtr selection (ColumnPtr comparison_column, const ValueComparator comp)
 filters the values of a column according to a filter condition consisting of a comparison column and a ValueComparator (=,<,>). This implements the comparison of two values from two columns.
std::vector< T > & getContent ()
template<>
unsigned int getSizeinBytes () const throw()
 returns the size in bytes the column consumes in main memory
template<>
unsigned int getSizeinBytes () const throw()
 returns the size in bytes the column consumes in main memory

Private Attributes

struct
CoGaDB::Column::Type_TID_Comparator 
type_tid_comparator
std::vector< T > values_

template<typename T>
class CoGaDB::Column< T >


Constructor & Destructor Documentation

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

Member Function Documentation

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

deletes all values stored in the column

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

Implements CoGaDB::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< T >::clearContent ( ) [virtual]

deletes all values stored in the column

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

Implements CoGaDB::ColumnBaseTyped< T >.

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

virtual copy constructor

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

Implements CoGaDB::ColumnBaseTyped< T >.

Referenced by CoGaDB::Column< T >::materialize().

Here is the caller graph for this function:

template<typename T>
virtual const ColumnPtr CoGaDB::Column< T >::copy ( ) const [virtual]

virtual copy constructor

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

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
const ColumnPtr CoGaDB::Column< 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_, and CoGaDB::ColumnBase::name_.

template<class T >
const boost::any CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual const boost::any CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<class T >
std::vector< T > & CoGaDB::Column< T >::getContent ( )
template<typename T>
std::vector<T>& CoGaDB::Column< T >::getContent ( )
template<class T >
unsigned int CoGaDB::Column< T >::getSizeinBytes ( ) const throw () [virtual]

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

Referenced by CoGaDB::reduce_by_keys().

Here is the caller graph for this function:

template<class T >
bool CoGaDB::Column< T >::insert ( const T &  new_value) [virtual]
template<typename T >
template<typename InputIterator >
bool CoGaDB::Column< T >::insert ( InputIterator  first,
InputIterator  last 
)
template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
bool CoGaDB::Column< T >::insert ( const T &  new_value) [virtual]
template<typename T>
template<typename InputIterator >
bool CoGaDB::Column< T >::insert ( InputIterator  first,
InputIterator  last 
)
template<class T >
bool CoGaDB::Column< 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 >.

template<typename T>
virtual bool CoGaDB::Column< 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 >.

template<class T >
bool CoGaDB::Column< 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 >.

template<typename T>
virtual bool CoGaDB::Column< 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 >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<class T >
const ColumnPtr CoGaDB::Column< 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::Column< T >::copy().

Here is the call graph for this function:

template<class T >
T & CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual T& CoGaDB::Column< 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::ColumnBaseTyped< T >.

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

prints the content of a column

Implements CoGaDB::ColumnBaseTyped< T >.

Referenced by CoGaDB::unit_tests::ColumnComputationTest().

Here is the caller graph for this function:

template<typename T>
virtual void CoGaDB::Column< T >::print ( ) const throw () [virtual]

prints the content of a column

Implements CoGaDB::ColumnBaseTyped< T >.

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

deletes the value on position tid

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

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< T >::remove ( TID  tid) [virtual]

deletes the value on position tid

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

Implements CoGaDB::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<class T >
const PositionListPtr CoGaDB::Column< T >::selection ( const boost::any &  value_for_comparison,
const ValueComparator  comp 
) [virtual]

filters the values of a column according to a filter condition consisting of a comparison value and a ValueComparator (=,<,>)

Returns:
PositionListPtr to a PositionList, which represents the result

Reimplemented from CoGaDB::ColumnBaseTyped< T >.

References hype::util::begin_ptr(), CoGaDB::EQUAL, CoGaDB::GREATER, CoGaDB::GREATER_EQUAL, CoGaDB::LESSER, CoGaDB::LESSER_EQUAL, CoGaDB::quiet, and CoGaDB::ColumnBaseTyped< T >::type().

Referenced by CoGaDB::Column< T >::selection().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
const PositionListPtr CoGaDB::Column< T >::selection ( ColumnPtr  ,
const ValueComparator  comp 
) [virtual]

filters the values of a column according to a filter condition consisting of a comparison column and a ValueComparator (=,<,>). This implements the comparison of two values from two columns.

Returns:
PositionListPtr to a PositionList, which represents the result

Reimplemented from CoGaDB::ColumnBaseTyped< T >.

References CoGaDB::Column< T >::selection().

Here is the call graph for this function:

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

returns the number of values (rows) in a column

Implements CoGaDB::ColumnBaseTyped< T >.

template<typename T>
virtual size_t CoGaDB::Column< T >::size ( ) const throw () [virtual]

returns the number of values (rows) in a column

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.

template<typename T>
virtual bool CoGaDB::Column< 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::ColumnBaseTyped< T >.


Member Data Documentation

template<typename T>
struct CoGaDB::Column::Type_TID_Comparator CoGaDB::Column< T >::type_tid_comparator [private]
template<typename T>
std::vector< T > CoGaDB::Column< T >::values_ [private]

values


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