From 6f3b85c5af1855e1695885fb28220c34f6a0673f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 1 Dec 2008 23:10:44 +0000 Subject: Wow, that's a lot of changes. You can use anything as a key now, as long as it can be hashed. And we're about to test actually loading and saving persistant cache items. Fun. --- src/cachestore.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/cachestore.h (limited to 'src/cachestore.h') diff --git a/src/cachestore.h b/src/cachestore.h new file mode 100644 index 0000000..3211b6a --- /dev/null +++ b/src/cachestore.h @@ -0,0 +1,35 @@ +#ifndef BU_CACHE_STORE_H +#define BU_CACHE_STORE_H + +#include "bu/cptr.h" + +namespace Bu +{ + /** + * Handles I/O for data in the cache. This also assigns ID's to the newly + * created objects that are requested through this system. + */ + template + class CacheStore + { + public: + CacheStore() + { + } + + virtual ~CacheStore() + { + } + + typedef Bu::CPtr Ptr; + + virtual obtype *load( const keytype &key )=0; + virtual void unload( obtype *pObj )=0; + virtual keytype create( obtype *pSrc )=0; + virtual void destroy( obtype *pObj, const keytype &key )=0; + + private: + }; +}; + +#endif -- cgit v1.2.3