Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | List of all members
VectorFormatter< Formatter > Struct Template Reference

Formatter to serialize/deserialize vector elements using another formatter. More...

#include <serialize.h>

Public Member Functions

template<typename Stream , typename V >
void Ser (Stream &s, const V &v)
 
template<typename Stream , typename V >
void Unser (Stream &s, V &v)
 

Detailed Description

template<class Formatter>
struct VectorFormatter< Formatter >

Formatter to serialize/deserialize vector elements using another formatter.

Example: struct X { std::vector<uint64_t> v; SERIALIZE_METHODS(X, obj) { READWRITE(Using<VectorFormatter<VarInt>>(obj.v)); } }; will define a struct that contains a vector of uint64_t, which is serialized as a vector of VarInt-encoded integers.

V is not required to be an std::vector type. It works for any class that exposes a value_type, size, reserve, emplace_back, back, and const iterators.

Definition at line 671 of file serialize.h.

Member Function Documentation

◆ Ser()

template<class Formatter >
template<typename Stream , typename V >
void VectorFormatter< Formatter >::Ser ( Stream &  s,
const V &  v 
)
inline

Definition at line 674 of file serialize.h.

Here is the call graph for this function:

◆ Unser()

template<class Formatter >
template<typename Stream , typename V >
void VectorFormatter< Formatter >::Unser ( Stream &  s,
V &  v 
)
inline

Definition at line 684 of file serialize.h.

Here is the call graph for this function:

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