From 86e37bec7b2101555635201f83352c0e054f1849 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 22 Jan 2014 16:28:46 +0000 Subject: 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. --- src/tests/cache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tests') 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 } template<> - Something *_cacheObjectLoad( Bu::Stream &s ) + Something *_cacheObjectLoad( Bu::CacheObject::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) { Bu::Archive ar( s, Bu::Archive::load ); uint8_t uType; @@ -154,7 +154,7 @@ namespace Bu { case 1: { - SubSomethingA *ret = new SubSomethingA(); + SubSomethingA *ret = initObj(new SubSomethingA()); ar >> *ret; return ret; } @@ -162,7 +162,7 @@ namespace Bu case 2: { - SubSomethingB *ret = new SubSomethingB(); + SubSomethingB *ret = initObj(new SubSomethingB()); ar >> *ret; return ret; } -- cgit v1.2.3