Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Static Public Attributes | List of all members
CustomUintFormatter< Bytes, BigEndian > Struct Template Reference

Serialization wrapper class for custom integers and enums. More...

#include <serialize.h>

Public Member Functions

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

Static Public Attributes

static constexpr uint64_t MAX = 0xffffffffffffffff >> (8 * (8 - Bytes))
 

Detailed Description

template<int Bytes, bool BigEndian = false>
struct CustomUintFormatter< Bytes, BigEndian >

Serialization wrapper class for custom integers and enums.

It permits specifying the serialized size (1 to 8 bytes) and endianness.

Use the big endian mode for values that are stored in memory in native byte order, but serialized in big endian notation. This is only intended to implement serializers that are compatible with existing formats, and its use is not recommended for new data structures.

Definition at line 542 of file serialize.h.

Member Function Documentation

◆ Ser()

template<int Bytes, bool BigEndian = false>
template<typename Stream , typename I >
void CustomUintFormatter< Bytes, BigEndian >::Ser ( Stream &  s,
v 
)
inline

Definition at line 547 of file serialize.h.

Here is the call graph for this function:

◆ Unser()

template<int Bytes, bool BigEndian = false>
template<typename Stream , typename I >
void CustomUintFormatter< Bytes, BigEndian >::Unser ( Stream &  s,
I &  v 
)
inline

Definition at line 559 of file serialize.h.

Here is the call graph for this function:

Member Data Documentation

◆ MAX

template<int Bytes, bool BigEndian = false>
constexpr uint64_t CustomUintFormatter< Bytes, BigEndian >::MAX = 0xffffffffffffffff >> (8 * (8 - Bytes))
staticconstexpr

Definition at line 545 of file serialize.h.


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