diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-03-25 20:00:08 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-03-25 20:00:08 +0000 |
commit | 469bbcf0701e1eb8a6670c23145b0da87357e178 (patch) | |
tree | b5b062a16e46a6c5d3410b4e574cd0cc09057211 /src/experimental/cachestore.h | |
parent | ee1b79396076edc4e30aefb285fada03bb45e80d (diff) | |
download | libbu++-469bbcf0701e1eb8a6670c23145b0da87357e178.tar.gz libbu++-469bbcf0701e1eb8a6670c23145b0da87357e178.tar.bz2 libbu++-469bbcf0701e1eb8a6670c23145b0da87357e178.tar.xz libbu++-469bbcf0701e1eb8a6670c23145b0da87357e178.zip |
Code is all reorganized. We're about ready to release. I should write up a
little explenation of the arrangement.
Diffstat (limited to 'src/experimental/cachestore.h')
-rw-r--r-- | src/experimental/cachestore.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/experimental/cachestore.h b/src/experimental/cachestore.h new file mode 100644 index 0000000..d0d91a2 --- /dev/null +++ b/src/experimental/cachestore.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #ifndef BU_CACHE_STORE_H | ||
9 | #define BU_CACHE_STORE_H | ||
10 | |||
11 | #include "bu/list.h" | ||
12 | |||
13 | namespace Bu | ||
14 | { | ||
15 | /** | ||
16 | * Handles I/O for data in the cache. This also assigns ID's to the newly | ||
17 | * created objects that are requested through this system. | ||
18 | */ | ||
19 | template<class keytype, class obtype> | ||
20 | class CacheStore | ||
21 | { | ||
22 | public: | ||
23 | CacheStore() | ||
24 | { | ||
25 | } | ||
26 | |||
27 | virtual ~CacheStore() | ||
28 | { | ||
29 | } | ||
30 | |||
31 | virtual obtype *load( const keytype &key )=0; | ||
32 | virtual void unload( obtype *pObj, const keytype &key )=0; | ||
33 | virtual keytype create( obtype *pSrc )=0; | ||
34 | virtual void sync()=0; | ||
35 | virtual void sync( obtype *pObj, const keytype &key )=0; | ||
36 | virtual void destroy( obtype *pObj, const keytype &key )=0; | ||
37 | virtual void destroy( const keytype &key )=0; | ||
38 | virtual bool has( const keytype &key )=0; | ||
39 | virtual Bu::List<keytype> getKeys() { return Bu::List<keytype>(); } | ||
40 | virtual int getSize() { return -1; } | ||
41 | |||
42 | private: | ||
43 | }; | ||
44 | }; | ||
45 | |||
46 | #endif | ||