![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include <algorithm>#include <array>#include <assert.h>#include <cstring>#include <cstdint>#include <ios>#include <limits>#include <list>#include <map>#include <memory>#include <set>#include <string.h>#include <string>#include <utility>#include <vector>#include "compat/endian.h"#include "libzerocoin/Denominations.h"#include "libzerocoin/SpendType.h"#include "optional.h"#include "prevector.h"#include "span.h"#include "sporkid.h"Go to the source code of this file.
Classes | |
| struct | deserialize_type |
| Dummy data type to identify deserializing constructors. More... | |
| struct | CheckVarIntMode< Mode, I > |
| class | Wrapper< Formatter, T > |
| Simple wrapper class to serialize objects using a formatter; used by Using(). More... | |
| struct | VarIntFormatter< Mode > |
| Serialization wrapper class for integers in VarInt format. More... | |
| struct | BitSetFormatter< N > |
| class | CFixedVarIntsBitSet |
| Stores a fixed size bitset as a series of VarInts. More... | |
| class | CAutoBitSet |
| Serializes either as a or CFixedVarIntsBitSet. More... | |
| struct | CustomUintFormatter< Bytes, BigEndian > |
| Serialization wrapper class for custom integers and enums. More... | |
| struct | CompactSizeFormatter< RangeCheck > |
| Formatter for integers in CompactSize format. More... | |
| struct | LimitedStringFormatter< Limit > |
| struct | VectorFormatter< Formatter > |
| Formatter to serialize/deserialize vector elements using another formatter. More... | |
| struct | DefaultFormatter |
| Default formatter. More... | |
| struct | SerializeTuple< Stream, index, Ts > |
| tuple More... | |
| struct | SerializeTuple< Stream, 0, Ts... > |
| struct | DeserializeTuple< Stream, index, Ts > |
| struct | DeserializeTuple< Stream, 0, Ts... > |
| struct | CSerActionSerialize |
| Support for SERIALIZE_METHODS and READWRITE macro. More... | |
| struct | CSerActionUnserialize |
| class | CSizeComputer |
Macros | |
| #define | READWRITE(...) (::SerReadWriteMany(s, ser_action, __VA_ARGS__)) |
| #define | READWRITEAS(type, obj) (::SerReadWriteMany(s, ser_action, ReadWriteAsHelper<type>(obj))) |
| #define | SER_READ(obj, code) ::SerRead(s, ser_action, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; }) |
| #define | SER_WRITE(obj, code) ::SerWrite(s, ser_action, obj, [&](Stream& s, const Type& obj) { code; }) |
| #define | FORMATTER_METHODS(cls, obj) |
| Implement the Ser and Unser methods needed for implementing a formatter (see Using below). More... | |
| #define | SERIALIZE_METHODS(cls, obj) |
| Implement the Serialize and Unserialize methods by delegating to a single templated static method that takes the to-be-(de)serialized object as a parameter. More... | |
| #define | VARINT_MODE(obj, mode) Using<VarIntFormatter<mode>>(obj) |
| #define | VARINT(obj) Using<VarIntFormatter<VarIntMode::DEFAULT>>(obj) |
| #define | COMPACTSIZE(obj) Using<CompactSizeFormatter<true>>(obj) |
| #define | LIMITED_STRING(obj, n) Using<LimitedStringFormatter<n>>(obj) |
| #define | FIXEDBITSET(obj, size) Using<BitSetFormatter<size>>(obj) |
| #define | DYNBITSET(obj) Using<BitSetFormatter<0>>(obj) |
| #define | FIXEDVARINTSBITSET(obj, size) REF(CFixedVarIntsBitSet(REF(obj), (size))) |
| #define | AUTOBITSET(obj, size) REF(CAutoBitSet(REF(obj), (size))) |
Typedefs | |
| template<int Bytes> | |
| using | BigEndianFormatter = CustomUintFormatter< Bytes, true > |
Enumerations | |
| enum | { SER_NETWORK = (1 << 0) , SER_DISK = (1 << 1) , SER_GETHASH = (1 << 2) } |
| enum class | VarIntMode { DEFAULT , NONNEGATIVE_SIGNED } |
| Variable-length integers: bytes are a MSB base-128 encoding of the number. More... | |
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... | |
| char * | CharCast (char *c) |
| Safely convert odd char pointer types to standard ones. More... | |
| char * | CharCast (unsigned char *c) |
| const char * | CharCast (const char *c) |
| const char * | CharCast (const unsigned char *c) |
| 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_writedata16be (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 > | |
| uint16_t | ser_readdata16be (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) |
| template<typename X > | |
| X & | ReadWriteAsHelper (X &x) |
| Convert the reference base type to X, without changing constness or reference type. More... | |
| template<typename X > | |
| const X & | ReadWriteAsHelper (const X &x) |
| template<typename Stream > | |
| void | Serialize (Stream &s, char a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, int8_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, uint8_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, int16_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, uint16_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, int32_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, uint32_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, int64_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, uint64_t a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, float a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, double a) |
| template<typename Stream , int N> | |
| void | Serialize (Stream &s, const char(&a)[N]) |
| template<typename Stream , int N> | |
| void | Serialize (Stream &s, const unsigned char(&a)[N]) |
| template<typename Stream > | |
| void | Serialize (Stream &s, const Span< const unsigned char > &span) |
| template<typename Stream > | |
| void | Serialize (Stream &s, const Span< unsigned char > &span) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, char &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int8_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, uint8_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int16_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, uint16_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int32_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, uint32_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, int64_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, uint64_t &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, float &a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, double &a) |
| template<typename Stream , int N> | |
| void | Unserialize (Stream &s, char(&a)[N]) |
| template<typename Stream , int N> | |
| void | Unserialize (Stream &s, unsigned char(&a)[N]) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, Span< unsigned char > &span) |
| template<typename Stream > | |
| void | Serialize (Stream &s, bool a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, bool &a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, libzerocoin::CoinDenomination a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, libzerocoin::CoinDenomination &a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, libzerocoin::SpendType a) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, libzerocoin::SpendType &a) |
| template<typename Stream > | |
| void | Serialize (Stream &s, SporkId sporkID) |
| template<typename Stream > | |
| void | Unserialize (Stream &s, SporkId &sporkID) |
| 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... | |
| void | WriteCompactSize (CSizeComputer &os, uint64_t nSize) |
| template<typename Stream > | |
| void | WriteCompactSize (Stream &os, uint64_t nSize) |
| template<typename Stream > | |
| uint64_t | ReadCompactSize (Stream &is, bool range_check=true) |
| Decode a CompactSize-encoded variable-length integer. More... | |
| template<VarIntMode Mode, typename I > | |
| unsigned int | GetSizeOfVarInt (I n) |
| template<typename I > | |
| void | WriteVarInt (CSizeComputer &os, I n) |
| template<typename Stream , VarIntMode Mode, typename I > | |
| void | WriteVarInt (Stream &os, I n) |
| template<typename Stream , VarIntMode Mode, typename I > | |
| I | ReadVarInt (Stream &is) |
| template<typename Stream , typename C > | |
| void | Serialize (Stream &os, const std::basic_string< C > &str) |
| Forward declarations. More... | |
| template<typename Stream , typename C > | |
| void | Unserialize (Stream &is, std::basic_string< C > &str) |
| template<typename Stream , unsigned int N, typename T > | |
| void | Serialize_impl (Stream &os, const prevector< N, T > &v, 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<typename Stream , unsigned int N, typename T , typename V > | |
| void | Serialize_impl (Stream &os, const prevector< N, T > &v, const V &) |
| template<typename Stream , unsigned int N, typename T > | |
| void | Serialize (Stream &os, const prevector< N, T > &v) |
| template<typename Stream , unsigned int N, typename T > | |
| void | Unserialize_impl (Stream &is, prevector< N, T > &v, const unsigned char &) |
| template<typename Stream , unsigned int N, typename T , typename V > | |
| void | Unserialize_impl (Stream &is, prevector< N, T > &v, const V &) |
| template<typename Stream , unsigned int N, typename T > | |
| void | Unserialize (Stream &is, prevector< N, T > &v) |
| template<typename Stream , typename T , typename A > | |
| void | Serialize_impl (Stream &os, const std::vector< T, A > &v, 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 Stream , typename T , typename A > | |
| void | Serialize_impl (Stream &os, const std::vector< T, A > &v, const bool &) |
| template<typename Stream , typename T , typename A , typename V > | |
| void | Serialize_impl (Stream &os, const std::vector< T, A > &v, const V &) |
| template<typename Stream , typename T , typename A > | |
| void | Serialize (Stream &os, const std::vector< T, A > &v) |
| template<typename Stream , typename T , typename A > | |
| void | Unserialize_impl (Stream &is, std::vector< T, A > &v, const unsigned char &) |
| template<typename Stream , typename T , typename A , typename V > | |
| void | Unserialize_impl (Stream &is, std::vector< T, A > &v, const V &) |
| template<typename Stream , typename T , typename A > | |
| void | Unserialize (Stream &is, std::vector< T, A > &v) |
| template<typename T , std::size_t N> | |
| unsigned int | GetSerializeSize (const std::array< T, N > &item) |
| array More... | |
| template<typename Stream , typename T , std::size_t N> | |
| void | Serialize (Stream &os, const std::array< T, N > &item) |
| template<typename Stream , typename T , std::size_t N> | |
| void | Unserialize (Stream &is, std::array< T, N > &item) |
| template<typename T > | |
| unsigned int | GetSerializeSize (const Optional< T > &item) |
| optional More... | |
| template<typename Stream , typename T > | |
| void | Serialize (Stream &os, const Optional< T > &item) |
| template<typename Stream , typename T > | |
| void | Unserialize (Stream &is, Optional< T > &item) |
| template<typename Stream , typename K , typename T > | |
| void | Serialize (Stream &os, const std::pair< K, T > &item) |
| pair More... | |
| template<typename Stream , typename K , typename T > | |
| void | Unserialize (Stream &is, std::pair< K, T > &item) |
| template<typename Stream , typename... Elements> | |
| void | Serialize (Stream &os, const std::tuple< Elements... > &item) |
| tuple More... | |
| template<typename Stream , typename... Elements> | |
| void | Unserialize (Stream &is, std::tuple< Elements... > &item) |
| template<typename Stream , typename K , typename T , typename Pred , typename A > | |
| void | Serialize (Stream &os, const std::map< K, T, Pred, A > &m) |
| map More... | |
| template<typename Stream , typename K , typename T , typename Pred , typename A > | |
| void | Unserialize (Stream &is, std::map< K, T, Pred, A > &m) |
| template<typename Stream , typename K , typename Pred , typename A > | |
| void | Serialize (Stream &os, const std::set< K, Pred, A > &m) |
| set More... | |
| template<typename Stream , typename K , typename Pred , typename A > | |
| void | Unserialize (Stream &is, std::set< K, Pred, A > &m) |
| template<typename Stream , typename T > | |
| void | Serialize (Stream &os, const std::shared_ptr< const T > &p) |
| shared_ptr More... | |
| template<typename Stream , typename T > | |
| void | Unserialize (Stream &os, std::shared_ptr< const T > &p) |
| template<typename Stream , typename T > | |
| void | Serialize (Stream &os, const std::shared_ptr< T > &p) |
| template<typename Stream , typename T > | |
| void | Unserialize (Stream &os, std::shared_ptr< T > &p) |
| template<typename Stream , typename T > | |
| void | Serialize (Stream &os, const std::unique_ptr< const T > &p) |
| unique_ptr More... | |
| template<typename Stream , typename T > | |
| void | Unserialize (Stream &os, std::unique_ptr< const T > &p) |
| template<typename Stream , typename T > | |
| void | Serialize (Stream &os, const T &a) |
| If none of the specialized versions above matched, default to calling member function. More... | |
| template<typename Stream , typename T > | |
| void | Unserialize (Stream &is, T &&a) |
| template<typename T , typename A > | |
| unsigned int | GetSerializeSize (const std::list< T, A > &m) |
| list More... | |
| template<typename Stream , typename T , typename A > | |
| void | Serialize (Stream &os, const std::list< T, A > &m) |
| template<typename Stream , typename T , typename A > | |
| void | Unserialize (Stream &is, std::list< T, A > &m) |
| template<typename Stream > | |
| void | SerializeMany (Stream &s) |
| template<typename Stream , typename Arg , typename... Args> | |
| void | SerializeMany (Stream &s, const Arg &arg, const Args &... args) |
| template<typename Stream > | |
| void | UnserializeMany (Stream &s) |
| template<typename Stream , typename Arg , typename... Args> | |
| void | UnserializeMany (Stream &s, Arg &&arg, Args &&... args) |
| template<typename Stream , typename... Args> | |
| void | SerReadWriteMany (Stream &s, CSerActionSerialize ser_action, const Args &... args) |
| template<typename Stream , typename... Args> | |
| void | SerReadWriteMany (Stream &s, CSerActionUnserialize ser_action, Args &&... args) |
| template<typename Stream , typename Type , typename Fn > | |
| void | SerRead (Stream &s, CSerActionSerialize ser_action, Type &&, Fn &&) |
| template<typename Stream , typename Type , typename Fn > | |
| void | SerRead (Stream &s, CSerActionUnserialize ser_action, Type &&obj, Fn &&fn) |
| template<typename Stream , typename Type , typename Fn > | |
| void | SerWrite (Stream &s, CSerActionSerialize ser_action, Type &&obj, Fn &&fn) |
| template<typename Stream , typename Type , typename Fn > | |
| void | SerWrite (Stream &s, CSerActionUnserialize ser_action, Type &&, Fn &&) |
| template<typename T > | |
| size_t | GetSerializeSize (const T &t, int nVersion=0) |
| template<typename... T> | |
| size_t | GetSerializeSizeMany (int nVersion, const T &... t) |
Variables | |
| constexpr deserialize_type | deserialize {} |
| #define AUTOBITSET | ( | obj, | |
| size | |||
| ) | REF(CAutoBitSet(REF(obj), (size))) |
Definition at line 535 of file serialize.h.
| #define COMPACTSIZE | ( | obj | ) | Using<CompactSizeFormatter<true>>(obj) |
Definition at line 514 of file serialize.h.
| #define DYNBITSET | ( | obj | ) | Using<BitSetFormatter<0>>(obj) |
Definition at line 533 of file serialize.h.
| #define FIXEDBITSET | ( | obj, | |
| size | |||
| ) | Using<BitSetFormatter<size>>(obj) |
Definition at line 532 of file serialize.h.
| #define FIXEDVARINTSBITSET | ( | obj, | |
| size | |||
| ) | REF(CFixedVarIntsBitSet(REF(obj), (size))) |
Definition at line 534 of file serialize.h.
| #define FORMATTER_METHODS | ( | cls, | |
| obj | |||
| ) |
Implement the Ser and Unser methods needed for implementing a formatter (see Using below).
Both Ser and Unser are delegated to a single static method SerializationOps, which is polymorphic in the serialized/deserialized type (allowing it to be const when serializing, and non-const when deserializing).
Example use: struct FooFormatter { FORMATTER_METHODS(Class, obj) { READWRITE(obj.val1, VARINT(obj.val2)); } } would define a class FooFormatter that defines a serialization of Class objects consisting of serializing its val1 member using the default serialization, and its val2 member using VARINT serialization. That FooFormatter can then be used in statements like READWRITE(Using<FooFormatter>(obj.bla)).
Definition at line 204 of file serialize.h.
| #define LIMITED_STRING | ( | obj, | |
| n | |||
| ) | Using<LimitedStringFormatter<n>>(obj) |
Definition at line 515 of file serialize.h.
| #define READWRITE | ( | ... | ) | (::SerReadWriteMany(s, ser_action, __VA_ARGS__)) |
Definition at line 183 of file serialize.h.
| #define READWRITEAS | ( | type, | |
| obj | |||
| ) | (::SerReadWriteMany(s, ser_action, ReadWriteAsHelper<type>(obj))) |
Definition at line 184 of file serialize.h.
| #define SER_READ | ( | obj, | |
| code | |||
| ) | ::SerRead(s, ser_action, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; }) |
Definition at line 185 of file serialize.h.
| #define SER_WRITE | ( | obj, | |
| code | |||
| ) | ::SerWrite(s, ser_action, obj, [&](Stream& s, const Type& obj) { code; }) |
Definition at line 186 of file serialize.h.
| #define SERIALIZE_METHODS | ( | cls, | |
| obj | |||
| ) |
Implement the Serialize and Unserialize methods by delegating to a single templated static method that takes the to-be-(de)serialized object as a parameter.
This approach has the advantage that the constness of the object becomes a template parameter, and thus allows a single implementation that sees the object as const for serializing and non-const for deserializing, without casts.
Definition at line 219 of file serialize.h.
| #define VARINT | ( | obj | ) | Using<VarIntFormatter<VarIntMode::DEFAULT>>(obj) |
Definition at line 513 of file serialize.h.
| #define VARINT_MODE | ( | obj, | |
| mode | |||
| ) | Using<VarIntFormatter<mode>>(obj) |
Definition at line 512 of file serialize.h.
| using BigEndianFormatter = CustomUintFormatter<Bytes, true> |
Definition at line 701 of file serialize.h.
| anonymous enum |
| Enumerator | |
|---|---|
| SER_NETWORK | |
| SER_DISK | |
| SER_GETHASH | |
Definition at line 172 of file serialize.h.
|
strong |
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:
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] Mode for encoding VarInts.
Currently there is no support for signed encodings. The default mode will not compile with signed values, and the legacy "nonnegative signed" mode will accept signed values, but improperly encode and decode them if they are negative. In the future, the DEFAULT mode could be extended to support negative numbers in a backwards compatible way, and additional modes could be added to support different varint formats (e.g. zigzag encoding).
| Enumerator | |
|---|---|
| DEFAULT | |
| NONNEGATIVE_SIGNED | |
Definition at line 418 of file serialize.h.
|
inline |
Safely convert odd char pointer types to standard ones.
Definition at line 71 of file serialize.h.
|
inline |
Definition at line 73 of file serialize.h.
|
inline |
Definition at line 74 of file serialize.h.
|
inline |
Definition at line 72 of file serialize.h.
| unsigned int GetSerializeSize | ( | const std::array< T, N > & | item | ) |
| unsigned int GetSerializeSize | ( | const std::list< T, A > & | m | ) |
| size_t GetSerializeSize | ( | const T & | t, |
| int | nVersion = 0 |
||
| ) |
Definition at line 1441 of file serialize.h.
| size_t GetSerializeSizeMany | ( | int | nVersion, |
| const T &... | t | ||
| ) |
|
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 324 of file serialize.h.
|
inline |
Definition at line 430 of file serialize.h.
| uint64_t ReadCompactSize | ( | Stream & | is, |
| bool | range_check = true |
||
| ) |
Decode a CompactSize-encoded variable-length integer.
As these are primarily used to encode the size of vector-like serializations, by default a range check is performed. When used as a generic number encoding, range_check should be set to false.
Definition at line 359 of file serialize.h.
| I ReadVarInt | ( | Stream & | is | ) |
Definition at line 181 of file serialize.h.
Convert the reference base type to X, without changing constness or reference type.
Definition at line 180 of file serialize.h.
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 65 of file serialize.h.
|
inline |
Definition at line 134 of file serialize.h.
|
inline |
Definition at line 141 of file serialize.h.
|
inline |
Definition at line 110 of file serialize.h.
|
inline |
|
inline |
Definition at line 122 of file serialize.h.
|
inline |
Definition at line 128 of file serialize.h.
|
inline |
|
inline |
Definition at line 155 of file serialize.h.
|
inline |
Definition at line 148 of file serialize.h.
|
inline |
Definition at line 84 of file serialize.h.
|
inline |
|
inline |
Definition at line 94 of file serialize.h.
|
inline |
Definition at line 99 of file serialize.h.
|
inline |
| void Serialize | ( | Stream & | os, |
| const std::array< T, N > & | item | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::basic_string< C > & | str | ||
| ) |
Forward declarations.
string
std::string
Definition at line 979 of file serialize.h.
| void Serialize | ( | Stream & | os, |
| const std::list< T, A > & | m | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::map< K, T, Pred, A > & | m | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::pair< K, T > & | item | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::set< K, Pred, A > & | m | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::shared_ptr< const T > & | p | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::shared_ptr< T > & | p | ||
| ) |
| void Serialize | ( | Stream & | os, |
| const std::tuple< Elements... > & | item | ||
| ) |
tuple
Definition at line 1204 of file serialize.h.
| void Serialize | ( | Stream & | os, |
| const std::unique_ptr< const T > & | p | ||
| ) |
|
inline |
|
inline |
If none of the specialized versions above matched, default to calling member function.
Definition at line 949 of file serialize.h.
|
inline |
|
inline |
Definition at line 237 of file serialize.h.
|
inline |
Definition at line 248 of file serialize.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 238 of file serialize.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Serialize_impl | ( | Stream & | os, |
| const prevector< N, T > & | v, | ||
| 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 1037 of file serialize.h.
| void Serialize_impl | ( | Stream & | os, |
| const std::vector< T, A > & | v, | ||
| const bool & | |||
| ) |
| void Serialize_impl | ( | Stream & | os, |
| const std::vector< T, A > & | v, | ||
| 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 1091 of file serialize.h.
| void Serialize_impl | ( | Stream & | os, |
| const std::vector< T, A > & | v, | ||
| const V & | |||
| ) |
| void SerializeMany | ( | Stream & | s | ) |
| void SerializeMany | ( | Stream & | s, |
| const Arg & | arg, | ||
| const Args &... | args | ||
| ) |
|
inline |
Definition at line 1408 of file serialize.h.
|
inline |
Definition at line 1413 of file serialize.h.
|
inline |
|
inline |
|
inline |
Definition at line 1419 of file serialize.h.
|
inline |
Definition at line 1425 of file serialize.h.
| void Unserialize | ( | Stream & | is, |
| std::array< T, N > & | item | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::basic_string< C > & | str | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::list< T, A > & | m | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::map< K, T, Pred, A > & | m | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::pair< K, T > & | item | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::set< K, Pred, A > & | m | ||
| ) |
| void Unserialize | ( | Stream & | is, |
| std::tuple< Elements... > & | item | ||
| ) |
Definition at line 1211 of file serialize.h.
|
inline |
|
inline |
Definition at line 955 of file serialize.h.
| void Unserialize | ( | Stream & | os, |
| std::shared_ptr< const T > & | p | ||
| ) |
Definition at line 1296 of file serialize.h.
| void Unserialize | ( | Stream & | os, |
| std::shared_ptr< T > & | p | ||
| ) |
Definition at line 1308 of file serialize.h.
| void Unserialize | ( | Stream & | os, |
| std::unique_ptr< const T > & | p | ||
| ) |
Definition at line 1279 of file serialize.h.
|
inline |
|
inline |
Definition at line 253 of file serialize.h.
|
inline |
Definition at line 264 of file serialize.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 254 of file serialize.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Unserialize_impl | ( | Stream & | is, |
| prevector< N, T > & | v, | ||
| const unsigned char & | |||
| ) |
Definition at line 1058 of file serialize.h.
| void Unserialize_impl | ( | Stream & | is, |
| std::vector< T, A > & | v, | ||
| const unsigned char & | |||
| ) |
| void Unserialize_impl | ( | Stream & | is, |
| std::vector< T, A > & | v, | ||
| const V & | |||
| ) |
|
inline |
|
inline |
|
inline |
Definition at line 1435 of file serialize.h.
| void WriteCompactSize | ( | Stream & | os, |
| uint64_t | nSize | ||
| ) |
|
inline |
| void WriteVarInt | ( | Stream & | os, |
| I | n | ||
| ) |
|
constexpr |
Definition at line 57 of file serialize.h.