Diffstat (limited to 'libopie2/opiepim/core/opimtemplatebase.h') (more/less context) (ignore 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 @@ | |||
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimrecord.h> | 33 | #include <opie2/opimrecord.h> |
34 | #include <opie2/opimcache.h> | ||
34 | 35 | ||
35 | /* QT */ | 36 | /* QT */ |
36 | #include <qarray.h> | 37 | #include <qarray.h> |
@@ -70,13 +71,15 @@ private: | |||
70 | }; | 71 | }; |
71 | /** | 72 | /** |
72 | * internal template base | 73 | * internal template base |
73 | * T needs to implement the copy c'tor!!! | 74 | * Attention: T needs to implement the copy c'tor!!! |
74 | */ | 75 | */ |
75 | class OTemplateBasePrivate; | 76 | class OTemplateBasePrivate; |
76 | template <class T = OPimRecord> | 77 | template <class T = OPimRecord> |
77 | class OTemplateBase : public OPimBase { | 78 | class OTemplateBase : public OPimBase { |
78 | public: | 79 | public: |
80 | /** Look ahead direction of cache */ | ||
79 | enum CacheDirection { Forward=0, Reverse }; | 81 | enum CacheDirection { Forward=0, Reverse }; |
82 | |||
80 | OTemplateBase() { | 83 | OTemplateBase() { |
81 | }; | 84 | }; |
82 | virtual ~OTemplateBase() { | 85 | virtual ~OTemplateBase() { |
@@ -88,12 +91,23 @@ public: | |||
88 | */ | 91 | */ |
89 | virtual T find( int uid, const QArray<int>& items, | 92 | virtual T find( int uid, const QArray<int>& items, |
90 | uint current, CacheDirection dir = Forward )const = 0; | 93 | uint current, CacheDirection dir = Forward )const = 0; |
94 | |||
95 | /** | ||
96 | * Find in Cache.. | ||
97 | * Returns empty object if nothing found. | ||
98 | */ | ||
99 | virtual T cacheFind( int uid )const = 0; | ||
100 | |||
101 | /** | ||
102 | * Put element into Cache | ||
103 | */ | ||
91 | virtual void cache( const T& )const = 0; | 104 | virtual void cache( const T& )const = 0; |
92 | virtual void setSaneCacheSize( int ) = 0; | 105 | virtual void setSaneCacheSize( int ) = 0; |
93 | 106 | ||
94 | OPimRecord* record()const; | 107 | OPimRecord* record()const; |
95 | OPimRecord* record(int uid )const; | 108 | OPimRecord* record(int uid )const; |
96 | static T* rec(); | 109 | static T* rec(); |
110 | |||
97 | 111 | ||
98 | private: | 112 | private: |
99 | OTemplateBasePrivate *d; | 113 | OTemplateBasePrivate *d; |