Column-oriented GPU-accelerated Database Management System
CoGaDB
/home/sebastian/gpudbms/trunk/cogadb/include/core/row_table.hpp
Go to the documentation of this file.
00001 #pragma once
00002 #include <core/global_definitions.hpp>
00003 #include <core/base_table.hpp>
00004 #include <core/base_column.hpp>
00005 #include <persistence/buffer_manager.hpp>
00006 #include <persistence/row_page.hpp>
00007 #include <util/time_measurement.hpp>
00008 
00009 
00010 using namespace std;
00011 namespace CoGaDB
00012 {
00013 
00014 template<typename T>
00015 class RowValueColumn;
00016         
00017 class RowTable : public BaseTable
00018 {
00019         
00020 public:   
00021         typedef shared_pointer_namespace::shared_ptr<RowTable> RowTablePtr;         
00022         RowTable(const string& name, const TableSchema& schema);        
00023         virtual ~RowTable();
00024         
00025         bool update(PositionListPtr tids, const std::string& attribute_name, const boost::any& value);
00026         bool remove(PositionListPtr tids);
00027         
00028         /* *** Loading, Storing and Output *** */
00030         virtual void print();       
00032         virtual bool store();       
00034         virtual bool load();        
00036         virtual bool loadDatafromFile(string filepath); 
00037                 
00038         virtual const TablePtr materialize() const; 
00040         /* *** Status *** */
00041         virtual unsigned int getNumberofRows() const throw();   
00043         bool isMaterialized() const throw();
00044         
00045         /* *** Operations *** */
00047         virtual const Tuple fetchTuple(const TID& id) const;
00049         virtual bool insert(const Tuple& t);
00051         virtual bool update(const string& attribute_name, const boost::any& value);
00053         virtual bool remove(const string& attribute_name, const boost::any& value);     
00055         virtual const ColumnPtr getColumnbyName(const std::string& column_name) const throw();                  
00057         const std::vector<RowPagePtr>& getRowPages() const;
00058         
00059         RowPagePtr getPageByIndex(unsigned int index, unsigned int& prefix);
00060 protected:    
00061         virtual const std::vector<ColumnPtr>& getColumns() const;       
00062 private:        
00063     RowTablePtr _rtp;
00064     std::vector<RowPagePtr> _row_pages;    
00065         std::vector<unsigned int> _row_pages_prefix;
00066         std::vector<unsigned int> _row_page_mapping;
00067     std::vector<ColumnPtr> _cols;       
00068         unsigned int _row_count;
00070         bool _isMaterialized;           
00071         void updateMapping(unsigned int count, unsigned int value);
00072 };
00073 typedef RowTable::RowTablePtr RowTablePtr;
00074 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines