Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
raw_fwd.hpp
Go to the documentation of this file.
1#pragma once
4#include <fc/io/varint.hpp>
5#include <fc/array.hpp>
6#include <fc/safe.hpp>
7#include <deque>
8#include <vector>
9#include <string>
10#include <unordered_set>
11#include <unordered_map>
12#include <set>
13#include <variant>
14
15namespace fc {
16 class time_point;
17 class time_point_sec;
18 class variant;
19 class variant_object;
20 class path;
21
22 template<typename IntType, typename EnumType> class enum_type;
23 namespace ip { class endpoint; }
24
25 namespace ecc { class public_key; class private_key; }
26 template<typename Storage> class fixed_string;
27
28 namespace raw {
29 template<typename T>
30 constexpr bool is_trivial_array = std::is_scalar<T>::value == true && std::is_pointer<T>::value == false;
31
32 template<typename T>
33 inline size_t pack_size( const T& v );
34
35 template<typename Stream, typename Storage> inline void pack( Stream& s, const fc::fixed_string<Storage>& u );
36 template<typename Stream, typename Storage> inline void unpack( Stream& s, fc::fixed_string<Storage>& u );
37
38 template<typename Stream, typename IntType, typename EnumType>
39 inline void pack( Stream& s, const fc::enum_type<IntType,EnumType>& tp );
40 template<typename Stream, typename IntType, typename EnumType>
42
43
44
45 template<typename Stream, typename T> inline void pack( Stream& s, const std::set<T>& value );
46 template<typename Stream, typename T> inline void unpack( Stream& s, std::set<T>& value );
47 template<typename Stream, typename T> inline void pack( Stream& s, const std::unordered_set<T>& value );
48 template<typename Stream, typename T> inline void unpack( Stream& s, std::unordered_set<T>& value );
49
50 template<typename Stream, typename... T> void pack( Stream& s, const std::variant<T...>& sv );
51 template<typename Stream, typename... T> void unpack( Stream& s, std::variant<T...>& sv );
52
53 template<typename Stream, typename T> inline void pack( Stream& s, const std::deque<T>& value );
54 template<typename Stream, typename T> inline void unpack( Stream& s, std::deque<T>& value );
55
56 template<typename Stream, typename T, typename... U>
57 inline void pack( Stream& s, const boost::container::deque<T, U...>& value );
58 template<typename Stream, typename T, typename... U>
59 inline void unpack( Stream& s, boost::container::deque<T, U...>& value );
60
61 template<typename Stream, typename K, typename V> inline void pack( Stream& s, const std::unordered_map<K,V>& value );
62 template<typename Stream, typename K, typename V> inline void unpack( Stream& s, std::unordered_map<K,V>& value );
63
64 template<typename Stream, typename K, typename V> inline void pack( Stream& s, const std::map<K,V>& value );
65 template<typename Stream, typename K, typename V> inline void unpack( Stream& s, std::map<K,V>& value );
66
67 template<typename Stream, typename K, typename V> inline void pack( Stream& s, const std::pair<K,V>& value );
68 template<typename Stream, typename K, typename V> inline void unpack( Stream& s, std::pair<K,V>& value );
69
70 template<typename Stream, typename T, std::size_t S> inline auto pack( Stream& s, const std::array<T,S>& value ) -> std::enable_if_t<is_trivial_array<T>>;
71 template<typename Stream, typename T, std::size_t S> inline auto pack( Stream& s, const std::array<T,S>& value ) -> std::enable_if_t<!is_trivial_array<T>>;
72 template<typename Stream, typename T, std::size_t S> inline auto unpack( Stream& s, std::array<T,S>& value ) -> std::enable_if_t<is_trivial_array<T>>;
73 template<typename Stream, typename T, std::size_t S> inline auto unpack( Stream& s, std::array<T,S>& value ) -> std::enable_if_t<!is_trivial_array<T>>;
74
75 template<typename Stream> inline void pack( Stream& s, const variant_object& v );
76 template<typename Stream> inline void unpack( Stream& s, variant_object& v );
77 template<typename Stream> inline void pack( Stream& s, const variant& v );
78 template<typename Stream> inline void unpack( Stream& s, variant& v );
79
80 template<typename Stream> inline void pack( Stream& s, const path& v );
81 template<typename Stream> inline void unpack( Stream& s, path& v );
82 template<typename Stream> inline void pack( Stream& s, const ip::endpoint& v );
83 template<typename Stream> inline void unpack( Stream& s, ip::endpoint& v );
84
85
86 template<typename Stream, typename T> void unpack( Stream& s, std::optional<T>& v );
87 template<typename Stream, typename T> void unpack( Stream& s, const T& v );
88 template<typename Stream, typename T> void pack( Stream& s, const std::optional<T>& v );
89 template<typename Stream, typename T> void pack( Stream& s, const safe<T>& v );
90 template<typename Stream, typename T> void unpack( Stream& s, fc::safe<T>& v );
91
92 template<typename Stream> void unpack( Stream& s, time_point& );
93 template<typename Stream> void pack( Stream& s, const time_point& );
94 template<typename Stream> void unpack( Stream& s, time_point_sec& );
95 template<typename Stream> void pack( Stream& s, const time_point_sec& );
96 template<typename Stream> void unpack( Stream& s, std::string& );
97 template<typename Stream> void pack( Stream& s, const std::string& );
98 template<typename Stream> void unpack( Stream& s, fc::ecc::public_key& );
99 template<typename Stream> void pack( Stream& s, const fc::ecc::public_key& );
100 template<typename Stream> void unpack( Stream& s, fc::ecc::private_key& );
101 template<typename Stream> void pack( Stream& s, const fc::ecc::private_key& );
102
103 template<typename Stream, typename T> inline void pack( Stream& s, const T& v );
104 template<typename Stream, typename T> inline void unpack( Stream& s, T& v );
105
106 template<typename Stream, typename T> inline void pack( Stream& s, const std::vector<T>& v );
107 template<typename Stream, typename T> inline void unpack( Stream& s, std::vector<T>& v );
108
109 template<typename Stream> inline void pack( Stream& s, const signed_int& v );
110 template<typename Stream> inline void unpack( Stream& s, signed_int& vi );
111
112 template<typename Stream> inline void pack( Stream& s, const unsigned_int& v );
113 template<typename Stream> inline void unpack( Stream& s, unsigned_int& vi );
114
115 template<typename Stream> inline void pack( Stream& s, const char* v );
116 template<typename Stream> inline void pack( Stream& s, const std::vector<char>& value );
117 template<typename Stream> inline void unpack( Stream& s, std::vector<char>& value );
118
119 template<typename Stream, typename T, std::size_t N> inline auto pack( Stream& s, const fc::array<T,N>& v) -> std::enable_if_t<is_trivial_array<T>>;
120 template<typename Stream, typename T, std::size_t N> inline auto pack( Stream& s, const fc::array<T,N>& v) -> std::enable_if_t<!is_trivial_array<T>>;
121 template<typename Stream, typename T, std::size_t N> inline auto unpack( Stream& s, fc::array<T,N>& v) -> std::enable_if_t<is_trivial_array<T>>;
122 template<typename Stream, typename T, std::size_t N> inline auto unpack( Stream& s, fc::array<T,N>& v) -> std::enable_if_t<!is_trivial_array<T>>;
123
124 template<typename Stream> inline void pack( Stream& s, const bool& v );
125 template<typename Stream> inline void unpack( Stream& s, bool& v );
126
127 template<typename T> inline std::vector<char> pack( const T& v );
128 template<typename T> inline T unpack( const std::vector<char>& s );
129 template<typename T> inline T unpack( const char* d, uint32_t s );
130 template<typename T> inline void unpack( const char* d, uint32_t s, T& v );
131} }
an elliptic curve private key.
Definition elliptic.hpp:88
contains only the public point of an elliptic curve key.
Definition elliptic.hpp:36
wraps boost::filesystem::path to provide platform independent path manipulation.
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
Concept for reading and writing characters.
void unpack(Stream &s, std::deque< T > &value)
Definition raw.hpp:540
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
constexpr bool is_trivial_array
Definition raw_fwd.hpp:30
size_t pack_size(const T &v)
Definition raw.hpp:671
namespace sysio::chain
Definition authority.cpp:3
#define value
Definition pkcs11.h:157
#define T(meth, val, expected)
unsigned int uint32_t
Definition stdint.h:126
serializes a 32 bit signed interger in as few bytes as possible
Definition varint.hpp:41
Definition dtoa.c:306
char * s