Column-oriented GPU-accelerated Database Management System
CoGaDB
|
00001 #pragma once 00002 00003 #include <core/base_column.hpp> 00004 #include <core/lookup_array.hpp> 00005 00006 namespace CoGaDB{ 00007 00008 class LookupColumn{ 00009 public: 00010 00011 00012 LookupColumn(TablePtr table, PositionListPtr tids); 00013 00014 // template <typename T> 00015 // const shared_pointer_namespace::shared_ptr<LookupArray<T> > getColumnbyName(std::string s) const; 00016 00017 const ColumnPtr getLookupArrayforColumnbyName(const Attribut& attr) const; 00018 00019 //const ColumnVectorPtr getDenseValueColumns() const; 00020 00021 const ColumnVectorPtr getLookupArrays() const; 00022 00023 // const ColumnPtr getLookupArrayforColumn(std::string column_name); 00024 00025 const TablePtr getTable() const throw(); 00026 00027 const PositionListPtr getPositionList() const throw(); 00028 00029 const shared_pointer_namespace::shared_ptr<LookupColumn> aggregate(const LookupColumn& lookup_col) const; 00030 /* \brief returns copy of LookupColumn*/ 00031 const shared_pointer_namespace::shared_ptr<LookupColumn> copy() const; 00032 00033 protected: 00034 TablePtr table_; 00035 PositionListPtr tids_; 00036 }; 00037 00038 // typedef LookupColumn::PositionListPtr PositionListPtr; 00039 typedef shared_pointer_namespace::shared_ptr<LookupColumn> LookupColumnPtr; 00040 00041 00042 //template <typename T> 00043 // const ColumnPtr LookupColumn::getLookupArrayforColumnbyName(const Attribut& attr) const{ 00044 // 00045 // ColumnPtr column = table_->getColumnbyName(attr.second); 00046 // if(!column){ 00047 // return ColumnPtr(); //shared_pointer_namespace::shared_ptr<LookupArray<T> >( ); //return NULL Pointer 00048 // } 00049 // if(column->getType()!=attr.first){ 00050 // cout << "FATAL ERROR: FOUND Column " << column->getName() << " of Table " << table_->getName() << " does not match Attribut type for LookupColumn!" << endl; 00051 // cout << "File: " << __FILE__ << " Line:" << __LINE__ << endl; 00052 // return ColumnPtr(); //return NULL Pointer 00053 // } 00054 00055 // if(typeid(T)!=column->type()){ 00056 // return shared_pointer_namespace::shared_ptr<LookupArray<T> >( ); //return NULL Pointer 00057 // } 00058 00059 // return shared_pointer_namespace::shared_ptr<LookupArray<T> >( new LookupArray<T>(column,tids_) ); 00060 // } 00061 00062 00063 }; //end namespace CogaDB 00064