summaryrefslogtreecommitdiff
path: root/libopie/pim/opimaccessbackend.h
Side-by-side diff
Diffstat (limited to 'libopie/pim/opimaccessbackend.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimaccessbackend.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h
index 4f00bc9..e268f4f 100644
--- a/libopie/pim/opimaccessbackend.h
+++ b/libopie/pim/opimaccessbackend.h
@@ -10,25 +10,27 @@
/**
* OPimAccessBackend is the base class
* for all private backends
* it operates on OPimRecord as the base class
* and it's responsible for fast manipulating
* the resource the implementation takes care
* of
*/
template <class T = OPimRecord>
class OPimAccessBackend {
public:
typedef OTemplateBase<T> Frontend;
- OPimAccessBackend();
+
+ /** The access hint from the frontend */
+ OPimAccessBackend(int access = 0);
virtual ~OPimAccessBackend();
/**
* load the resource
*/
virtual bool load() = 0;
/**
* reload the resource
*/
virtual bool reload() = 0;
@@ -79,41 +81,47 @@ public:
virtual bool replace( const T& t ) = 0;
/*
* setTheFrontEnd!!!
*/
void setFrontend( Frontend* front );
/**
* set the read ahead count
*/
void setReadAhead( uint count );
protected:
+ int access()const;
void cache( const T& t )const;
/**
* use a prime number here!
*/
void setSaneCacheSize( int );
uint readAhead()const;
private:
+ class Private;
+ Private* d;
Frontend* m_front;
uint m_read;
+ int m_acc;
};
template <class T>
-OPimAccessBackend<T>::OPimAccessBackend() {
+OPimAccessBackend<T>::OPimAccessBackend(int acc)
+ : m_acc( acc )
+{
m_front = 0l;
}
template <class T>
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 {
@@ -129,13 +137,17 @@ template <class T>
T OPimAccessBackend<T>::find( int uid, const QArray<int>&,
uint, typename Frontend::CacheDirection )const {
return find( uid );
}
template <class T>
void OPimAccessBackend<T>::setReadAhead( uint count ) {
m_read = count;
}
template <class T>
uint OPimAccessBackend<T>::readAhead()const {
return m_read;
}
+template <class T>
+int OPimAccessBackend<T>::access()const {
+ return m_acc;
+}
#endif