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

A LookupArray is a LookupColumn which is applied on a materialized column (of the table that is indexed by the Lookup column) and hence has a Type. This class represents a column with type T, which is essentially a tid list describing which values of a typed materialized column are included in the LookupArray. More...

#include <lookup_array.hpp>

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

List of all members.

Public Member Functions

 LookupArray (const std::string &name, AttributeType db_type, ColumnPtr column, PositionListPtr tids)
virtual ~LookupArray ()
virtual bool insert (const boost::any &new_Value)
 appends a value new_Value to end of column
virtual bool insert (const T &new_Value)
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)
 returns type information of internal values
 LookupArray (const std::string &name, AttributeType db_type, ColumnPtr column, PositionListPtr tids)
virtual ~LookupArray ()
virtual bool insert (const boost::any &new_Value)
 appends a value new_Value to end of column
virtual bool insert (const T &new_Value)
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
PositionListPtr getPositionList ()
virtual const ColumnPtr copy () const
 virtual copy constructor
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 const ColumnPtr materialize () throw ()
 materializes a column to a normal uncompressed column with dense values
virtual T & operator[] (const int index)
 returns type information of internal values

Private Attributes

shared_pointer_namespace::shared_ptr
< ColumnBaseTyped< T > > 
column_
PositionListPtr tids_

Detailed Description

template<class T>
class CoGaDB::LookupArray< T >

A LookupArray is a LookupColumn which is applied on a materialized column (of the table that is indexed by the Lookup column) and hence has a Type. This class represents a column with type T, which is essentially a tid list describing which values of a typed materialized column are included in the LookupArray.

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::LookupArray< T >::LookupArray ( const std::string &  name,
AttributeType  db_type,
ColumnPtr  column,
PositionListPtr  tids 
)
template<class T >
CoGaDB::LookupArray< T >::~LookupArray ( ) [virtual]
template<class T >
CoGaDB::LookupArray< T >::LookupArray ( const std::string &  name,
AttributeType  db_type,
ColumnPtr  column,
PositionListPtr  tids 
)
template<class T >
virtual CoGaDB::LookupArray< T >::~LookupArray ( ) [virtual]

Member Function Documentation

template<class T >
bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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::LookupArray< 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 >
virtual const ColumnPtr CoGaDB::LookupArray< 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::LookupArray< 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::Column< T >::getContent().

Here is the call graph for this function:

template<class T >
const boost::any CoGaDB::LookupArray< 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 >
virtual const boost::any CoGaDB::LookupArray< 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 >
PositionListPtr CoGaDB::LookupArray< T >::getPositionList ( )

Referenced by CoGaDB::getPositonListfromLookupArray().

Here is the caller graph for this function:

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

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns the size in bytes the column consumes in main memory

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
virtual bool CoGaDB::LookupArray< 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<class T >
bool CoGaDB::LookupArray< 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<class T >
bool CoGaDB::LookupArray< T >::insert ( const T &  new_Value) [virtual]
template<class T >
virtual bool CoGaDB::LookupArray< T >::insert ( const T &  new_Value) [virtual]
template<class T >
bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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::LookupArray< 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 >::getContent().

Here is the call graph for this function:

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

returns type information of internal values

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns type information of internal values

Implements CoGaDB::ColumnBaseTyped< T >.

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

prints the content of a column

Implements CoGaDB::ColumnBaseTyped< T >.

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

prints the content of a column

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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 >
bool CoGaDB::LookupArray< 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 >
size_t CoGaDB::LookupArray< T >::size ( ) const throw () [virtual]

returns the number of values (rows) in a column

Implements CoGaDB::ColumnBaseTyped< T >.

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

returns the number of values (rows) in a column

Implements CoGaDB::ColumnBaseTyped< T >.

template<class T >
bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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 >
virtual bool CoGaDB::LookupArray< 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<class T >
bool CoGaDB::LookupArray< 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<class T >
shared_pointer_namespace::shared_ptr< ColumnBaseTyped< T > > CoGaDB::LookupArray< T >::column_ [private]
template<class T >
PositionListPtr CoGaDB::LookupArray< T >::tids_ [private]

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