diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-12-01 17:20:26 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-12-01 17:20:26 +0000 |
commit | 350b052cfd866e3b3c7c4626551b49f8b75e55a1 (patch) | |
tree | b957f0dea70a7a2527ec78b32cdfc3e00712ff4d /src/cachehandler.h | |
parent | c1229c50baa4816924e1914f3b4c78177749b73d (diff) | |
download | libbu++-350b052cfd866e3b3c7c4626551b49f8b75e55a1.tar.gz libbu++-350b052cfd866e3b3c7c4626551b49f8b75e55a1.tar.bz2 libbu++-350b052cfd866e3b3c7c4626551b49f8b75e55a1.tar.xz libbu++-350b052cfd866e3b3c7c4626551b49f8b75e55a1.zip |
Woo! Very nearly there cache-wise, I'm about to change the name of the handler,
do a few more tests, and hopefully get something loading/saving.
Diffstat (limited to '')
-rw-r--r-- | src/cachehandler.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/cachehandler.h b/src/cachehandler.h index 6ce1471..3b26970 100644 --- a/src/cachehandler.h +++ b/src/cachehandler.h | |||
@@ -1,15 +1,31 @@ | |||
1 | #ifndef BU_CACHE_HANDLER_H | 1 | #ifndef BU_CACHE_HANDLER_H |
2 | #define BU_CACHE_HANDLER_H | 2 | #define BU_CACHE_HANDLER_H |
3 | 3 | ||
4 | #include "bu/cptr.h" | ||
5 | |||
4 | namespace Bu | 6 | namespace Bu |
5 | { | 7 | { |
8 | /** | ||
9 | * Handles I/O for data in the cache. This also assigns ID's to the newly | ||
10 | * created objects that are requested through this system. | ||
11 | */ | ||
12 | template<class T> | ||
6 | class CacheHandler | 13 | class CacheHandler |
7 | { | 14 | { |
8 | public: | 15 | public: |
9 | CacheHandler(); | 16 | CacheHandler() |
10 | virtual ~CacheHandler(); | 17 | { |
11 | virtual void load()=0; | 18 | } |
12 | virtual void unload()=0; | 19 | |
20 | virtual ~CacheHandler() | ||
21 | { | ||
22 | } | ||
23 | |||
24 | virtual Bu::CPtr<T> load()=0; | ||
25 | virtual void unload( Bu::CPtr<T> pObj )=0; | ||
26 | virtual Bu::CPtr<T> create()=0; | ||
27 | virtual Bu::CPtr<T> create( T &rSrc )=0; | ||
28 | virtual void destroy( Bu::CPtr<T> pObj )=0; | ||
13 | 29 | ||
14 | private: | 30 | private: |
15 | }; | 31 | }; |