2 #include <boost/endian/buffers.hpp>
15 #include <unordered_set>
16 #include <unordered_map>
19 #define MAX_ARRAY_ALLOC_SIZE (1024*1024*10)
34 template<
typename IntType,
typename EnumType>
class enum_type;
37 namespace ecc {
class public_key;
class private_key; }
43 template<
typename Stream,
typename IntType,
typename EnumType>
45 template<
typename Stream,
typename IntType,
typename EnumType>
48 template<
typename Stream>
50 template<
typename Stream>
53 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::set<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
54 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::set<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
55 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::unordered_set<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
56 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::unordered_set<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
58 template<
typename Stream,
typename... T>
void pack( Stream& s,
const static_variant<T...>& sv, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
59 template<
typename Stream,
typename... T>
void unpack( Stream& s, static_variant<T...>& sv, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
64 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::deque<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
65 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::deque<T>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
67 template<
typename Stream,
typename K,
typename V>
inline void pack( Stream& s,
const std::unordered_map<K,V>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
68 template<
typename Stream,
typename K,
typename V>
inline void unpack( Stream& s, std::unordered_map<K,V>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
70 template<
typename Stream,
typename K,
typename... V>
72 template<
typename Stream,
typename K,
typename V,
typename... A>
78 template<
typename Stream,
typename K,
typename V>
inline void pack( Stream& s,
const std::pair<K,V>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
79 template<
typename Stream,
typename K,
typename V>
inline void unpack( Stream& s, std::pair<K,V>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
81 template<
typename Stream>
inline void pack( Stream& s,
const variant_object& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
82 template<
typename Stream>
inline void unpack( Stream& s, variant_object& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
83 template<
typename Stream>
inline void pack( Stream& s,
const variant& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
86 template<
typename Stream>
inline void pack( Stream& s,
const path& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
93 template<
typename Stream,
typename T>
void unpack( Stream& s,
const T& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
95 template<
typename Stream,
typename T>
void pack( Stream& s,
const safe<T>& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
99 template<
typename Stream>
void pack( Stream& s,
const time_point&, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
101 template<
typename Stream>
void pack( Stream& s,
const time_point_sec&, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
103 template<
typename Stream>
void pack( Stream& s,
const std::string&, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
118 template<
typename Stream,
typename T>
void pack( Stream& s,
const T& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
121 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::vector<T>& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
122 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::vector<T>& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
124 template<
typename Stream>
inline void pack( Stream& s,
const unsigned_int& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
125 template<
typename Stream>
inline void unpack( Stream& s, unsigned_int& vi, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
127 template<
typename Stream>
inline void pack( Stream& s,
const char* v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
128 template<
typename Stream>
inline void pack( Stream& s,
const std::vector<char>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
129 template<
typename Stream>
inline void unpack( Stream& s, std::vector<char>& value, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
130 template<
typename Stream, boost::endian::order O,
class T, std::
size_t N, boost::endian::align A>
131 inline void pack( Stream& s,
const boost::endian::endian_buffer<O,T,N,A>& v, uint32_t _max_depth );
132 template<
typename Stream, boost::endian::order O,
class T, std::
size_t N, boost::endian::align A>
133 inline void unpack( Stream& s, boost::endian::endian_buffer<O,T,N,A>& v, uint32_t _max_depth );
135 template<
typename Stream,
typename T,
size_t N>
136 inline void pack( Stream& s,
const std::array<T,N>& v, uint32_t _max_depth ) =
delete;
137 template<
typename Stream,
typename T,
size_t N>
138 inline void unpack( Stream& s, std::array<T,N>& v, uint32_t _max_depth ) =
delete;
139 template<
typename Stream,
size_t N>
141 template<
typename Stream,
size_t N>
143 template<
typename Stream,
size_t N>
144 inline void pack( Stream& s,
const std::array<unsigned char,N>& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
145 template<
typename Stream,
size_t N>
148 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::shared_ptr<T>& v,
150 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::shared_ptr<T>& v,
153 template<
typename Stream,
typename T>
inline void pack( Stream& s,
const std::shared_ptr<const T>& v,
155 template<
typename Stream,
typename T>
inline void unpack( Stream& s, std::shared_ptr<const T>& v,
158 template<
typename Stream>
inline void pack( Stream& s,
const bool& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
161 template<
typename T>
inline std::vector<char>
pack(
const T& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );
164 template<
typename T>
inline void unpack(
const char* d, uint32_t s, T& v, uint32_t _max_depth=
FC_PACK_MAX_DEPTH );