summaryrefslogtreecommitdiff
path: root/libopie/pim/opimcache.h
Unidiff
Diffstat (limited to 'libopie/pim/opimcache.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimcache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie/pim/opimcache.h b/libopie/pim/opimcache.h
index 73414e5..7f7cff5 100644
--- a/libopie/pim/opimcache.h
+++ b/libopie/pim/opimcache.h
@@ -2,12 +2,14 @@
2#define OPIE_PIM_CACHE_H 2#define OPIE_PIM_CACHE_H
3 3
4#include <qintcache.h> 4#include <qintcache.h>
5 5
6#include "opimrecord.h" 6#include "opimrecord.h"
7 7
8class OPimCacheItemPrivate;
9
8template <class T = OPimRecord> 10template <class T = OPimRecord>
9class OPimCacheItem { 11class OPimCacheItem {
10public: 12public:
11 OPimCacheItem( const T& t = T() ); 13 OPimCacheItem( const T& t = T() );
12 OPimCacheItem( const OPimCacheItem& ); 14 OPimCacheItem( const OPimCacheItem& );
13 ~OPimCacheItem(); 15 ~OPimCacheItem();
@@ -15,14 +17,17 @@ public:
15 OPimCacheItem &operator=( const OPimCacheItem& ); 17 OPimCacheItem &operator=( const OPimCacheItem& );
16 18
17 T record()const; 19 T record()const;
18 void setRecord( const T& ); 20 void setRecord( const T& );
19private: 21private:
20 T m_t; 22 T m_t;
23 OPimCacheItemPrivate *d;
21}; 24};
22 25
26
27class OPimCachePrivate;
23/** 28/**
24 * OPimCache for caching the items 29 * OPimCache for caching the items
25 * We support adding, removing 30 * We support adding, removing
26 * and finding 31 * and finding
27 */ 32 */
28template <class T = OPimRecord> 33template <class T = OPimRecord>
@@ -43,12 +48,13 @@ public:
43 void add( const T& ); 48 void add( const T& );
44 void remove( int uid ); 49 void remove( int uid );
45 void replace( const T& ); 50 void replace( const T& );
46 51
47private: 52private:
48 QIntCache<Item> m_cache; 53 QIntCache<Item> m_cache;
54 OPimCachePrivate* d;
49}; 55};
50 56
51// Implementation 57// Implementation
52template <class T> 58template <class T>
53OPimCacheItem<T>::OPimCacheItem( const T& t ) 59OPimCacheItem<T>::OPimCacheItem( const T& t )
54 : m_t(t) { 60 : m_t(t) {