From 8c97f875c5437236a1aeda5f70b585d3e6bffa99 Mon Sep 17 00:00:00 2001 From: Neel Basu Date: Tue, 13 Oct 2020 20:45:39 +0530 Subject: [PATCH] - last compiling --- .gitignore | 1 + includes/udho/cache.h | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index dc27a369..57a8b9af 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ cmake-build-* docs.sphinx/bin docs.sphinx/lib docs.sphinx/pyvenv.cfg +docs/_build diff --git a/includes/udho/cache.h b/includes/udho/cache.h index 8da8855f..9d3ce7a2 100644 --- a/includes/udho/cache.h +++ b/includes/udho/cache.h @@ -292,10 +292,10 @@ struct engine: StorageT{ } }; -template class StorageT = storage::memory> -struct master: public engine>{ +template +struct master: public engine>{ typedef KeyT key_type; - typedef engine> storage_type; + typedef engine> storage_type; bool issued(const key_type& key) const{ return storage_type::exists(key); @@ -305,8 +305,8 @@ struct master: public engine>{ } }; -template class StorageT = storage::memory> -struct registry: public engine>{ +template +struct registry: public engine>{ typedef registry self_type; registry() = default; @@ -318,7 +318,7 @@ struct registry: public engine>{ }; -template class StorageT = storage::memory, typename... T> +template struct shadow; /** @@ -332,12 +332,12 @@ struct shadow; * store.exists(); * \endcode */ -template class StorageT = storage::memory, typename... T> -struct store: master, registry...{ +template +struct store: master, registry...{ typedef KeyT key_type; - typedef master master_type; - typedef store self_type; - typedef shadow shadow_type; + typedef master master_type; + typedef store self_type; + typedef shadow shadow_type; store() = default; store(const self_type&) = delete; @@ -345,23 +345,23 @@ struct store: master, registry...{ template bool exists(const key_type& key) const{ - return master_type::issued(key) && registry::exists(key); + return master_type::issued(key) && registry::exists(key); } template const V& get(const key_type& key, const V& def=V()) const{ if(master_type::issued(key)){ - return registry::at(key); + return registry::at(key); }else{ return def; } } template V& at(const key_type& key){ - return registry::at(key); + return registry::at(key); } template void insert(const key_type& key, const V& value){ - registry::insert(key, value); + registry::insert(key, value); if(!master_type::issued(key)){ master_type::issue(key); } @@ -372,14 +372,14 @@ struct store: master, registry...{ } template std::size_t size(const key_type& key) const{ - return registry::size(key); + return registry::size(key); } bool remove(){ return master_type::remove(); } template bool remove(const key_type& key){ - if(registry::remove(key)){ + if(registry::remove(key)){ master_type::update(); return true; }