Diffstat (limited to 'libopie2/opiepim/core/opimtemplatebase.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimtemplatebase.h | 16 |
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 @@ -31,6 +31,7 @@ /* OPIE */ #include <opie2/opimrecord.h> +#include <opie2/opimcache.h> /* QT */ #include <qarray.h> @@ -70,13 +71,15 @@ private: }; /** * 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() { @@ -88,6 +91,16 @@ public: */ 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; @@ -95,6 +108,7 @@ public: OPimRecord* record(int uid )const; static T* rec(); + private: OTemplateBasePrivate *d; }; |