diff options
author | Mike Buland <eichlan@xagasoft.com> | 2014-01-22 16:28:46 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2014-01-22 16:28:46 +0000 |
commit | 86e37bec7b2101555635201f83352c0e054f1849 (patch) | |
tree | 4d2a3652689ac7b615db82bdab520c2ed42dd705 /src/tests | |
parent | 44a228640c782e46baf528749b5776714749ef2d (diff) | |
download | libbu++-86e37bec7b2101555635201f83352c0e054f1849.tar.gz libbu++-86e37bec7b2101555635201f83352c0e054f1849.tar.bz2 libbu++-86e37bec7b2101555635201f83352c0e054f1849.tar.xz libbu++-86e37bec7b2101555635201f83352c0e054f1849.zip |
Updated the cache system. It now ensures that objects are initialized with
cache information before they are deserialized from storage. This changed the
signature of the cache loading template function, but the new function isn't
harder to use, and provides the key information as well.
Diffstat (limited to '')
-rw-r--r-- | src/tests/cache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp index 7982b2d..4751559 100644 --- a/src/tests/cache.cpp +++ b/src/tests/cache.cpp | |||
@@ -145,7 +145,7 @@ namespace Bu | |||
145 | } | 145 | } |
146 | 146 | ||
147 | template<> | 147 | template<> |
148 | Something *_cacheObjectLoad<Something>( Bu::Stream &s ) | 148 | Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) |
149 | { | 149 | { |
150 | Bu::Archive ar( s, Bu::Archive::load ); | 150 | Bu::Archive ar( s, Bu::Archive::load ); |
151 | uint8_t uType; | 151 | uint8_t uType; |
@@ -154,7 +154,7 @@ namespace Bu | |||
154 | { | 154 | { |
155 | case 1: | 155 | case 1: |
156 | { | 156 | { |
157 | SubSomethingA *ret = new SubSomethingA(); | 157 | SubSomethingA *ret = initObj(new SubSomethingA()); |
158 | ar >> *ret; | 158 | ar >> *ret; |
159 | return ret; | 159 | return ret; |
160 | } | 160 | } |
@@ -162,7 +162,7 @@ namespace Bu | |||
162 | 162 | ||
163 | case 2: | 163 | case 2: |
164 | { | 164 | { |
165 | SubSomethingB *ret = new SubSomethingB(); | 165 | SubSomethingB *ret = initObj(new SubSomethingB()); |
166 | ar >> *ret; | 166 | ar >> *ret; |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |