aboutsummaryrefslogtreecommitdiff
path: root/src/cache.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-01-25 16:42:40 +0000
committerMike Buland <eichlan@xagasoft.com>2010-01-25 16:42:40 +0000
commit0861fdb652408dcdbd2e7b60513f3fa24696e610 (patch)
tree61b1af5a86e064ade1acc271ca7898a698d87a17 /src/cache.h
parent3e824e91146cc9e2454f54375d47e359aa21b8d4 (diff)
downloadlibbu++-0861fdb652408dcdbd2e7b60513f3fa24696e610.tar.gz
libbu++-0861fdb652408dcdbd2e7b60513f3fa24696e610.tar.bz2
libbu++-0861fdb652408dcdbd2e7b60513f3fa24696e610.tar.xz
libbu++-0861fdb652408dcdbd2e7b60513f3fa24696e610.zip
The order of key, object in all of the cache related systems has beed fixed,
key just belongs first, that's all there is to it.
Diffstat (limited to '')
-rw-r--r--src/cache.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cache.h b/src/cache.h
index 87037f7..c738d28 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -18,10 +18,10 @@
18 18
19namespace Bu 19namespace Bu
20{ 20{
21// template<class obtype, class keytype> 21// template<class keytype, class obtype>
22// keytype __cacheGetKey( obtype *&pObj ); 22// keytype __cacheGetKey( obtype *&pObj );
23 23
24 template<class obtype, class keytype> 24 template<class keytype, class obtype>
25 class Cache 25 class Cache
26 { 26 {
27 public: 27 public:
@@ -32,9 +32,9 @@ namespace Bu
32 */ 32 */
33 class Ptr 33 class Ptr
34 { 34 {
35 friend class Bu::Cache<obtype, keytype>; 35 friend class Bu::Cache<keytype, obtype>;
36 private: 36 private:
37 Ptr( Cache<obtype, keytype> *pCache, obtype *pData, 37 Ptr( Cache<keytype, obtype> *pCache, obtype *pData,
38 const keytype &kId ) : 38 const keytype &kId ) :
39 pCache( pCache ), 39 pCache( pCache ),
40 pData( pData ), 40 pData( pData ),
@@ -44,7 +44,7 @@ namespace Bu
44 pCache->incRef( kId ); 44 pCache->incRef( kId );
45 } 45 }
46 46
47 Ptr( Cache<obtype, keytype> *pCache, const keytype &kId ) : 47 Ptr( Cache<keytype, obtype> *pCache, const keytype &kId ) :
48 pCache( pCache ), 48 pCache( pCache ),
49 pData( NULL ), 49 pData( NULL ),
50 kId( kId ) 50 kId( kId )
@@ -168,15 +168,15 @@ namespace Bu
168 } 168 }
169 169
170 private: 170 private:
171 Bu::Cache<obtype, keytype> *pCache; 171 Bu::Cache<keytype, obtype> *pCache;
172 mutable obtype *pData; 172 mutable obtype *pData;
173 mutable keytype kId; 173 mutable keytype kId;
174 }; 174 };
175 175
176 private: 176 private:
177 typedef Bu::CacheStore<obtype, keytype> Store; 177 typedef Bu::CacheStore<keytype, obtype> Store;
178 typedef Bu::List<Store *> StoreList; 178 typedef Bu::List<Store *> StoreList;
179 typedef Bu::CacheCalc<obtype, keytype> Calc; 179 typedef Bu::CacheCalc<keytype, obtype> Calc;
180 180
181 typedef struct CacheEntry 181 typedef struct CacheEntry
182 { 182 {