Template Struct shadow¶
Defined in File cache.h
Inheritance Relationships¶
Base Type¶
public udho::cache::flake< KeyT, T >(Template Struct flake)
Struct Documentation¶
-
template<typename
KeyT, typename ...T>
structudho::cache::shadow: public udho::cache::flake<KeyT, T>¶ copiable shadow of a store reference.
user u("Neel"); appearence a("red"); udho::cache::store<std::string, user, appearence> store; udho::cache::shadow<std::string, user, appearence> shadow_ua(store); shadow_ua.insert("x", u); shadow_ua.insert("x", a); std::cout << std::boolalpha << shadow_ua.exists<user>("x") << std::endl; // true std::cout << std::boolalpha << shadow_ua.exists<appearence>("x") << std::endl; // true std::cout << shadow_ua.get<user>("x").name << std::endl; // Neel std::cout << shadow_ua.get<appearence>("x").color << std::endl; // red udho::cache::shadow<std::string, user> shadow_u(store); std::cout << std::boolalpha << shadow_u.exists<user>("x") << std::endl; // true std::cout << std::boolalpha << shadow_u.get<user>("x").name << std::endl; // true std::cout << shadow_u.exists<appearence>("x") << std::endl; // won't compile udho::cache::shadow<std::string, user> shadow_u2(shadow_u); // copiable udho::cache::shadow<std::string, user> shadow_u3(shadow_ua); // narrowable udho::cache::shadow<std::string, appearence> shadow_a(store); // unordered std::cout << shadow_a.exists<appearence>("x") << std::endl; // true std::cout << shadow_a.get<appearence>("x").color << std::endl; // red udho::cache::shadow<std::string> shadow_none(shadow_ua);
Public Types
Public Functions
-
template<template<typename, typename> class
StorageT, typename ...X>shadow(store<StorageT, key_type, X...> &store)¶
-
std::size_t
size() const¶
Public Members
-
master_type &
_master¶
-
template<template<typename, typename> class