author | zecke <zecke> | 2002-10-10 17:08:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-10 17:08:58 (UTC) |
commit | 1dcc1b1fc9fd35d959255452c8b5be1269ca4f44 (patch) (unidiff) | |
tree | 469d239dec74f5751f3aced43c4bae1f0f3a42e3 /libopie2/opiepim/core/otemplatebase.h | |
parent | aa38f642a07810515dcc18ea38bf520e26d7f88e (diff) | |
download | opie-1dcc1b1fc9fd35d959255452c8b5be1269ca4f44.zip opie-1dcc1b1fc9fd35d959255452c8b5be1269ca4f44.tar.gz opie-1dcc1b1fc9fd35d959255452c8b5be1269ca4f44.tar.bz2 |
The Cache is finally in place
I tested it with my todolist and it 'works' for 10.000 todos the hits are awesome ;)
The read ahead functionality does not make sense for XMLs backends because most of the stuff is already in memory. While using readahead on SQL makes things a lot faster....
I still have to fully implement read ahead
This change is bic but sc
Diffstat (limited to 'libopie2/opiepim/core/otemplatebase.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/otemplatebase.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h index f71417b..b855919 100644 --- a/libopie2/opiepim/core/otemplatebase.h +++ b/libopie2/opiepim/core/otemplatebase.h | |||
@@ -1,21 +1,32 @@ | |||
1 | #ifndef OPIE_TEMPLATE_BASE_H | 1 | #ifndef OPIE_TEMPLATE_BASE_H |
2 | #define OPIE_TEMPLATE_BASE_H | 2 | #define OPIE_TEMPLATE_BASE_H |
3 | 3 | ||
4 | #include <qarray.h> | ||
5 | |||
4 | #include "opimrecord.h" | 6 | #include "opimrecord.h" |
5 | 7 | ||
6 | /** | 8 | /** |
7 | * internal template base | 9 | * internal template base |
8 | */ | 10 | */ |
9 | template <class T = OPimRecord> | 11 | template <class T = OPimRecord> |
10 | class OTemplateBase { | 12 | class OTemplateBase { |
11 | public: | 13 | public: |
14 | enum CacheDirection { Forward=0, Reverse }; | ||
12 | OTemplateBase() { | 15 | OTemplateBase() { |
13 | }; | 16 | }; |
14 | virtual ~OTemplateBase() { | 17 | virtual ~OTemplateBase() { |
15 | } | 18 | } |
16 | virtual T find( int uid )const = 0; | 19 | virtual T find( int uid )const = 0; |
17 | 20 | ||
21 | /** | ||
22 | * read ahead find | ||
23 | */ | ||
24 | virtual T find( int uid, const QArray<int>& items, | ||
25 | uint current, CacheDirection dir = Forward )const = 0; | ||
26 | virtual void cache( const T& )const = 0; | ||
27 | virtual void setSaneCacheSize( int ) = 0; | ||
28 | |||
18 | }; | 29 | }; |
19 | 30 | ||
20 | 31 | ||
21 | #endif | 32 | #endif |