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 @@ | |||
5 | 5 | ||
6 | #include <opie/otemplatebase.h> | ||
6 | #include <opie/opimrecord.h> | 7 | #include <opie/opimrecord.h> |
@@ -19,2 +20,3 @@ class OPimAccessBackend { | |||
19 | public: | 20 | public: |
21 | typedef OTemplateBase<T> Frontend; | ||
20 | OPimAccessBackend(); | 22 | OPimAccessBackend(); |
@@ -56,2 +58,4 @@ public: | |||
56 | 58 | ||
59 | virtual T find(int uid, const QArray<int>& items, | ||
60 | uint current, Frontend::CacheDirection )const ; | ||
57 | /** | 61 | /** |
@@ -76,2 +80,17 @@ public: | |||
76 | 80 | ||
81 | /* | ||
82 | * setTheFrontEnd!!! | ||
83 | */ | ||
84 | void setFrontend( Frontend* front ); | ||
85 | |||
86 | protected: | ||
87 | void cache( const T& t )const; | ||
88 | |||
89 | /** | ||
90 | * use a prime number here! | ||
91 | */ | ||
92 | void setSaneCacheSize( int ); | ||
93 | |||
94 | private: | ||
95 | Frontend* m_front; | ||
77 | 96 | ||
@@ -81,3 +100,3 @@ template <class T> | |||
81 | OPimAccessBackend<T>::OPimAccessBackend() { | 100 | OPimAccessBackend<T>::OPimAccessBackend() { |
82 | 101 | m_front = 0l; | |
83 | } | 102 | } |
@@ -87,2 +106,21 @@ OPimAccessBackend<T>::~OPimAccessBackend() { | |||
87 | } | 106 | } |
107 | template <class T> | ||
108 | void OPimAccessBackend<T>::setFrontend( Frontend* fr ) { | ||
109 | m_front = fr; | ||
110 | } | ||
111 | template <class T> | ||
112 | void OPimAccessBackend<T>::cache( const T& t )const { | ||
113 | if (m_front ) | ||
114 | m_front->cache( t ); | ||
115 | } | ||
116 | template <class T> | ||
117 | void OPimAccessBackend<T>::setSaneCacheSize( int size) { | ||
118 | if (m_front ) | ||
119 | m_front->setSaneCacheSize( size ); | ||
120 | } | ||
121 | template <class T> | ||
122 | T OPimAccessBackend<T>::find( int uid, const QArray<int>&, | ||
123 | uint, Frontend::CacheDirection )const { | ||
124 | return find( uid ); | ||
125 | } | ||
88 | 126 | ||