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/unstable/myriadcache.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/unstable/myriadcache.h') diff --git a/src/unstable/myriadcache.h b/src/unstable/myriadcache.h index 9bc926f..d19395a 100644 --- a/src/unstable/myriadcache.h +++ b/src/unstable/myriadcache.h @@ -54,6 +54,7 @@ namespace Bu } using typename Bu::CacheBase::KeyList; + using typename Bu::CacheBase::ObjectType; virtual typename Bu::CacheBase::KeyList getKeys() const { @@ -92,10 +93,13 @@ namespace Bu bStructureChanged = true; } - virtual obtype *_load( const keytype &k ) + virtual obtype *_load( + typename Bu::CacheObject::Initializer &initObj, + const keytype &k + ) { Bu::MyriadStream ms = mStore.openStream( hIndex.get( k ) ); - return _cacheObjectLoad( ms ); + return _cacheObjectLoad( initObj, k, ms ); } virtual void _save( const obtype *o ) -- cgit v1.2.3