Template Struct disk

Struct Documentation

template<typename KeyT, typename ValueT = void>
struct udho::cache::storage::disk

Public Types

typedef KeyT key_type
typedef ValueT value_type
typedef content<ValueT> content_type
typedef std::map<key_type, content_type> map_type
typedef storage::disk<KeyT, ValueT> self_type
typedef udho::config<udho::configs::session> session_config_type
typedef session_config_type config_type

Public Functions

disk(const session_config_type &config)
disk(const self_type&) = delete
disk(self_type&&) = default
std::size_t size() const
bool exists(const key_type &key) const
void create(const key_type &key, const content_type &content)
content_type retrieve(const key_type &key) const
bool update(const key_type &key, const content_type &content)
bool remove(const key_type &key)

Protected Functions

boost::filesystem::path storage() const
udho::configs::session::format format() const
std::string extension() const
std::string filename(const key_type &key) const
boost::filesystem::path path(const key_type &key) const
void save(udho::configs::session::format format, std::ofstream &file, const content_type &content)
void load(udho::configs::session::format format, std::ifstream &file, content_type &content) const
void save(std::ofstream &file, const content_type &content)
void load(std::ifstream &file, content_type &content) const

Protected Attributes

const session_config_type &_config
std::string _name
boost::mutex _mutex