diff options
Diffstat (limited to '')
-rw-r--r-- | src/cache.h | 16 |
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 | ||
19 | namespace Bu | 19 | namespace 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 | { |