PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Classes | Macros | Enumerations | Functions
serialize.h File Reference
#include <algorithm>
#include <assert.h>
#include <ios>
#include <limits>
#include <map>
#include <set>
#include <stdint.h>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
#include "compat/endian.h"
#include "prevector.h"
Include dependency graph for serialize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CFlatData
 Wrapper for serializing arrays and POD. More...
 
class  CVarInt< I >
 
class  LimitedString< Limit >
 
struct  CSerActionSerialize
 Support for ADD_SERIALIZE_METHODS and READWRITE macro. More...
 
struct  CSerActionUnserialize
 
class  CSizeComputer
 

Macros

#define READWRITE(obj)   (::SerReadWrite(s, (obj), nType, nVersion, ser_action))
 
#define ADD_SERIALIZE_METHODS
 Implement three methods for serializable objects. More...
 
#define FLATDATA(obj)   REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj)))
 
#define VARINT(obj)   REF(WrapVarInt(REF(obj)))
 
#define LIMITED_STRING(obj, n)   REF(LimitedString<n>(REF(obj)))
 

Enumerations

enum  { SER_NETWORK = (1 << 0), SER_DISK = (1 << 1), SER_GETHASH = (1 << 2) }
 

Functions

template<typename T >
T & REF (const T &val)
 Used to bypass the rule against non-const reference to temporary where it makes sense with wrappers such as CFlatData or CTxDB. More...
 
template<typename T >
T * NCONST_PTR (const T *val)
 Used to acquire a non-const pointer "this" to generate bodies of const serialization operations from a template. More...
 
template<typename V >
V::value_type * begin_ptr (V &v)
 Important: Do not use the following functions in new code, but use v.data() and v.data() + v.size() respectively directly. More...
 
template<typename V >
const V::value_type * begin_ptr (const V &v)
 
template<typename V >
V::value_type * end_ptr (V &v)
 
template<typename V >
const V::value_type * end_ptr (const V &v)
 
template<typename Stream >
void ser_writedata8 (Stream &s, uint8_t obj)
 
template<typename Stream >
void ser_writedata16 (Stream &s, uint16_t obj)
 
template<typename Stream >
void ser_writedata32 (Stream &s, uint32_t obj)
 
template<typename Stream >
void ser_writedata64 (Stream &s, uint64_t obj)
 
template<typename Stream >
uint8_t ser_readdata8 (Stream &s)
 
template<typename Stream >
uint16_t ser_readdata16 (Stream &s)
 
template<typename Stream >
uint32_t ser_readdata32 (Stream &s)
 
template<typename Stream >
uint64_t ser_readdata64 (Stream &s)
 
uint64_t ser_double_to_uint64 (double x)
 
uint32_t ser_float_to_uint32 (float x)
 
double ser_uint64_to_double (uint64_t y)
 
float ser_uint32_to_float (uint32_t y)
 
unsigned int GetSerializeSize (char a, int, int=0)
 
unsigned int GetSerializeSize (int8_t a, int, int=0)
 
unsigned int GetSerializeSize (uint8_t a, int, int=0)
 
unsigned int GetSerializeSize (int16_t a, int, int=0)
 
unsigned int GetSerializeSize (uint16_t a, int, int=0)
 
unsigned int GetSerializeSize (int32_t a, int, int=0)
 
unsigned int GetSerializeSize (uint32_t a, int, int=0)
 
unsigned int GetSerializeSize (int64_t a, int, int=0)
 
unsigned int GetSerializeSize (uint64_t a, int, int=0)
 
unsigned int GetSerializeSize (float a, int, int=0)
 
unsigned int GetSerializeSize (double a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, char a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, int8_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, uint8_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, int16_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, uint16_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, int32_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, uint32_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, int64_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, uint64_t a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, float a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, double a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, char &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, int8_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, uint8_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, int16_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, uint16_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, int32_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, uint32_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, int64_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, uint64_t &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, float &a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, double &a, int, int=0)
 
unsigned int GetSerializeSize (bool a, int, int=0)
 
template<typename Stream >
void Serialize (Stream &s, bool a, int, int=0)
 
template<typename Stream >
void Unserialize (Stream &s, bool &a, int, int=0)
 
unsigned int GetSizeOfCompactSize (uint64_t nSize)
 Compact Size size < 253 – 1 byte size <= USHRT_MAX – 3 bytes (253 + 2 bytes) size <= UINT_MAX – 5 bytes (254 + 4 bytes) size > UINT_MAX – 9 bytes (255 + 8 bytes) More...
 
template<typename Stream >
void WriteCompactSize (Stream &os, uint64_t nSize)
 
template<typename Stream >
uint64_t ReadCompactSize (Stream &is)
 
template<typename I >
unsigned int GetSizeOfVarInt (I n)
 Variable-length integers: bytes are a MSB base-128 encoding of the number. More...
 
template<typename Stream , typename I >
void WriteVarInt (Stream &os, I n)
 
template<typename Stream , typename I >
ReadVarInt (Stream &is)
 
template<typename I >
CVarInt< I > WrapVarInt (I &n)
 
template<typename C >
unsigned int GetSerializeSize (const std::basic_string< C > &str, int, int=0)
 Forward declarations. More...
 
template<typename Stream , typename C >
void Serialize (Stream &os, const std::basic_string< C > &str, int, int=0)
 
template<typename Stream , typename C >
void Unserialize (Stream &is, std::basic_string< C > &str, int, int=0)
 
template<unsigned int N, typename T >
unsigned int GetSerializeSize_impl (const prevector< N, T > &v, int nType, int nVersion, const unsigned char &)
 prevector prevectors of unsigned char are a special case and are intended to be serialized as a single opaque blob. More...
 
template<unsigned int N, typename T , typename V >
unsigned int GetSerializeSize_impl (const prevector< N, T > &v, int nType, int nVersion, const V &)
 
template<unsigned int N, typename T >
unsigned int GetSerializeSize (const prevector< N, T > &v, int nType, int nVersion)
 
template<typename Stream , unsigned int N, typename T >
void Serialize_impl (Stream &os, const prevector< N, T > &v, int nType, int nVersion, const unsigned char &)
 
template<typename Stream , unsigned int N, typename T , typename V >
void Serialize_impl (Stream &os, const prevector< N, T > &v, int nType, int nVersion, const V &)
 
template<typename Stream , unsigned int N, typename T >
void Serialize (Stream &os, const prevector< N, T > &v, int nType, int nVersion)
 
template<typename Stream , unsigned int N, typename T >
void Unserialize_impl (Stream &is, prevector< N, T > &v, int nType, int nVersion, const unsigned char &)
 
template<typename Stream , unsigned int N, typename T , typename V >
void Unserialize_impl (Stream &is, prevector< N, T > &v, int nType, int nVersion, const V &)
 
template<typename Stream , unsigned int N, typename T >
void Unserialize (Stream &is, prevector< N, T > &v, int nType, int nVersion)
 
template<typename T , typename A >
unsigned int GetSerializeSize_impl (const std::vector< T, A > &v, int nType, int nVersion, const unsigned char &)
 vector vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob. More...
 
template<typename T , typename A , typename V >
unsigned int GetSerializeSize_impl (const std::vector< T, A > &v, int nType, int nVersion, const V &)
 
template<typename T , typename A >
unsigned int GetSerializeSize (const std::vector< T, A > &v, int nType, int nVersion)
 
template<typename Stream , typename T , typename A >
void Serialize_impl (Stream &os, const std::vector< T, A > &v, int nType, int nVersion, const unsigned char &)
 
template<typename Stream , typename T , typename A , typename V >
void Serialize_impl (Stream &os, const std::vector< T, A > &v, int nType, int nVersion, const V &)
 
template<typename Stream , typename T , typename A >
void Serialize (Stream &os, const std::vector< T, A > &v, int nType, int nVersion)
 
template<typename Stream , typename T , typename A >
void Unserialize_impl (Stream &is, std::vector< T, A > &v, int nType, int nVersion, const unsigned char &)
 
template<typename Stream , typename T , typename A , typename V >
void Unserialize_impl (Stream &is, std::vector< T, A > &v, int nType, int nVersion, const V &)
 
template<typename Stream , typename T , typename A >
void Unserialize (Stream &is, std::vector< T, A > &v, int nType, int nVersion)
 
template<typename K , typename T >
unsigned int GetSerializeSize (const std::pair< K, T > &item, int nType, int nVersion)
 pair More...
 
template<typename Stream , typename K , typename T >
void Serialize (Stream &os, const std::pair< K, T > &item, int nType, int nVersion)
 
template<typename Stream , typename K , typename T >
void Unserialize (Stream &is, std::pair< K, T > &item, int nType, int nVersion)
 
template<typename K , typename T , typename Pred , typename A >
unsigned int GetSerializeSize (const std::map< K, T, Pred, A > &m, int nType, int nVersion)
 map More...
 
template<typename Stream , typename K , typename T , typename Pred , typename A >
void Serialize (Stream &os, const std::map< K, T, Pred, A > &m, int nType, int nVersion)
 
template<typename Stream , typename K , typename T , typename Pred , typename A >
void Unserialize (Stream &is, std::map< K, T, Pred, A > &m, int nType, int nVersion)
 
template<typename K , typename Pred , typename A >
unsigned int GetSerializeSize (const std::set< K, Pred, A > &m, int nType, int nVersion)
 set More...
 
template<typename Stream , typename K , typename Pred , typename A >
void Serialize (Stream &os, const std::set< K, Pred, A > &m, int nType, int nVersion)
 
template<typename Stream , typename K , typename Pred , typename A >
void Unserialize (Stream &is, std::set< K, Pred, A > &m, int nType, int nVersion)
 
template<typename T >
unsigned int GetSerializeSize (const T &a, long nType, int nVersion)
 If none of the specialized versions above matched, default to calling member function. More...
 
template<typename Stream , typename T >
void Serialize (Stream &os, const T &a, long nType, int nVersion)
 
template<typename Stream , typename T >
void Unserialize (Stream &is, T &a, long nType, int nVersion)
 
template<typename Stream , typename T >
void SerReadWrite (Stream &s, const T &obj, int nType, int nVersion, CSerActionSerialize ser_action)
 
template<typename Stream , typename T >
void SerReadWrite (Stream &s, T &obj, int nType, int nVersion, CSerActionUnserialize ser_action)
 

Macro Definition Documentation

◆ ADD_SERIALIZE_METHODS

#define ADD_SERIALIZE_METHODS
Value:
size_t GetSerializeSize(int nType, int nVersion) const \
{ \
CSizeComputer s(nType, nVersion); \
NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion); \
return s.size(); \
} \
template <typename Stream> \
void Serialize(Stream& s, int nType, int nVersion) const \
{ \
NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion); \
} \
template <typename Stream> \
void Unserialize(Stream& s, int nType, int nVersion) \
{ \
SerializationOp(s, CSerActionUnserialize(), nType, nVersion); \
}

Implement three methods for serializable objects.

These are actually wrappers over "SerializationOp" template, which implements the body of each class' serialization code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be added as members.

Definition at line 172 of file serialize.h.

◆ FLATDATA

#define FLATDATA (   obj)    REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj)))

Definition at line 365 of file serialize.h.

◆ LIMITED_STRING

#define LIMITED_STRING (   obj,
 
)    REF(LimitedString<n>(REF(obj)))

Definition at line 367 of file serialize.h.

◆ READWRITE

#define READWRITE (   obj)    (::SerReadWrite(s, (obj), nType, nVersion, ser_action))

Definition at line 164 of file serialize.h.

◆ VARINT

#define VARINT (   obj)    REF(WrapVarInt(REF(obj)))

Definition at line 366 of file serialize.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SER_NETWORK 
SER_DISK 
SER_GETHASH 

Definition at line 157 of file serialize.h.

Function Documentation

◆ begin_ptr() [1/2]

template<typename V >
const V::value_type* begin_ptr ( const V &  v)
inline

Definition at line 62 of file serialize.h.

◆ begin_ptr() [2/2]

template<typename V >
V::value_type* begin_ptr ( V &  v)
inline

Important: Do not use the following functions in new code, but use v.data() and v.data() + v.size() respectively directly.

They were once introduced to have a compatible, safe way to get the begin and end pointer of a vector. However with C++11 the language has built-in functionality for this and it's more readable to just use that.

Definition at line 57 of file serialize.h.

Here is the caller graph for this function:

◆ end_ptr() [1/2]

template<typename V >
const V::value_type* end_ptr ( const V &  v)
inline

Definition at line 72 of file serialize.h.

◆ end_ptr() [2/2]

template<typename V >
V::value_type* end_ptr ( V &  v)
inline

Definition at line 67 of file serialize.h.

Here is the caller graph for this function:

◆ GetSerializeSize() [1/19]

unsigned int GetSerializeSize ( bool  a,
int  ,
int  = 0 
)
inline

Definition at line 230 of file serialize.h.

◆ GetSerializeSize() [2/19]

unsigned int GetSerializeSize ( char  a,
int  ,
int  = 0 
)
inline

Definition at line 194 of file serialize.h.

Here is the caller graph for this function:

◆ GetSerializeSize() [3/19]

template<unsigned int N, typename T >
unsigned int GetSerializeSize ( const prevector< N, T > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 637 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [4/19]

template<typename C >
unsigned int GetSerializeSize ( const std::basic_string< C > &  str,
int  ,
int  = 0 
)

Forward declarations.

string

std::string

Definition at line 594 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [5/19]

template<typename K , typename T , typename Pred , typename A >
unsigned int GetSerializeSize ( const std::map< K, T, Pred, A > &  m,
int  nType,
int  nVersion 
)

map

Definition at line 824 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [6/19]

template<typename K , typename T >
unsigned int GetSerializeSize ( const std::pair< K, T > &  item,
int  nType,
int  nVersion 
)

pair

Definition at line 800 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [7/19]

template<typename K , typename Pred , typename A >
unsigned int GetSerializeSize ( const std::set< K, Pred, A > &  m,
int  nType,
int  nVersion 
)

set

Definition at line 858 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [8/19]

template<typename T , typename A >
unsigned int GetSerializeSize ( const std::vector< T, A > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 727 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize() [9/19]

template<typename T >
unsigned int GetSerializeSize ( const T &  a,
long  nType,
int  nVersion 
)
inline

If none of the specialized versions above matched, default to calling member function.

"int nType" is changed to "long nType" to keep from getting an ambiguous overload error. The compiler will only cast int to long if none of the other templates matched. Thanks to Boost serialization for this idea.

Definition at line 572 of file serialize.h.

◆ GetSerializeSize() [10/19]

unsigned int GetSerializeSize ( double  a,
int  ,
int  = 0 
)
inline

Definition at line 204 of file serialize.h.

◆ GetSerializeSize() [11/19]

unsigned int GetSerializeSize ( float  a,
int  ,
int  = 0 
)
inline

Definition at line 203 of file serialize.h.

◆ GetSerializeSize() [12/19]

unsigned int GetSerializeSize ( int16_t  a,
int  ,
int  = 0 
)
inline

Definition at line 197 of file serialize.h.

◆ GetSerializeSize() [13/19]

unsigned int GetSerializeSize ( int32_t  a,
int  ,
int  = 0 
)
inline

Definition at line 199 of file serialize.h.

◆ GetSerializeSize() [14/19]

unsigned int GetSerializeSize ( int64_t  a,
int  ,
int  = 0 
)
inline

Definition at line 201 of file serialize.h.

◆ GetSerializeSize() [15/19]

unsigned int GetSerializeSize ( int8_t  a,
int  ,
int  = 0 
)
inline

Definition at line 195 of file serialize.h.

◆ GetSerializeSize() [16/19]

unsigned int GetSerializeSize ( uint16_t  a,
int  ,
int  = 0 
)
inline

Definition at line 198 of file serialize.h.

◆ GetSerializeSize() [17/19]

unsigned int GetSerializeSize ( uint32_t  a,
int  ,
int  = 0 
)
inline

Definition at line 200 of file serialize.h.

◆ GetSerializeSize() [18/19]

unsigned int GetSerializeSize ( uint64_t  a,
int  ,
int  = 0 
)
inline

Definition at line 202 of file serialize.h.

◆ GetSerializeSize() [19/19]

unsigned int GetSerializeSize ( uint8_t  a,
int  ,
int  = 0 
)
inline

Definition at line 196 of file serialize.h.

◆ GetSerializeSize_impl() [1/4]

template<unsigned int N, typename T >
unsigned int GetSerializeSize_impl ( const prevector< N, T > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

prevector prevectors of unsigned char are a special case and are intended to be serialized as a single opaque blob.

prevector

Definition at line 622 of file serialize.h.

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

◆ GetSerializeSize_impl() [2/4]

template<unsigned int N, typename T , typename V >
unsigned int GetSerializeSize_impl ( const prevector< N, T > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 628 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize_impl() [3/4]

template<typename T , typename A >
unsigned int GetSerializeSize_impl ( const std::vector< T, A > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

vector vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob.

vector

Definition at line 712 of file serialize.h.

Here is the call graph for this function:

◆ GetSerializeSize_impl() [4/4]

template<typename T , typename A , typename V >
unsigned int GetSerializeSize_impl ( const std::vector< T, A > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 718 of file serialize.h.

Here is the call graph for this function:

◆ GetSizeOfCompactSize()

unsigned int GetSizeOfCompactSize ( uint64_t  nSize)
inline

Compact Size size < 253 – 1 byte size <= USHRT_MAX – 3 bytes (253 + 2 bytes) size <= UINT_MAX – 5 bytes (254 + 4 bytes) size > UINT_MAX – 9 bytes (255 + 8 bytes)

Definition at line 242 of file serialize.h.

Here is the caller graph for this function:

◆ GetSizeOfVarInt()

template<typename I >
unsigned int GetSizeOfVarInt ( n)
inline

Variable-length integers: bytes are a MSB base-128 encoding of the number.

The high bit in each byte signifies whether another digit follows. To make sure the encoding is one-to-one, one is subtracted from all but the last digit. Thus, the byte sequence a[] with length len, where all but the last byte has bit 128 set, encodes the number:

(a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))

Properties:

  • Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes)
  • Every integer has exactly one encoding
  • Encoding does not depend on size of original integer type
  • No redundancy: every (infinite) byte sequence corresponds to a list of encoded integers.

0: [0x00] 256: [0x81 0x00] 1: [0x01] 16383: [0xFE 0x7F] 127: [0x7F] 16384: [0xFF 0x00] 128: [0x80 0x00] 16511: [0x80 0xFF 0x7F] 255: [0x80 0x7F] 65535: [0x82 0xFD 0x7F] 2^32: [0x8E 0xFE 0xFE 0xFF 0x00]

Definition at line 322 of file serialize.h.

◆ NCONST_PTR()

template<typename T >
T* NCONST_PTR ( const T *  val)
inline

Used to acquire a non-const pointer "this" to generate bodies of const serialization operations from a template.

Definition at line 44 of file serialize.h.

◆ ReadCompactSize()

template<typename Stream >
uint64_t ReadCompactSize ( Stream &  is)

Definition at line 273 of file serialize.h.

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

◆ ReadVarInt()

template<typename Stream , typename I >
I ReadVarInt ( Stream &  is)

Definition at line 352 of file serialize.h.

Here is the call graph for this function:

◆ REF()

template<typename T >
T& REF ( const T &  val)
inline

Used to bypass the rule against non-const reference to temporary where it makes sense with wrappers such as CFlatData or CTxDB.

Definition at line 34 of file serialize.h.

Here is the caller graph for this function:

◆ ser_double_to_uint64()

uint64_t ser_double_to_uint64 ( double  x)
inline

Definition at line 125 of file serialize.h.

Here is the caller graph for this function:

◆ ser_float_to_uint32()

uint32_t ser_float_to_uint32 ( float  x)
inline

Definition at line 131 of file serialize.h.

Here is the caller graph for this function:

◆ ser_readdata16()

template<typename Stream >
uint16_t ser_readdata16 ( Stream &  s)
inline

Definition at line 107 of file serialize.h.

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

◆ ser_readdata32()

template<typename Stream >
uint32_t ser_readdata32 ( Stream &  s)
inline

Definition at line 113 of file serialize.h.

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

◆ ser_readdata64()

template<typename Stream >
uint64_t ser_readdata64 ( Stream &  s)
inline

Definition at line 119 of file serialize.h.

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

◆ ser_readdata8()

template<typename Stream >
uint8_t ser_readdata8 ( Stream &  s)
inline

Definition at line 101 of file serialize.h.

Here is the caller graph for this function:

◆ ser_uint32_to_float()

float ser_uint32_to_float ( uint32_t  y)
inline

Definition at line 143 of file serialize.h.

Here is the caller graph for this function:

◆ ser_uint64_to_double()

double ser_uint64_to_double ( uint64_t  y)
inline

Definition at line 137 of file serialize.h.

Here is the caller graph for this function:

◆ ser_writedata16()

template<typename Stream >
void ser_writedata16 ( Stream &  s,
uint16_t  obj 
)
inline

Definition at line 86 of file serialize.h.

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

◆ ser_writedata32()

template<typename Stream >
void ser_writedata32 ( Stream &  s,
uint32_t  obj 
)
inline

Definition at line 91 of file serialize.h.

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

◆ ser_writedata64()

template<typename Stream >
void ser_writedata64 ( Stream &  s,
uint64_t  obj 
)
inline

Definition at line 96 of file serialize.h.

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

◆ ser_writedata8()

template<typename Stream >
void ser_writedata8 ( Stream &  s,
uint8_t  obj 
)
inline

Definition at line 82 of file serialize.h.

Here is the caller graph for this function:

◆ Serialize() [1/19]

template<typename Stream , unsigned int N, typename T >
void Serialize ( Stream &  os,
const prevector< N, T > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 660 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [2/19]

template<typename Stream , typename C >
void Serialize ( Stream &  os,
const std::basic_string< C > &  str,
int  ,
int  = 0 
)

Definition at line 600 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [3/19]

template<typename Stream , typename K , typename T , typename Pred , typename A >
void Serialize ( Stream &  os,
const std::map< K, T, Pred, A > &  m,
int  nType,
int  nVersion 
)

Definition at line 833 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [4/19]

template<typename Stream , typename K , typename T >
void Serialize ( Stream &  os,
const std::pair< K, T > &  item,
int  nType,
int  nVersion 
)

Definition at line 806 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [5/19]

template<typename Stream , typename K , typename Pred , typename A >
void Serialize ( Stream &  os,
const std::set< K, Pred, A > &  m,
int  nType,
int  nVersion 
)

Definition at line 867 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [6/19]

template<typename Stream , typename T , typename A >
void Serialize ( Stream &  os,
const std::vector< T, A > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 750 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [7/19]

template<typename Stream , typename T >
void Serialize ( Stream &  os,
const T &  a,
long  nType,
int  nVersion 
)
inline

Definition at line 578 of file serialize.h.

◆ Serialize() [8/19]

template<typename Stream >
void Serialize ( Stream &  s,
bool  a,
int  ,
int  = 0 
)
inline

Definition at line 231 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [9/19]

template<typename Stream >
void Serialize ( Stream &  s,
char  a,
int  ,
int  = 0 
)
inline

Definition at line 206 of file serialize.h.

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

◆ Serialize() [10/19]

template<typename Stream >
void Serialize ( Stream &  s,
double  a,
int  ,
int  = 0 
)
inline

Definition at line 216 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [11/19]

template<typename Stream >
void Serialize ( Stream &  s,
float  a,
int  ,
int  = 0 
)
inline

Definition at line 215 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [12/19]

template<typename Stream >
void Serialize ( Stream &  s,
int16_t  a,
int  ,
int  = 0 
)
inline

Definition at line 209 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [13/19]

template<typename Stream >
void Serialize ( Stream &  s,
int32_t  a,
int  ,
int  = 0 
)
inline

Definition at line 211 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [14/19]

template<typename Stream >
void Serialize ( Stream &  s,
int64_t  a,
int  ,
int  = 0 
)
inline

Definition at line 213 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [15/19]

template<typename Stream >
void Serialize ( Stream &  s,
int8_t  a,
int  ,
int  = 0 
)
inline
Todo:
Get rid of bare char

Definition at line 207 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [16/19]

template<typename Stream >
void Serialize ( Stream &  s,
uint16_t  a,
int  ,
int  = 0 
)
inline

Definition at line 210 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [17/19]

template<typename Stream >
void Serialize ( Stream &  s,
uint32_t  a,
int  ,
int  = 0 
)
inline

Definition at line 212 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [18/19]

template<typename Stream >
void Serialize ( Stream &  s,
uint64_t  a,
int  ,
int  = 0 
)
inline

Definition at line 214 of file serialize.h.

Here is the call graph for this function:

◆ Serialize() [19/19]

template<typename Stream >
void Serialize ( Stream &  s,
uint8_t  a,
int  ,
int  = 0 
)
inline

Definition at line 208 of file serialize.h.

Here is the call graph for this function:

◆ Serialize_impl() [1/4]

template<typename Stream , unsigned int N, typename T >
void Serialize_impl ( Stream &  os,
const prevector< N, T > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

Definition at line 644 of file serialize.h.

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

◆ Serialize_impl() [2/4]

template<typename Stream , unsigned int N, typename T , typename V >
void Serialize_impl ( Stream &  os,
const prevector< N, T > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 652 of file serialize.h.

Here is the call graph for this function:

◆ Serialize_impl() [3/4]

template<typename Stream , typename T , typename A >
void Serialize_impl ( Stream &  os,
const std::vector< T, A > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

Definition at line 734 of file serialize.h.

Here is the call graph for this function:

◆ Serialize_impl() [4/4]

template<typename Stream , typename T , typename A , typename V >
void Serialize_impl ( Stream &  os,
const std::vector< T, A > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 742 of file serialize.h.

Here is the call graph for this function:

◆ SerReadWrite() [1/2]

template<typename Stream , typename T >
void SerReadWrite ( Stream &  s,
const T &  obj,
int  nType,
int  nVersion,
CSerActionSerialize  ser_action 
)
inline

Definition at line 899 of file serialize.h.

Here is the call graph for this function:

◆ SerReadWrite() [2/2]

template<typename Stream , typename T >
void SerReadWrite ( Stream &  s,
T &  obj,
int  nType,
int  nVersion,
CSerActionUnserialize  ser_action 
)
inline

Definition at line 905 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [1/19]

template<typename Stream , unsigned int N, typename T >
void Unserialize ( Stream &  is,
prevector< N, T > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 701 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [2/19]

template<typename Stream , typename C >
void Unserialize ( Stream &  is,
std::basic_string< C > &  str,
int  ,
int  = 0 
)

Definition at line 608 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [3/19]

template<typename Stream , typename K , typename T , typename Pred , typename A >
void Unserialize ( Stream &  is,
std::map< K, T, Pred, A > &  m,
int  nType,
int  nVersion 
)

Definition at line 841 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [4/19]

template<typename Stream , typename K , typename T >
void Unserialize ( Stream &  is,
std::pair< K, T > &  item,
int  nType,
int  nVersion 
)

Definition at line 813 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [5/19]

template<typename Stream , typename K , typename Pred , typename A >
void Unserialize ( Stream &  is,
std::set< K, Pred, A > &  m,
int  nType,
int  nVersion 
)

Definition at line 875 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [6/19]

template<typename Stream , typename T , typename A >
void Unserialize ( Stream &  is,
std::vector< T, A > &  v,
int  nType,
int  nVersion 
)
inline

Definition at line 789 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [7/19]

template<typename Stream , typename T >
void Unserialize ( Stream &  is,
T &  a,
long  nType,
int  nVersion 
)
inline

Definition at line 584 of file serialize.h.

◆ Unserialize() [8/19]

template<typename Stream >
void Unserialize ( Stream &  s,
bool &  a,
int  ,
int  = 0 
)
inline

Definition at line 232 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [9/19]

template<typename Stream >
void Unserialize ( Stream &  s,
char &  a,
int  ,
int  = 0 
)
inline

Definition at line 218 of file serialize.h.

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

◆ Unserialize() [10/19]

template<typename Stream >
void Unserialize ( Stream &  s,
double &  a,
int  ,
int  = 0 
)
inline

Definition at line 228 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [11/19]

template<typename Stream >
void Unserialize ( Stream &  s,
float &  a,
int  ,
int  = 0 
)
inline

Definition at line 227 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [12/19]

template<typename Stream >
void Unserialize ( Stream &  s,
int16_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 221 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [13/19]

template<typename Stream >
void Unserialize ( Stream &  s,
int32_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 223 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [14/19]

template<typename Stream >
void Unserialize ( Stream &  s,
int64_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 225 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [15/19]

template<typename Stream >
void Unserialize ( Stream &  s,
int8_t &  a,
int  ,
int  = 0 
)
inline
Todo:
Get rid of bare char

Definition at line 219 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [16/19]

template<typename Stream >
void Unserialize ( Stream &  s,
uint16_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 222 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [17/19]

template<typename Stream >
void Unserialize ( Stream &  s,
uint32_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 224 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [18/19]

template<typename Stream >
void Unserialize ( Stream &  s,
uint64_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 226 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize() [19/19]

template<typename Stream >
void Unserialize ( Stream &  s,
uint8_t &  a,
int  ,
int  = 0 
)
inline

Definition at line 220 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize_impl() [1/4]

template<typename Stream , unsigned int N, typename T >
void Unserialize_impl ( Stream &  is,
prevector< N, T > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

Definition at line 667 of file serialize.h.

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

◆ Unserialize_impl() [2/4]

template<typename Stream , unsigned int N, typename T , typename V >
void Unserialize_impl ( Stream &  is,
prevector< N, T > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 683 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize_impl() [3/4]

template<typename Stream , typename T , typename A >
void Unserialize_impl ( Stream &  is,
std::vector< T, A > &  v,
int  nType,
int  nVersion,
const unsigned char &   
)

Definition at line 757 of file serialize.h.

Here is the call graph for this function:

◆ Unserialize_impl() [4/4]

template<typename Stream , typename T , typename A , typename V >
void Unserialize_impl ( Stream &  is,
std::vector< T, A > &  v,
int  nType,
int  nVersion,
const V &   
)

Definition at line 772 of file serialize.h.

Here is the call graph for this function:

◆ WrapVarInt()

template<typename I >
CVarInt<I> WrapVarInt ( I &  n)

Definition at line 478 of file serialize.h.

◆ WriteCompactSize()

template<typename Stream >
void WriteCompactSize ( Stream &  os,
uint64_t  nSize 
)

Definition at line 255 of file serialize.h.

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

◆ WriteVarInt()

template<typename Stream , typename I >
void WriteVarInt ( Stream &  os,
n 
)

Definition at line 335 of file serialize.h.

Here is the call graph for this function:
GetSerializeSize
unsigned int GetSerializeSize(char a, int, int=0)
Definition: serialize.h:194
Unserialize
void Unserialize(Stream &s, char &a, int, int=0)
Definition: serialize.h:218
CSerActionSerialize
Support for ADD_SERIALIZE_METHODS and READWRITE macro.
Definition: serialize.h:891
CSerActionUnserialize
Definition: serialize.h:894
Serialize
void Serialize(Stream &s, char a, int, int=0)
Definition: serialize.h:206