Diffstat (limited to 'noncore/apps/tableviewer/db/datacache.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/db/datacache.h | 24 |
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 | |||
@@ -26,11 +26,17 @@ | |||
26 | 26 | ||
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> | ||
34 | using 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 | ||
34 | class DBStore; | 40 | class DBStore; |
35 | 41 | ||
36 | /*! Abstract class that defines how database stuff can be accessed */ | 42 | /*! Abstract class that defines how database stuff can be accessed */ |
@@ -44,14 +50,14 @@ public: | |||
44 | return QString(); | 50 | return QString(); |
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 | ||
57 | protected: | 63 | protected: |
@@ -69,9 +75,9 @@ public: | |||
69 | 75 | ||
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); |
77 | 83 | ||
@@ -105,26 +111,26 @@ public: | |||
105 | 111 | ||
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 | ||
114 | private: | 120 | private: |
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; |
121 | 127 | ||
122 | KeyList *kRep; | 128 | KeyList *kRep; |
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 | }; |
130 | #endif | 136 | #endif |