00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_STORAGEDATASOURCE
00012 #define HK_STORAGEDATASOURCE
00013 #include "hk_datasource.h"
00014 #include "hk_column.h"
00015 #include <list>
00016 #include <vector>
00017 #include <algorithm>
00018 using namespace std;
00019
00020 class hk_presentation;
00021
00022 class hk_storagedatasource:public hk_datasource
00023 {
00024 public:
00025
00026 struct_raw_data* columndata(unsigned long row, unsigned int fieldnr);
00027 enum_datasourcetypes type();
00028 virtual void dump_data(void);
00029
00030 protected:
00035 void delete_data(void);
00043 bool insert_data(struct_raw_data* datarow);
00047 void memory_error(void);
00048 hk_storagedatasource(hk_database* d,hk_presentation* p);
00049
00050 virtual ~hk_storagedatasource();
00051
00052 bool driver_specific_enable(void);
00053 bool driver_specific_disable(void);
00054 virtual list<hk_column*>* driver_specific_columns(void);
00055 virtual bool driver_specific_goto_row(unsigned long r);
00056 virtual unsigned long driver_specific_max_rows(void);
00057 virtual bool driver_specific_create_columns(void);
00058 virtual bool driver_specific_update_data(void);
00059 virtual bool driver_specific_insert_data(void);
00060 virtual bool driver_specific_delete_data_at(unsigned long);
00061 virtual bool driver_specific_batch_goto_previous(void);
00062 virtual bool driver_specific_batch_goto_next(void);
00063
00064 bool p_data_changed;
00065 long p_debug_counter;
00066 struct_raw_data p_d;
00067 void set_maxrows(unsigned long);
00068 bool is_batchprevious(void){return use_batch_previous;}
00069
00070 private:
00071 vector<struct_raw_data*> p_data;
00072 unsigned long p_rows;
00073 bool use_batch_previous;
00074 }
00075
00076
00077 ;
00078 #endif