diff options
author | Mike Buland <eichlan@xagasoft.com> | 2015-07-14 05:48:37 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2015-07-14 05:48:37 +0000 |
commit | b5e1c2fba2b372aa19e1c857c176a175f30241d8 (patch) | |
tree | a598c2fb371d12f53ddbb70611e38011cea7fde0 | |
parent | 3363ebc70f86c5145a98984943488052f5a29189 (diff) | |
download | libbu++-b5e1c2fba2b372aa19e1c857c176a175f30241d8.tar.gz libbu++-b5e1c2fba2b372aa19e1c857c176a175f30241d8.tar.bz2 libbu++-b5e1c2fba2b372aa19e1c857c176a175f30241d8.tar.xz libbu++-b5e1c2fba2b372aa19e1c857c176a175f30241d8.zip |
constant cache pointers can now be bound and unbound. It may seem odd, but it's
important, they are references to constant data, weather they should be able to
become bound still.
-rw-r--r-- | src/unstable/cachebase.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index 3db257b..1f78360 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h | |||
@@ -121,7 +121,7 @@ namespace Bu | |||
121 | void checkRef( CacheBase<keytype, basetype> *pCache, | 121 | void checkRef( CacheBase<keytype, basetype> *pCache, |
122 | const keytype &kId, | 122 | const keytype &kId, |
123 | CacheEntry<keytype, basetype> * &rpEnt, | 123 | CacheEntry<keytype, basetype> * &rpEnt, |
124 | obtype * &rpData ) | 124 | obtype * &rpData ) const |
125 | { | 125 | { |
126 | if( pCache == NULL ) | 126 | if( pCache == NULL ) |
127 | throw Bu::ExceptionBase("Invalid cache pointer"); | 127 | throw Bu::ExceptionBase("Invalid cache pointer"); |
@@ -143,7 +143,7 @@ namespace Bu | |||
143 | template<typename obtype> | 143 | template<typename obtype> |
144 | void releaseRef( CacheBase<keytype, basetype> *pCache, | 144 | void releaseRef( CacheBase<keytype, basetype> *pCache, |
145 | CacheEntry<keytype, basetype> * &rpEnt, | 145 | CacheEntry<keytype, basetype> * &rpEnt, |
146 | obtype * &rpData ) | 146 | obtype * &rpData ) const |
147 | { | 147 | { |
148 | if( pCache == NULL ) | 148 | if( pCache == NULL ) |
149 | return; | 149 | return; |
@@ -288,6 +288,16 @@ namespace Bu | |||
288 | { | 288 | { |
289 | CachePtrInterface<keytype, basetype>::releaseRef( pCache, pEnt, pData ); | 289 | CachePtrInterface<keytype, basetype>::releaseRef( pCache, pEnt, pData ); |
290 | } | 290 | } |
291 | |||
292 | void bind() const | ||
293 | { | ||
294 | CachePtrInterface<keytype, basetype>::checkRef( pCache, kId, pEnt, pData ); | ||
295 | } | ||
296 | |||
297 | void unbind() const | ||
298 | { | ||
299 | CachePtrInterface<keytype, basetype>::releaseRef( pCache, pEnt, pData ); | ||
300 | } | ||
291 | 301 | ||
292 | bool isSet() const | 302 | bool isSet() const |
293 | { | 303 | { |