persistent-cache-cpp: core::CacheCodec< T > Struct Template Reference

persistent-cache-cpp

Static Public Member Functions | List of all members
core::CacheCodec< T > Struct Template Reference

`#include <core/cache_codec.h>`

## Static Public Member Functions
static std::string | encode (T const &value)
| Converts a value of custom type T into a string. More...
static T | decode (std::string const &s)
| Converts a string into a value of custom type T. More...

## Detailed Description

### template<typename T>
struct core::CacheCodec< T >

Traits for serialization and deserialization of cache custom types. To use custom types, specialize this template for each custom type (other than string) in the `core` namespace.

Warning
  Do not specialize this struct for `std::string`! Doing so has no effect.

See also
  PersistentCache

## Member Function Documentation

## ◆ decode()

template<typename T >

static T core::CacheCodec< T >::decode | ( | std::string const & | s | ) |
| static

Converts a string into a value of custom type T.

## ◆ encode()

template<typename T >

static std::string core::CacheCodec< T >::encode | ( | T const & | value | ) |
| static

Converts a value of custom type T into a string.

The documentation for this struct was generated from the following file:

- /build/persistent-cache-cpp-git/src/persistent-cache-cpp/include/core/cache_codec.h