author | zecke <zecke> | 2002-10-10 17:08:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-10 17:08:58 (UTC) |
commit | 1dcc1b1fc9fd35d959255452c8b5be1269ca4f44 (patch) (side-by-side diff) | |
tree | 469d239dec74f5751f3aced43c4bae1f0f3a42e3 /libopie/pim/opimaccessbackend.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 'libopie/pim/opimaccessbackend.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/pim/opimaccessbackend.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h index c27acbb..27d3cb8 100644 --- a/libopie/pim/opimaccessbackend.h +++ b/libopie/pim/opimaccessbackend.h @@ -5,2 +5,3 @@ +#include <opie/otemplatebase.h> #include <opie/opimrecord.h> @@ -19,2 +20,3 @@ class OPimAccessBackend { public: + typedef OTemplateBase<T> Frontend; OPimAccessBackend(); @@ -56,2 +58,4 @@ public: + virtual T find(int uid, const QArray<int>& items, + uint current, Frontend::CacheDirection )const ; /** @@ -76,2 +80,17 @@ public: + /* + * setTheFrontEnd!!! + */ + void setFrontend( Frontend* front ); + +protected: + void cache( const T& t )const; + + /** + * use a prime number here! + */ + void setSaneCacheSize( int ); + +private: + Frontend* m_front; @@ -81,3 +100,3 @@ template <class T> OPimAccessBackend<T>::OPimAccessBackend() { - + m_front = 0l; } @@ -87,2 +106,21 @@ OPimAccessBackend<T>::~OPimAccessBackend() { } +template <class T> +void OPimAccessBackend<T>::setFrontend( Frontend* fr ) { + m_front = fr; +} +template <class T> +void OPimAccessBackend<T>::cache( const T& t )const { + if (m_front ) + m_front->cache( t ); +} +template <class T> +void OPimAccessBackend<T>::setSaneCacheSize( int size) { + if (m_front ) + m_front->setSaneCacheSize( size ); +} +template <class T> +T OPimAccessBackend<T>::find( int uid, const QArray<int>&, + uint, Frontend::CacheDirection )const { + return find( uid ); +} |