summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimtemplatebase.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/core/opimtemplatebase.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimtemplatebase.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimtemplatebase.h b/libopie2/opiepim/core/opimtemplatebase.h
index b48dfed..ec9a94e 100644
--- a/libopie2/opiepim/core/opimtemplatebase.h
+++ b/libopie2/opiepim/core/opimtemplatebase.h
@@ -28,12 +28,13 @@
*/
#ifndef OTEMPLATEBASE_H
#define OTEMPLATEBASE_H
/* OPIE */
#include <opie2/opimrecord.h>
+#include <opie2/opimcache.h>
/* QT */
#include <qarray.h>
namespace Opie {
/**
@@ -67,36 +68,49 @@ struct OPimBase {
private:
OPimBasePrivate* d;
};
/**
* internal template base
- * T needs to implement the copy c'tor!!!
+ * Attention: T needs to implement the copy c'tor!!!
*/
class OTemplateBasePrivate;
template <class T = OPimRecord>
class OTemplateBase : public OPimBase {
public:
+ /** Look ahead direction of cache */
enum CacheDirection { Forward=0, Reverse };
+
OTemplateBase() {
};
virtual ~OTemplateBase() {
}
virtual T find( int uid )const = 0;
/**
* read ahead find
*/
virtual T find( int uid, const QArray<int>& items,
uint current, CacheDirection dir = Forward )const = 0;
+
+ /**
+ * Find in Cache..
+ * Returns empty object if nothing found.
+ */
+ virtual T cacheFind( int uid )const = 0;
+
+ /**
+ * Put element into Cache
+ */
virtual void cache( const T& )const = 0;
virtual void setSaneCacheSize( int ) = 0;
OPimRecord* record()const;
OPimRecord* record(int uid )const;
static T* rec();
+
private:
OTemplateBasePrivate *d;
};