aboutsummaryrefslogtreecommitdiff
path: root/src/cachestorenids.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-02-24 00:06:16 +0000
committerMike Buland <eichlan@xagasoft.com>2009-02-24 00:06:16 +0000
commitef2935347099967cc7092fa7f472d91d51571468 (patch)
treeabf0c041a31610fa7f8fb562c3c36a8277c438d2 /src/cachestorenids.h
parent4309066dff46f52690998bbd1f60ec8b1631f142 (diff)
downloadlibbu++-ef2935347099967cc7092fa7f472d91d51571468.tar.gz
libbu++-ef2935347099967cc7092fa7f472d91d51571468.tar.bz2
libbu++-ef2935347099967cc7092fa7f472d91d51571468.tar.xz
libbu++-ef2935347099967cc7092fa7f472d91d51571468.zip
Whoa, lots of updates. Md5 is more general, nids, cache, cachestore, and
cachestorenids all support synchronizing now. Url is pretty much done.
Diffstat (limited to '')
-rw-r--r--src/cachestorenids.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cachestorenids.h b/src/cachestorenids.h
index 40213cd..c6a00ce 100644
--- a/src/cachestorenids.h
+++ b/src/cachestorenids.h
@@ -97,6 +97,22 @@ namespace Bu
97 return key; 97 return key;
98 } 98 }
99 99
100 virtual void sync()
101 {
102 NidsStream ns = nStore.openStream( 0 );
103 Bu::Archive ar( ns, Bu::Archive::save );
104 ar << hId;
105
106 nStore.sync();
107 }
108
109 virtual void sync( obtype *pSrc, const keytype &key )
110 {
111 int iStream = hId.get( key );
112 NidsStream ns = nStore.openStream( iStream );
113 __cacheStoreNidsStore<obtype, keytype>( ns, *pSrc, key );
114 }
115
100 virtual void destroy( obtype *pObj, const keytype &key ) 116 virtual void destroy( obtype *pObj, const keytype &key )
101 { 117 {
102 int iStream = hId.get( key ); 118 int iStream = hId.get( key );
@@ -105,6 +121,11 @@ namespace Bu
105 delete pObj; 121 delete pObj;
106 } 122 }
107 123
124 virtual bool has( const keytype &key )
125 {
126 return hId.has( key );
127 }
128
108 virtual Bu::List<keytype> getKeys() 129 virtual Bu::List<keytype> getKeys()
109 { 130 {
110 return hId.getKeys(); 131 return hId.getKeys();