summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/db/datacache.h
Unidiff
Diffstat (limited to 'noncore/apps/tableviewer/db/datacache.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/db/datacache.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/noncore/apps/tableviewer/db/datacache.h b/noncore/apps/tableviewer/db/datacache.h
index c5dc637..e38050c 100644
--- a/noncore/apps/tableviewer/db/datacache.h
+++ b/noncore/apps/tableviewer/db/datacache.h
@@ -27,9 +27,15 @@
27#ifndef __DATACACHE_H__ 27#ifndef __DATACACHE_H__
28#define __DATACACHE_H__ 28#define __DATACACHE_H__
29 29
30#include "common.h"
31
32/* OPIE */
33#include <opie2/odebug.h>
34using namespace Opie::Core;
35
36/* QT */
30#include <qstring.h> 37#include <qstring.h>
31#include <qvector.h> 38#include <qvector.h>
32#include "common.h"
33 39
34class DBStore; 40class DBStore;
35 41
@@ -45,12 +51,12 @@ public:
45 } 51 }
46 52
47 virtual bool openSource(QIODevice *) { 53 virtual bool openSource(QIODevice *) {
48 qWarning("DBAccess::openSource not yet implemented"); 54 owarn << "DBAccess::openSource not yet implemented" << oendl;
49 return false; 55 return false;
50 } 56 }
51 57
52 virtual bool saveSource(QIODevice *) { 58 virtual bool saveSource(QIODevice *) {
53 qWarning("DBAccess::saveSource(QString) not yet implemented"); 59 owarn << "DBAccess::saveSource(QString) not yet implemented" << oendl;
54 return false; 60 return false;
55 } 61 }
56 62
@@ -70,7 +76,7 @@ public:
70 // Add an item 76 // Add an item
71 void addItem(DataElem *); 77 void addItem(DataElem *);
72 void addItemInternal(DataElem *); 78 void addItemInternal(DataElem *);
73 void removeItem(DataElem *); 79 void removeItem(DataElem *);
74 80
75 // Set the name of the database 81 // Set the name of the database
76 void setName(const QString &name); 82 void setName(const QString &name);
@@ -106,15 +112,15 @@ public:
106 void first(); 112 void first();
107 void last(); 113 void last();
108 114
109 bool next(); 115 bool next();
110 bool previous(); 116 bool previous();
111 117
112 DataElem* getCurrentData(); 118 DataElem* getCurrentData();
113 119
114private: 120private:
115 /* does the work of freeing used memory */ 121 /* does the work of freeing used memory */
116 void freeTable(); 122 void freeTable();
117 QString name; 123 QString name;
118 124
119 QVector<DataElem> master_table; 125 QVector<DataElem> master_table;
120 DBAccess *archive; 126 DBAccess *archive;
@@ -123,7 +129,7 @@ private:
123 129
124 unsigned int number_elems; 130 unsigned int number_elems;
125 unsigned int table_size; /* should always be a power of 2 */ 131 unsigned int table_size; /* should always be a power of 2 */
126 bool full; /* since because we are using an int for indexing there is 132 bool full; /* since because we are using an int for indexing there is
127 an upper limit on the number of items we can store. */ 133 an upper limit on the number of items we can store. */
128 unsigned int current_elem; 134 unsigned int current_elem;
129}; 135};