Diffstat (limited to 'libopie2/opiepim/core/opimcache.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimcache.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimcache.h b/libopie2/opiepim/core/opimcache.h index 73414e5..7f7cff5 100644 --- a/libopie2/opiepim/core/opimcache.h +++ b/libopie2/opiepim/core/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 | ||
8 | class OPimCacheItemPrivate; | ||
9 | |||
8 | template <class T = OPimRecord> | 10 | template <class T = OPimRecord> |
9 | class OPimCacheItem { | 11 | class OPimCacheItem { |
10 | public: | 12 | public: |
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& ); |
19 | private: | 21 | private: |
20 | T m_t; | 22 | T m_t; |
23 | OPimCacheItemPrivate *d; | ||
21 | }; | 24 | }; |
22 | 25 | ||
26 | |||
27 | class 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 | */ |
28 | template <class T = OPimRecord> | 33 | template <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 | ||
47 | private: | 52 | private: |
48 | QIntCache<Item> m_cache; | 53 | QIntCache<Item> m_cache; |
54 | OPimCachePrivate* d; | ||
49 | }; | 55 | }; |
50 | 56 | ||
51 | // Implementation | 57 | // Implementation |
52 | template <class T> | 58 | template <class T> |
53 | OPimCacheItem<T>::OPimCacheItem( const T& t ) | 59 | OPimCacheItem<T>::OPimCacheItem( const T& t ) |
54 | : m_t(t) { | 60 | : m_t(t) { |