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/cptr.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/cptr.h') diff --git a/src/cptr.h b/src/cptr.h index 6e54fdd..8f35a03 100644 --- a/src/cptr.h +++ b/src/cptr.h @@ -3,31 +3,29 @@ namespace Bu { - template class Cache; + template class Cache; /** * Cache Pointer - Provides access to data that is held within the cache. * This provides safe, refcounting access to data stored in the cache, with * support for lazy loading. */ - template + template class CPtr { - friend class Bu::Cache; - public: - typedef long cid_t; /**< Cache ID type. Unique cache entry ID. */ + friend class Bu::Cache; private: - CPtr( Cache &rCache, obtype *pData ) : + CPtr( Cache &rCache, obtype *pData ) : rCache( rCache ), pData( pData ) { - rCache.incRef( cId ); + rCache.incRef( kId ); } public: virtual ~CPtr() { - rCache.decRef( cId ); + rCache.decRef( kId ); } obtype &operator*() @@ -41,9 +39,9 @@ namespace Bu } private: - Bu::Cache &rCache; + Bu::Cache &rCache; obtype *pData; - cid_t cId; + keytype kId; }; }; -- cgit v1.2.3