summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/opimaccessbackend.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/opimaccessbackend.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/opimaccessbackend.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h
index 0682063..15a7b7f 100644
--- a/libopie2/opiepim/backend/opimaccessbackend.h
+++ b/libopie2/opiepim/backend/opimaccessbackend.h
@@ -130,2 +130,3 @@ protected:
130 int access()const; 130 int access()const;
131
131 void cache( const T& t )const; 132 void cache( const T& t )const;
@@ -133,2 +134,9 @@ protected:
133 /** 134 /**
135 * Returns the element with given uid out of the cache.
136 * Returns empty element if nothing was found.
137 * <b>Attention:</b> This just works if we have a frontend which contains the cache !
138 */
139 T cacheFind( int uid ) const;
140
141 /**
134 * use a prime number here! 142 * use a prime number here!
@@ -166,2 +174,13 @@ void OPimAccessBackend<T>::cache( const T& t )const {
166} 174}
175
176template <class T>
177T OPimAccessBackend<T>::cacheFind( int uid )const {
178 if ( ! m_front ){
179 qWarning ( "No frontend assigned ! Therefore we cannot access the cache to return the right element!" );
180 return T();
181 }
182
183 return m_front->cacheFind( uid );
184}
185
167template <class T> 186template <class T>
@@ -174,2 +193,3 @@ T OPimAccessBackend<T>::find( int uid, const QArray<int>&,
174 uint, typename Frontend::CacheDirection )const { 193 uint, typename Frontend::CacheDirection )const {
194 qDebug( "*** Lookahead feature not supported. Fallback to default find!" );
175 return find( uid ); 195 return find( uid );