Diffstat (limited to 'libopie2/opiepim/backend/opimaccessbackend.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/opimaccessbackend.h | 20 |
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: int access()const; + void cache( const T& t )const; @@ -133,2 +134,9 @@ protected: /** + * Returns the element with given uid out of the cache. + * Returns empty element if nothing was found. + * <b>Attention:</b> This just works if we have a frontend which contains the cache ! + */ + T cacheFind( int uid ) const; + + /** * use a prime number here! @@ -166,2 +174,13 @@ void OPimAccessBackend<T>::cache( const T& t )const { } + +template <class T> +T OPimAccessBackend<T>::cacheFind( int uid )const { + if ( ! m_front ){ + qWarning ( "No frontend assigned ! Therefore we cannot access the cache to return the right element!" ); + return T(); + } + + return m_front->cacheFind( uid ); +} + template <class T> @@ -174,2 +193,3 @@ T OPimAccessBackend<T>::find( int uid, const QArray<int>&, uint, typename Frontend::CacheDirection )const { + qDebug( "*** Lookahead feature not supported. Fallback to default find!" ); return find( uid ); |