Bitcoin ABC 0.30.7
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
DifferenceFormatter Class Reference

Helper for differentially encoded Compact Size integers in lists. More...

#include <serialize.h>

Inheritance diagram for DifferenceFormatter:
[legend]

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)
 

Private Attributes

uint64_t m_shift = 0
 

Detailed Description

Helper for differentially encoded Compact Size integers in lists.

Instead of using raw indexes, the number encoded is the difference between the current index and the previous index, minus one. For example, a first index of 0 implies a real index of 0, a second index of 0 thereafter refers to a real index of 1, etc.

To be used with a VectorFormatter.

Definition at line 761 of file serialize.h.

Member Function Documentation

◆ Ser()

template<typename Stream , typename I >
void DifferenceFormatter::Ser ( Stream &  s,
v 
)
inline

Definition at line 765 of file serialize.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Unser()

template<typename Stream , typename I >
void DifferenceFormatter::Unser ( Stream &  s,
I &  v 
)
inline

Definition at line 772 of file serialize.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_shift

uint64_t DifferenceFormatter::m_shift = 0
private

Definition at line 762 of file serialize.h.


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