Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::raw Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  pack_static_variant
 
struct  unpack_static_variant
 
class  variant_packer
 

Typedefs

using shared_string = bip::basic_string< char, std::char_traits< char >, bip::allocator<char, bip::managed_mapped_file::segment_manager> >
 
template<size_t Size>
using UInt
 
template<size_t Size>
using Int
 

Functions

template<typename Stream , typename T >
void pack (Stream &s, const std::deque< T > &value)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::deque< T > &value)
 
template<typename Stream , typename T , typename A >
void pack (Stream &s, const boost::container::vector< T, A > &value)
 
template<typename Stream , typename T , typename A >
void unpack (Stream &s, boost::container::vector< T, A > &value)
 
template<typename Stream , typename A >
void pack (Stream &s, const boost::container::vector< char, A > &value)
 
template<typename Stream , typename A >
void unpack (Stream &s, boost::container::vector< char, A > &value)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const flat_set< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, flat_set< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const flat_multiset< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, flat_multiset< T, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void pack (Stream &s, const flat_map< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void unpack (Stream &s, flat_map< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void pack (Stream &s, const flat_multimap< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void unpack (Stream &s, flat_multimap< K, V, U... > &value)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const boost::container::vector< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, boost::container::vector< T, U... > &value)
 
template<typename Stream >
void unpack (Stream &s, fc::ecc::public_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::ecc::public_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::ecc::private_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::ecc::private_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::em::public_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::em::public_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::em::private_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::em::private_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::crypto::r1::public_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::crypto::r1::public_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::crypto::r1::private_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::crypto::r1::private_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::public_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::public_key &pk)
 
template<typename Stream >
void unpack (Stream &s, fc::private_key &pk)
 
template<typename Stream >
void pack (Stream &s, const fc::private_key &pk)
 
template<typename Stream , typename Storage >
void pack (Stream &s, const fc::fixed_string< Storage > &u)
 
template<typename Stream , typename Storage >
void unpack (Stream &s, fc::fixed_string< Storage > &u)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const bip::set< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, bip::set< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const bip::multiset< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, bip::multiset< T, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void pack (Stream &s, const bip::map< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void unpack (Stream &s, bip::map< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void pack (Stream &s, const bip::multimap< K, V, U... > &value)
 
template<typename Stream , typename K , typename V , typename... U>
void unpack (Stream &s, bip::multimap< K, V, U... > &value)
 
template<typename Stream , typename IntType , typename EnumType >
void pack (Stream &s, const fc::enum_type< IntType, EnumType > &tp)
 
template<typename Stream , typename IntType , typename EnumType >
void unpack (Stream &s, fc::enum_type< IntType, EnumType > &tp)
 
template<typename Stream >
void pack (Stream &s, const UInt< 256 > &n)
 
template<typename Stream >
void unpack (Stream &s, UInt< 256 > &n)
 
template<typename Stream >
void pack (Stream &s, const Int< 256 > &n)
 
template<typename Stream >
void unpack (Stream &s, Int< 256 > &n)
 
template<typename Stream , typename T >
void pack (Stream &s, const boost::multiprecision::number< T > &n)
 
template<typename Stream , typename T >
void unpack (Stream &s, boost::multiprecision::number< T > &n)
 
template<typename Stream , typename Arg0 , typename... Args>
void pack (Stream &s, const Arg0 &a0, Args... args)
 
template<typename Stream >
void pack (Stream &s, const fc::exception &e)
 
template<typename Stream >
void unpack (Stream &s, fc::exception &e)
 
template<typename Stream >
void pack (Stream &s, const fc::log_message &msg)
 
template<typename Stream >
void unpack (Stream &s, fc::log_message &msg)
 
template<typename Stream >
void pack (Stream &s, const fc::path &tp)
 
template<typename Stream >
void unpack (Stream &s, fc::path &tp)
 
template<typename Stream >
void pack (Stream &s, const fc::time_point_sec &tp)
 
template<typename Stream >
void unpack (Stream &s, fc::time_point_sec &tp)
 
template<typename Stream >
void pack (Stream &s, const fc::time_point &tp)
 
template<typename Stream >
void unpack (Stream &s, fc::time_point &tp)
 
template<typename Stream >
void pack (Stream &s, const fc::microseconds &usec)
 
template<typename Stream >
void unpack (Stream &s, fc::microseconds &usec)
 
template<typename Stream , typename T , size_t N>
auto pack (Stream &s, const fc::array< T, N > &v) -> std::enable_if_t<!is_trivial_array< T > >
 
template<typename Stream , typename T , size_t N>
auto unpack (Stream &s, fc::array< T, N > &v) -> std::enable_if_t<!is_trivial_array< T > >
 
template<typename Stream , typename T , size_t N>
void pack (Stream &s, T(&v)[N])
 
template<typename Stream , typename T , size_t N>
void unpack (Stream &s, T(&v)[N])
 
template<typename Stream , typename T >
void pack (Stream &s, const std::shared_ptr< T > &v)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::shared_ptr< T > &v)
 
template<typename Stream >
void pack (Stream &s, const signed_int &v)
 
template<typename Stream >
void pack (Stream &s, const unsigned_int &v)
 
template<typename Stream >
void unpack (Stream &s, signed_int &vi)
 
template<typename Stream >
void unpack (Stream &s, unsigned_int &vi)
 
template<typename Stream , typename T >
void unpack (Stream &s, const T &vi)
 
template<typename Stream >
void pack (Stream &s, const char *v)
 
template<typename Stream , typename T >
void pack (Stream &s, const safe< T > &v)
 
template<typename Stream , typename T >
void unpack (Stream &s, fc::safe< T > &v)
 
template<typename Stream , typename T , unsigned int S, typename Align >
void pack (Stream &s, const fc::fwd< T, S, Align > &v)
 
template<typename Stream , typename T , unsigned int S, typename Align >
void unpack (Stream &s, fc::fwd< T, S, Align > &v)
 
template<typename Stream , typename T >
void pack (Stream &s, const std::optional< T > &v)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::optional< T > &v)
 
template<typename Stream >
void pack (Stream &s, const std::vector< char > &value)
 
template<typename Stream >
void unpack (Stream &s, std::vector< char > &value)
 
template<typename Stream >
void pack (Stream &s, const fc::string &v)
 
template<typename Stream >
void unpack (Stream &s, fc::string &v)
 
template<typename Stream >
void pack (Stream &s, const shared_string &v)
 
template<typename Stream >
void unpack (Stream &s, shared_string &v)
 
template<typename Stream >
void pack (Stream &s, const bool &v)
 
template<typename Stream >
void unpack (Stream &s, bool &v)
 
template<typename Stream , typename T >
void pack (Stream &s, const std::unordered_set< T > &value)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::unordered_set< T > &value)
 
template<typename Stream , typename K , typename V >
void pack (Stream &s, const std::pair< K, V > &value)
 
template<typename Stream , typename K , typename V >
void unpack (Stream &s, std::pair< K, V > &value)
 
template<typename Stream , typename K , typename V >
void pack (Stream &s, const std::unordered_map< K, V > &value)
 
template<typename Stream , typename K , typename V >
void unpack (Stream &s, std::unordered_map< K, V > &value)
 
template<typename Stream , typename K , typename V >
void pack (Stream &s, const std::map< K, V > &value)
 
template<typename Stream , typename K , typename V >
void unpack (Stream &s, std::map< K, V > &value)
 
template<typename Stream , typename T , typename... U>
void pack (Stream &s, const boost::container::deque< T, U... > &value)
 
template<typename Stream , typename T , typename... U>
void unpack (Stream &s, boost::container::deque< T, U... > &value)
 
template<typename Stream , typename T >
void pack (Stream &s, const std::vector< T > &value)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::vector< T > &value)
 
template<typename Stream , typename T >
void pack (Stream &s, const std::list< T > &value)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::list< T > &value)
 
template<typename Stream , typename T >
void pack (Stream &s, const std::set< T > &value)
 
template<typename Stream , typename T >
void unpack (Stream &s, std::set< T > &value)
 
template<typename Stream , typename T , std::size_t S>
auto pack (Stream &s, const std::array< T, S > &value) -> std::enable_if_t< is_trivial_array< T > >
 
template<typename Stream , typename T , std::size_t S>
auto unpack (Stream &s, std::array< T, S > &value) -> std::enable_if_t< is_trivial_array< T > >
 
template<typename Stream , typename T >
void pack (Stream &s, const T &v)
 
template<typename Stream , typename T >
void unpack (Stream &s, T &v)
 
template<typename T >
size_t pack_size (const T &v)
 
template<typename T >
std::vector< char > pack (const T &v)
 
template<typename T , typename... Next>
std::vector< char > pack (const T &v, Next... next)
 
template<typename T >
T unpack (const std::vector< char > &s)
 
template<typename T >
void unpack (const std::vector< char > &s, T &tmp)
 
template<typename T >
void pack (char *d, uint32_t s, const T &v)
 
template<typename T >
T unpack (const char *d, uint32_t s)
 
template<typename T >
void unpack (const char *d, uint32_t s, T &v)
 
template<typename Stream , typename... T>
void pack (Stream &s, const std::variant< T... > &sv)
 
template<typename Stream , typename... T>
void unpack (Stream &s, std::variant< T... > &sv)
 
template<typename Stream >
void pack (Stream &s, const variant_object &v)
 
template<typename Stream >
void unpack (Stream &s, variant_object &v)
 
template<typename Stream >
void pack (Stream &s, const variant &v)
 
template<typename Stream >
void unpack (Stream &s, variant &v)
 
template<typename Stream >
void pack (Stream &s, const ip::endpoint &v)
 
template<typename Stream >
void unpack (Stream &s, ip::endpoint &v)
 
template<typename T >
void unpack_file (const fc::path &filename, T &obj)
 
template<typename Stream >
void pack (Stream &s, const ip::address &v)
 
template<typename Stream >
void unpack (Stream &s, ip::address &v)
 
template<typename Stream >
void pack (Stream &s, const real128 &value_to_pack)
 
template<typename Stream >
void unpack (Stream &s, real128 &value_to_unpack)
 
template<typename Stream >
void pack (Stream &s, const uint128 &u)
 
template<typename Stream >
void unpack (Stream &s, uint128 &u)
 

Variables

constexpr bool has_feature_reflector_init_on_unpacked_reflected_types = true
 
template<typename T >
constexpr bool is_trivial_array = std::is_scalar<T>::value == true && std::is_pointer<T>::value == false
 

Detailed Description

serializes like an IntType

Typedef Documentation

◆ Int

template<size_t Size>
using fc::raw::Int
Initial value:
boost::multiprecision::number<
boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> >

Definition at line 35 of file raw.hpp.

◆ shared_string

using fc::raw::shared_string = bip::basic_string< char, std::char_traits< char >, bip::allocator<char, bip::managed_mapped_file::segment_manager> >

Definition at line 29 of file raw.hpp.

◆ UInt

template<size_t Size>
using fc::raw::UInt
Initial value:
boost::multiprecision::number<
boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >

Definition at line 32 of file raw.hpp.

Function Documentation

◆ pack() [1/65]

template<typename T >
void fc::raw::pack ( char * d,
uint32_t s,
const T & v )
inline

Definition at line 722 of file raw.hpp.

722 {
723 datastream<char*> ds(d,s);
724 fc::raw::pack(ds,v );
725 }
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
char * s
Here is the call graph for this function:

◆ pack() [2/65]

template<typename T >
std::vector< char > fc::raw::pack ( const T & v)
inline

Definition at line 679 of file raw.hpp.

679 {
681 fc::raw::pack(ps,v );
682 std::vector<char> vec(ps.tellp());
683
684 if( vec.size() ) {
685 datastream<char*> ds( vec.data(), size_t(vec.size()) );
686 fc::raw::pack(ds,v);
687 }
688 return vec;
689 }
Here is the call graph for this function:

◆ pack() [3/65]

template<typename T , typename... Next>
std::vector< char > fc::raw::pack ( const T & v,
Next... next )
inline

Definition at line 692 of file raw.hpp.

692 {
694 fc::raw::pack(ps,v,next...);
695 std::vector<char> vec(ps.tellp());
696
697 if( vec.size() ) {
698 datastream<char*> ds( vec.data(), size_t(vec.size()) );
699 fc::raw::pack(ds,v,next...);
700 }
701 return vec;
702 }
Here is the call graph for this function:

◆ pack() [4/65]

template<typename Stream , typename Arg0 , typename... Args>
void fc::raw::pack ( Stream & s,
const Arg0 & a0,
Args... args )
inline

Definition at line 45 of file raw.hpp.

45 {
46 pack( s, a0 );
47 pack( s, args... );
48 }
Here is the call graph for this function:

◆ pack() [5/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::pack ( Stream & s,
const bip::map< K, V, U... > & value )

Definition at line 38 of file container.hpp.

38 {
39 detail::pack_map( s, value );
40 }
#define value
Definition pkcs11.h:157
Here is the call graph for this function:

◆ pack() [6/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::pack ( Stream & s,
const bip::multimap< K, V, U... > & value )

Definition at line 48 of file container.hpp.

48 {
49 detail::pack_map( s, value );
50 }
Here is the call graph for this function:

◆ pack() [7/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const bip::multiset< T, U... > & value )

Definition at line 28 of file container.hpp.

28 {
29 detail::pack_set( s, value );
30 }
Here is the call graph for this function:

◆ pack() [8/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const bip::set< T, U... > & value )

Definition at line 18 of file container.hpp.

18 {
19 detail::pack_set( s, value );
20 }
Here is the call graph for this function:

◆ pack() [9/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const bool & v )
inline

Definition at line 329 of file raw.hpp.

329{ fc::raw::pack( s, uint8_t(v) ); }
unsigned char uint8_t
Definition stdint.h:124
Here is the call graph for this function:

◆ pack() [10/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const boost::container::deque< T, U... > & value )
inline

Definition at line 550 of file raw.hpp.

550 {
552 fc::raw::pack( s, unsigned_int( (uint32_t) value.size() ) );
553 for( const auto& i : value ) {
554 fc::raw::pack( s, i );
555 }
556 }
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
unsigned int uint32_t
Definition stdint.h:126
#define MAX_NUM_ARRAY_ELEMENTS
Definition utility.hpp:18
Here is the call graph for this function:

◆ pack() [11/65]

template<typename Stream , typename A >
void fc::raw::pack ( Stream & s,
const boost::container::vector< char, A > & value )

Definition at line 43 of file flat.hpp.

43 {
45 pack( s, unsigned_int((uint32_t)value.size()) );
46 if( value.size() )
47 s.write( (const char*)value.data(), value.size() );
48 }
#define MAX_SIZE_OF_BYTE_ARRAYS
Definition utility.hpp:19
Here is the call graph for this function:

◆ pack() [12/65]

template<typename Stream , typename T , typename A >
void fc::raw::pack ( Stream & s,
const boost::container::vector< T, A > & value )

Definition at line 14 of file flat.hpp.

14 {
16 pack( s, unsigned_int((uint32_t)value.size()) );
17 if( !std::is_fundamental<T>::value ) {
18 for( const auto& item : value ) {
19 pack( s, item );
20 }
21 } else if( value.size() ) {
22 s.write( (const char*)value.data(), value.size() );
23 }
24 }
Here is the call graph for this function:

◆ pack() [13/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const boost::container::vector< T, U... > & value )

◆ pack() [14/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const boost::multiprecision::number< T > & n )

Definition at line 787 of file raw.hpp.

787 {
788 static_assert( sizeof( n ) == (std::numeric_limits<boost::multiprecision::number<T>>::digits+1)/8, "unexpected padding" );
789 s.write( (const char*)&n, sizeof(n) );
790 }

◆ pack() [15/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const char * v )
inline

Definition at line 252 of file raw.hpp.

252{ fc::raw::pack( s, fc::string(v) ); }
std::string string
Definition string.hpp:10
Here is the call graph for this function:

◆ pack() [16/65]

template<typename Stream , typename T , size_t N>
auto fc::raw::pack ( Stream & s,
const fc::array< T, N > & v ) -> std::enable_if_t<!is_trivial_array< T > >
inline

Definition at line 146 of file raw.hpp.

147 {
148 static_assert( N <= MAX_NUM_ARRAY_ELEMENTS, "number of elements in array is too large" );
149 for (uint64_t i = 0; i < N; ++i)
150 fc::raw::pack(s, v.data[i]);
151 }
T data[N]
Definition array.hpp:37
const int N
Definition quantize.cpp:54
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the call graph for this function:

◆ pack() [17/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::crypto::r1::private_key & pk )

Definition at line 214 of file elliptic_r1.hpp.

215 {
216 fc::raw::pack( s, pk.get_secret() );
217 }
private_key_secret get_secret() const
Here is the call graph for this function:

◆ pack() [18/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::crypto::r1::public_key & pk )

Definition at line 200 of file elliptic_r1.hpp.

201 {
202 fc::raw::pack( s, pk.serialize() );
203 }
public_key_data serialize() const
Here is the call graph for this function:

◆ pack() [19/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::ecc::private_key & pk )

Definition at line 225 of file elliptic.hpp.

226 {
227 fc::raw::pack( s, pk.get_secret() );
228 }
private_key_secret get_secret() const
Here is the call graph for this function:

◆ pack() [20/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::ecc::public_key & pk )

Definition at line 211 of file elliptic.hpp.

212 {
213 fc::raw::pack( s, pk.serialize() );
214 }
public_key_data serialize() const
Here is the call graph for this function:

◆ pack() [21/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::em::private_key & pk )

Definition at line 252 of file elliptic_em.hpp.

253 {
254 fc::raw::pack( s, pk.get_secret() );
255 }
private_key_secret get_secret() const
Here is the call graph for this function:

◆ pack() [22/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::em::public_key & pk )

Definition at line 238 of file elliptic_em.hpp.

239 {
240 fc::raw::pack( s, pk.serialize() );
241 }
public_key_data serialize() const
Here is the call graph for this function:

◆ pack() [23/65]

template<typename Stream , typename IntType , typename EnumType >
void fc::raw::pack ( Stream & s,
const fc::enum_type< IntType, EnumType > & tp )
inline

Definition at line 66 of file enum_type.hpp.

67 {
68 fc::raw::pack( s, static_cast<IntType>(tp) );
69 }
Here is the call graph for this function:

◆ pack() [24/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::exception & e )
inline

Definition at line 51 of file raw.hpp.

52 {
53 fc::raw::pack( s, e.code() );
54 fc::raw::pack( s, std::string(e.name()) );
55 fc::raw::pack( s, std::string(e.what()) );
56 fc::raw::pack( s, e.get_log() );
57 }
const log_messages & get_log() const
int64_t code() const
const char * name() const
const char * what() const noexcept override
Here is the call graph for this function:

◆ pack() [25/65]

template<typename Stream , typename Storage >
void fc::raw::pack ( Stream & s,
const fc::fixed_string< Storage > & u )
inline

Definition at line 111 of file fixed_string.hpp.

111 {
112 unsigned_int size = u.size();
113 pack( s, size );
114 s.write( (const char*)&u.data, size );
115 }
uint32_t size() const
Here is the call graph for this function:

◆ pack() [26/65]

template<typename Stream , typename T , unsigned int S, typename Align >
void fc::raw::pack ( Stream & s,
const fc::fwd< T, S, Align > & v )

Definition at line 261 of file raw.hpp.

261 {
262 fc::raw::pack( *v );
263 }
Here is the call graph for this function:

◆ pack() [27/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::log_message & msg )
inline

Definition at line 74 of file raw.hpp.

75 {
76 fc::raw::pack( s, variant(msg) );
77 }
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
Here is the call graph for this function:

◆ pack() [28/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::microseconds & usec )
inline

Definition at line 131 of file raw.hpp.

132 {
133 uint64_t usec_as_int64 = usec.count();
134 s.write( (const char*)&usec_as_int64, sizeof(usec_as_int64) );
135 }
constexpr int64_t count() const
Definition time.hpp:26
Here is the call graph for this function:

◆ pack() [29/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::path & tp )
inline

Definition at line 87 of file raw.hpp.

88 {
90 }
std::string generic_string() const
Here is the call graph for this function:

◆ pack() [30/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::private_key & pk )

Definition at line 101 of file pke.hpp.

102 {
103 fc::raw::pack( s, pk.serialize() );
104 }
bytes serialize() const
Definition pke.cpp:294
Here is the call graph for this function:

◆ pack() [31/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::public_key & pk )

Definition at line 87 of file pke.hpp.

88 {
89 fc::raw::pack( s, pk.serialize() );
90 }
bytes serialize() const
Definition pke.cpp:132
Here is the call graph for this function:

◆ pack() [32/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::string & v )
inline

Definition at line 300 of file raw.hpp.

300 {
301 FC_ASSERT( v.size() <= MAX_SIZE_OF_BYTE_ARRAYS );
302 fc::raw::pack( s, unsigned_int((uint32_t)v.size()));
303 if( v.size() ) s.write( v.c_str(), v.size() );
304 }
Here is the call graph for this function:

◆ pack() [33/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::time_point & tp )
inline

Definition at line 116 of file raw.hpp.

117 {
118 uint64_t usec = tp.time_since_epoch().count();
119 s.write( (const char*)&usec, sizeof(usec) );
120 }
constexpr const microseconds & time_since_epoch() const
Definition time.hpp:52
Here is the call graph for this function:

◆ pack() [34/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const fc::time_point_sec & tp )
inline

Definition at line 101 of file raw.hpp.

102 {
103 uint32_t usec = tp.sec_since_epoch();
104 s.write( (const char*)&usec, sizeof(usec) );
105 }
constexpr uint32_t sec_since_epoch() const
Definition time.hpp:88
Here is the call graph for this function:

◆ pack() [35/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::pack ( Stream & s,
const flat_map< K, V, U... > & value )

Definition at line 82 of file flat.hpp.

82 {
83 detail::pack_map( s, value );
84 }
Here is the call graph for this function:

◆ pack() [36/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::pack ( Stream & s,
const flat_multimap< K, V, U... > & value )

Definition at line 92 of file flat.hpp.

92 {
93 detail::pack_map( s, value );
94 }
Here is the call graph for this function:

◆ pack() [37/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const flat_multiset< T, U... > & value )

Definition at line 72 of file flat.hpp.

72 {
73 detail::pack_set( s, value );
74 }
Here is the call graph for this function:

◆ pack() [38/65]

template<typename Stream , typename T , typename... U>
void fc::raw::pack ( Stream & s,
const flat_set< T, U... > & value )

Definition at line 62 of file flat.hpp.

62 {
63 detail::pack_set( s, value );
64 }
Here is the call graph for this function:

◆ pack() [39/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const Int< 256 > & n )

◆ pack() [40/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const ip::address & v )
inline

Definition at line 86 of file ip.hpp.

87 {
89 }
Here is the call graph for this function:

◆ pack() [41/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const ip::endpoint & v )
inline

Definition at line 99 of file ip.hpp.

100 {
102 fc::raw::pack( s, v.port() );
103 }
const address & get_address() const
Definition ip.cpp:72
uint16_t port() const
Definition ip.cpp:71
Here is the call graph for this function:

◆ pack() [42/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const real128 & value_to_pack )
inline

Definition at line 45 of file real128.hpp.

45{ s.write( (char*)&value_to_pack, sizeof(value_to_pack) ); }

◆ pack() [43/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const safe< T > & v )

Definition at line 255 of file raw.hpp.

255{ fc::raw::pack( s, v.value ); }
T value
Definition safe.hpp:23
Here is the call graph for this function:

◆ pack() [44/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const shared_string & v )
inline

Definition at line 314 of file raw.hpp.

314 {
315 FC_ASSERT( v.size() <= MAX_SIZE_OF_BYTE_ARRAYS );
316 fc::raw::pack( s, unsigned_int((uint32_t)v.size()));
317 if( v.size() ) s.write( v.c_str(), v.size() );
318 }
Here is the call graph for this function:

◆ pack() [45/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const signed_int & v )
inline

Definition at line 205 of file raw.hpp.

205 {
206 uint32_t val = (v.value<<1) ^ (v.value>>31); //apply zigzag encoding
207 do {
208 uint8_t b = uint8_t(val) & 0x7f;
209 val >>= 7;
210 b |= ((val > 0) << 7);
211 s.write((char*)&b,1);//.put(b);
212 } while( val );
213 }
int32_t value
Definition varint.hpp:49

◆ pack() [46/65]

template<typename Stream , typename T , std::size_t S>
auto fc::raw::pack ( Stream & s,
const std::array< T, S > & value ) -> std::enable_if_t< is_trivial_array< T > >
inline

Definition at line 633 of file raw.hpp.

634 {
635 s.write((const char*)value.data(), S * sizeof(T));
636 }
#define T(meth, val, expected)

◆ pack() [47/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::deque< T > & value )
inline

Definition at line 531 of file raw.hpp.

531 {
534 for( const auto& i : value ) {
535 fc::raw::pack( s, i );
536 }
537 }
Here is the call graph for this function:

◆ pack() [48/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::list< T > & value )
inline

Definition at line 589 of file raw.hpp.

589 {
592 for( const auto& i : value ) {
593 fc::raw::pack( s, i );
594 }
595 }
Here is the call graph for this function:

◆ pack() [49/65]

template<typename Stream , typename K , typename V >
void fc::raw::pack ( Stream & s,
const std::map< K, V > & value )
inline

Definition at line 506 of file raw.hpp.

506 {
509 auto itr = value.begin();
510 auto end = value.end();
511 while( itr != end ) {
512 fc::raw::pack( s, *itr );
513 ++itr;
514 }
515 }
Here is the call graph for this function:

◆ pack() [50/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::optional< T > & v )

Definition at line 272 of file raw.hpp.

272 {
273 fc::raw::pack( s, v.has_value() );
274 if( v ) fc::raw::pack( s, *v );
275 }
Here is the call graph for this function:

◆ pack() [51/65]

template<typename Stream , typename K , typename V >
void fc::raw::pack ( Stream & s,
const std::pair< K, V > & value )
inline

Definition at line 469 of file raw.hpp.

469 {
470 fc::raw::pack( s, value.first );
471 fc::raw::pack( s, value.second );
472 }
Here is the call graph for this function:

◆ pack() [52/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::set< T > & value )
inline

Definition at line 609 of file raw.hpp.

609 {
612 auto itr = value.begin();
613 auto end = value.end();
614 while( itr != end ) {
615 fc::raw::pack( s, *itr );
616 ++itr;
617 }
618 }
Here is the call graph for this function:

◆ pack() [53/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::shared_ptr< T > & v )
inline

Definition at line 192 of file raw.hpp.

193 {
194 fc::raw::pack( s, bool(!!v) );
195 if( !!v ) fc::raw::pack( s, *v );
196 }
Here is the call graph for this function:

◆ pack() [54/65]

template<typename Stream , typename K , typename V >
void fc::raw::pack ( Stream & s,
const std::unordered_map< K, V > & value )
inline

Definition at line 481 of file raw.hpp.

481 {
484 auto itr = value.begin();
485 auto end = value.end();
486 while( itr != end ) {
487 fc::raw::pack( s, *itr );
488 ++itr;
489 }
490 }
Here is the call graph for this function:

◆ pack() [55/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::unordered_set< T > & value )
inline

Definition at line 443 of file raw.hpp.

443 {
446 auto itr = value.begin();
447 auto end = value.end();
448 while( itr != end ) {
449 fc::raw::pack( s, *itr );
450 ++itr;
451 }
452 }
Here is the call graph for this function:

◆ pack() [56/65]

template<typename Stream , typename... T>
void fc::raw::pack ( Stream & s,
const std::variant< T... > & sv )

Definition at line 771 of file raw.hpp.

772 {
773 fc::raw::pack( s, unsigned_int(sv.index()) );
774 std::visit( pack_static_variant<Stream>(s), sv );
775 }
Here is the call graph for this function:

◆ pack() [57/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const std::vector< char > & value )
inline

Definition at line 285 of file raw.hpp.

285 {
288 if( value.size() )
289 s.write( &value.front(), (uint32_t)value.size() );
290 }
Here is the call graph for this function:

◆ pack() [58/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const std::vector< T > & value )
inline

Definition at line 570 of file raw.hpp.

570 {
573 for( const auto& i : value ) {
574 fc::raw::pack( s, i );
575 }
576 }
Here is the call graph for this function:

◆ pack() [59/65]

template<typename Stream , typename T >
void fc::raw::pack ( Stream & s,
const T & v )
inline

Definition at line 661 of file raw.hpp.

Here is the call graph for this function:

◆ pack() [60/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const uint128 & u )
inline

Definition at line 136 of file uint128.hpp.

136{ s.write( (char*)&u, sizeof(u) ); }

◆ pack() [61/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const UInt< 256 > & n )

Definition at line 796 of file raw.hpp.

796 {
797 pack( s, static_cast<UInt<128>>(n) );
798 pack( s, static_cast<UInt<128>>(n >> 128) );
799 }
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< Size, Size, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > UInt
Definition raw.hpp:32
Here is the call graph for this function:

◆ pack() [62/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const unsigned_int & v )
inline

Definition at line 215 of file raw.hpp.

215 {
216 uint64_t val = v.value;
217 do {
218 uint8_t b = uint8_t(val) & 0x7f;
219 val >>= 7;
220 b |= ((val > 0) << 7);
221 s.write((char*)&b,1);//.put(b);
222 }while( val );
223 }
uint32_t value
Definition varint.hpp:17

◆ pack() [63/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const variant & v )
inline

Definition at line 54 of file raw_variant.hpp.

55 {
56 pack( s, uint8_t(v.get_type()) );
58 }
void visit(const visitor &v) const
Definition variant.cpp:268
type_id get_type() const
Definition variant.cpp:304
Here is the call graph for this function:

◆ pack() [64/65]

template<typename Stream >
void fc::raw::pack ( Stream & s,
const variant_object & v )
inline

Definition at line 130 of file raw_variant.hpp.

131 {
132 unsigned_int vs = (uint32_t)v.size();
133 pack( s, vs );
134 for( auto itr = v.begin(); itr != v.end(); ++itr )
135 {
136 pack( s, itr->key() );
137 pack( s, itr->value() );
138 }
139 }
size_t size() const
iterator end() const
iterator begin() const
Here is the call graph for this function:

◆ pack() [65/65]

template<typename Stream , typename T , size_t N>
void fc::raw::pack ( Stream & s,
T(&) v[N] )
inline

Definition at line 176 of file raw.hpp.

176 {
178 for (uint64_t i = 0; i < N; ++i)
179 fc::raw::pack(s, v[i]);
180 }
Here is the call graph for this function:

◆ pack_size()

template<typename T >
size_t fc::raw::pack_size ( const T & v)
inline

Definition at line 671 of file raw.hpp.

672 {
674 fc::raw::pack(ps,v );
675 return ps.tellp();
676 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpack() [1/65]

template<typename T >
T fc::raw::unpack ( const char * d,
uint32_t s )
inline

Definition at line 728 of file raw.hpp.

729 { try {
730 T v;
731 datastream<const char*> ds( d, s );
732 fc::raw::unpack(ds,v);
733 return v;
734 } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }
#define FC_RETHROW_EXCEPTIONS(LOG_LEVEL, FORMAT,...)
Catchs all exception's, std::exceptions, and ... and rethrows them after appending the provided log m...
void unpack(Stream &s, std::deque< T > &value)
Definition raw.hpp:540
Here is the call graph for this function:

◆ unpack() [2/65]

template<typename T >
void fc::raw::unpack ( const char * d,
uint32_t s,
T & v )
inline

Definition at line 737 of file raw.hpp.

738 { try {
739 datastream<const char*> ds( d, s );
740 fc::raw::unpack(ds,v);
741 } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }
Here is the call graph for this function:

◆ unpack() [3/65]

template<typename T >
T fc::raw::unpack ( const std::vector< char > & s)
inline

Definition at line 706 of file raw.hpp.

707 { try {
708 T tmp;
709 datastream<const char*> ds( s.data(), size_t(s.size()) );
710 fc::raw::unpack(ds,tmp);
711 return tmp;
712 } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }
Here is the call graph for this function:

◆ unpack() [4/65]

template<typename T >
void fc::raw::unpack ( const std::vector< char > & s,
T & tmp )
inline

Definition at line 715 of file raw.hpp.

716 { try {
717 datastream<const char*> ds( s.data(), size_t(s.size()) );
718 fc::raw::unpack(ds,tmp);
719 } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }
Here is the call graph for this function:

◆ unpack() [5/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::unpack ( Stream & s,
bip::map< K, V, U... > & value )

Definition at line 43 of file container.hpp.

43 {
44 detail::unpack_map( s, value );
45 }
Here is the call graph for this function:

◆ unpack() [6/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::unpack ( Stream & s,
bip::multimap< K, V, U... > & value )

Definition at line 53 of file container.hpp.

53 {
54 detail::unpack_map( s, value );
55 }
Here is the call graph for this function:

◆ unpack() [7/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
bip::multiset< T, U... > & value )

Definition at line 33 of file container.hpp.

33 {
34 detail::unpack_set( s, value );
35 }
Here is the call graph for this function:

◆ unpack() [8/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
bip::set< T, U... > & value )

Definition at line 23 of file container.hpp.

23 {
24 detail::unpack_set( s, value );
25 }
Here is the call graph for this function:

◆ unpack() [9/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
bool & v )
inline

Definition at line 330 of file raw.hpp.

331 {
332 uint8_t b;
333 fc::raw::unpack( s, b );
334 FC_ASSERT( (b & ~1) == 0 );
335 v=(b!=0);
336 }
Here is the call graph for this function:

◆ unpack() [10/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
boost::container::deque< T, U... > & value )
inline

Definition at line 559 of file raw.hpp.

559 {
560 unsigned_int size;
561 fc::raw::unpack( s, size );
563 value.resize( size.value );
564 for( auto& i : value ) {
565 fc::raw::unpack( s, i );
566 }
567 }
Here is the call graph for this function:

◆ unpack() [11/65]

template<typename Stream , typename A >
void fc::raw::unpack ( Stream & s,
boost::container::vector< char, A > & value )

Definition at line 51 of file flat.hpp.

51 {
52 unsigned_int size;
53 unpack( s, size );
55 value.clear();
56 value.resize( size.value );
57 if( value.size() )
58 s.read( (char*)value.data(), value.size() );
59 }
Here is the call graph for this function:

◆ unpack() [12/65]

template<typename Stream , typename T , typename A >
void fc::raw::unpack ( Stream & s,
boost::container::vector< T, A > & value )

Definition at line 27 of file flat.hpp.

27 {
28 unsigned_int size;
29 unpack( s, size );
31 value.clear();
32 value.resize( size.value );
33 if( !std::is_fundamental<T>::value ) {
34 for( auto& item : value ) {
35 unpack( s, item );
36 }
37 } else if( value.size() ) {
38 s.read( (char*)value.data(), value.size() );
39 }
40 }
Here is the call graph for this function:

◆ unpack() [13/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
boost::container::vector< T, U... > & value )

◆ unpack() [14/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
boost::multiprecision::number< T > & n )

Definition at line 791 of file raw.hpp.

791 {
792 static_assert( sizeof( n ) == (std::numeric_limits<boost::multiprecision::number<T>>::digits+1)/8, "unexpected padding" );
793 s.read( (char*)&n, sizeof(n) );
794 }

◆ unpack() [15/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
const T & vi )
inline

Definition at line 245 of file raw.hpp.

246 {
247 T tmp;
248 fc::raw::unpack( s, tmp );
249 FC_ASSERT( vi == tmp );
250 }
Here is the call graph for this function:

◆ unpack() [16/65]

template<typename Stream , typename T , size_t N>
auto fc::raw::unpack ( Stream & s,
fc::array< T, N > & v ) -> std::enable_if_t<!is_trivial_array< T > >
inline

Definition at line 161 of file raw.hpp.

162 { try {
163 static_assert( N <= MAX_NUM_ARRAY_ELEMENTS, "number of elements in array is too large" );
164 for (uint64_t i = 0; i < N; ++i)
165 fc::raw::unpack(s, v.data[i]);
166 } FC_RETHROW_EXCEPTIONS( warn, "fc::array<${type},${length}>", ("type",fc::get_typename<T>::name())("length",N) ) }
Here is the call graph for this function:

◆ unpack() [17/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::crypto::r1::private_key & pk )

Definition at line 206 of file elliptic_r1.hpp.

207 {
208 fc::sha256 sec;
209 unpack( s, sec );
210 pk = crypto::r1::private_key::regenerate(sec);
211 }
Here is the call graph for this function:

◆ unpack() [18/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::crypto::r1::public_key & pk )

Definition at line 192 of file elliptic_r1.hpp.

193 {
195 fc::raw::unpack(s,ser);
196 pk = fc::crypto::r1::public_key( ser );
197 }
contains only the public point of an elliptic curve key.
Here is the call graph for this function:

◆ unpack() [19/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::ecc::private_key & pk )

Definition at line 217 of file elliptic.hpp.

218 {
219 fc::sha256 sec;
220 unpack( s, sec );
221 pk = ecc::private_key::regenerate(sec);
222 }
Here is the call graph for this function:

◆ unpack() [20/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::ecc::public_key & pk )

Definition at line 203 of file elliptic.hpp.

204 {
206 fc::raw::unpack(s,ser);
207 pk = fc::ecc::public_key( ser );
208 }
contains only the public point of an elliptic curve key.
Definition elliptic.hpp:36
Here is the call graph for this function:

◆ unpack() [21/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::em::private_key & pk )

Definition at line 244 of file elliptic_em.hpp.

245 {
246 fc::sha256 sec;
247 unpack( s, sec );
248 pk = em::private_key::regenerate(sec);
249 }
Here is the call graph for this function:

◆ unpack() [22/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::em::public_key & pk )

Definition at line 230 of file elliptic_em.hpp.

231 {
233 fc::raw::unpack(s,ser);
234 pk = fc::em::public_key( ser );
235 }
contains only the public point of an elliptic curve key.
Here is the call graph for this function:

◆ unpack() [23/65]

template<typename Stream , typename IntType , typename EnumType >
void fc::raw::unpack ( Stream & s,
fc::enum_type< IntType, EnumType > & tp )
inline

Definition at line 72 of file enum_type.hpp.

73 {
74 IntType t;
75 fc::raw::unpack( s, t );
76 tp = t;
77 }
Here is the call graph for this function:

◆ unpack() [24/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::exception & e )
inline

Definition at line 59 of file raw.hpp.

60 {
61 int64_t code;
62 std::string name, what;
63 log_messages msgs;
64
65 fc::raw::unpack( s, code );
67 fc::raw::unpack( s, what );
68 fc::raw::unpack( s, msgs );
69
70 e = fc::exception( fc::move(msgs), code, name, what );
71 }
std::string name
Used to generate a useful error report when an exception is thrown.
Definition exception.hpp:58
std::vector< log_message > log_messages
signed __int64 int64_t
Definition stdint.h:135
Here is the call graph for this function:

◆ unpack() [25/65]

template<typename Stream , typename Storage >
void fc::raw::unpack ( Stream & s,
fc::fixed_string< Storage > & u )
inline

Definition at line 118 of file fixed_string.hpp.

118 {
119 unsigned_int size;
120 fc::raw::unpack( s, size );
121 if( size.value > 0 ) {
122 if( size.value > sizeof(Storage) ) {
123 s.read( (char*)&u.data, sizeof(Storage) );
124 char buf[1024];
125 size_t left = size.value - sizeof(Storage);
126 while( left >= 1024 )
127 {
128 s.read( buf, 1024 );
129 left -= 1024;
130 }
131 s.read( buf, left );
132
133 /*
134 s.seekp( s.tellp() + (size.value - sizeof(Storage)) );
135 char tmp;
136 size.value -= sizeof(storage);
137 while( size.value ){ s.read( &tmp, 1 ); --size.value; }
138 */
139 // s.skip( size.value - sizeof(Storage) );
140 } else {
141 s.read( (char*)&u.data, size.value );
142 }
143 }
144 }
uint8_t buf[2048]
Here is the call graph for this function:

◆ unpack() [26/65]

template<typename Stream , typename T , unsigned int S, typename Align >
void fc::raw::unpack ( Stream & s,
fc::fwd< T, S, Align > & v )

Definition at line 266 of file raw.hpp.

266 {
267 fc::raw::unpack( *v );
268 }
Here is the call graph for this function:

◆ unpack() [27/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::log_message & msg )
inline

Definition at line 79 of file raw.hpp.

80 {
81 fc::variant vmsg;
82 fc::raw::unpack( s, vmsg );
83 msg = vmsg.as<log_message>();
84 }
aggregates a message along with the context and associated meta-information.
T as() const
Definition variant.hpp:327
Here is the call graph for this function:

◆ unpack() [28/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::microseconds & usec )
inline

Definition at line 138 of file raw.hpp.

139 { try {
140 uint64_t usec_as_int64;
141 s.read( (char*)&usec_as_int64, sizeof(usec_as_int64) );
142 usec = fc::microseconds(usec_as_int64);
143 } FC_RETHROW_EXCEPTIONS( warn, "" ) }

◆ unpack() [29/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::path & tp )
inline

Definition at line 93 of file raw.hpp.

94 {
95 std::string p;
97 tp = p;
98 }
const mie::Vuint & p
Definition bn.cpp:27
Here is the call graph for this function:

◆ unpack() [30/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::private_key & pk )

Definition at line 93 of file pke.hpp.

94 {
95 bytes ser;
96 fc::raw::unpack(s,ser);
97 pk = fc::private_key( ser );
98 }
std::vector< char > bytes
Definition alt_bn128.hpp:10
Here is the call graph for this function:

◆ unpack() [31/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::public_key & pk )

Definition at line 79 of file pke.hpp.

80 {
81 bytes ser;
82 fc::raw::unpack(s,ser);
83 pk = fc::public_key( ser );
84 }
Here is the call graph for this function:

◆ unpack() [32/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
fc::safe< T > & v )

Definition at line 258 of file raw.hpp.

258{ fc::raw::unpack( s, v.value ); }
Here is the call graph for this function:

◆ unpack() [33/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::string & v )
inline

Definition at line 306 of file raw.hpp.

306 {
307 std::vector<char> tmp; fc::raw::unpack(s,tmp);
308 if( tmp.size() )
309 v = fc::string(tmp.data(),tmp.data()+tmp.size());
310 else v = fc::string();
311 }
Here is the call graph for this function:

◆ unpack() [34/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::time_point & tp )
inline

Definition at line 123 of file raw.hpp.

124 { try {
125 uint64_t usec;
126 s.read( (char*)&usec, sizeof(usec) );
127 tp = fc::time_point() + fc::microseconds(usec);
128 } FC_RETHROW_EXCEPTIONS( warn, "" ) }

◆ unpack() [35/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
fc::time_point_sec & tp )
inline

Definition at line 108 of file raw.hpp.

109 { try {
110 uint32_t sec;
111 s.read( (char*)&sec, sizeof(sec) );
112 tp = fc::time_point() + fc::seconds(sec);
113 } FC_RETHROW_EXCEPTIONS( warn, "" ) }
constexpr microseconds seconds(int64_t s)
Definition time.hpp:32
Here is the call graph for this function:

◆ unpack() [36/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::unpack ( Stream & s,
flat_map< K, V, U... > & value )

Definition at line 87 of file flat.hpp.

87 {
88 detail::unpack_flat_map( s, value );
89 }
Here is the call graph for this function:

◆ unpack() [37/65]

template<typename Stream , typename K , typename V , typename... U>
void fc::raw::unpack ( Stream & s,
flat_multimap< K, V, U... > & value )

Definition at line 97 of file flat.hpp.

97 {
98 detail::unpack_flat_map( s, value );
99 }
Here is the call graph for this function:

◆ unpack() [38/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
flat_multiset< T, U... > & value )

Definition at line 77 of file flat.hpp.

77 {
78 detail::unpack_flat_set( s, value );
79 }
Here is the call graph for this function:

◆ unpack() [39/65]

template<typename Stream , typename T , typename... U>
void fc::raw::unpack ( Stream & s,
flat_set< T, U... > & value )

Definition at line 67 of file flat.hpp.

67 {
68 detail::unpack_flat_set( s, value );
69 }
Here is the call graph for this function:

◆ unpack() [40/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
Int< 256 > & n )

◆ unpack() [41/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
ip::address & v )
inline

Definition at line 91 of file ip.hpp.

92 {
93 uint32_t _ip;
94 fc::raw::unpack( s, _ip );
95 v = ip::address(_ip);
96 }
Here is the call graph for this function:

◆ unpack() [42/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
ip::endpoint & v )
inline

Definition at line 105 of file ip.hpp.

106 {
108 uint16_t p;
109 fc::raw::unpack( s, a );
110 fc::raw::unpack( s, p );
111 v = ip::endpoint(a,p);
112 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
unsigned short uint16_t
Definition stdint.h:125
Here is the call graph for this function:

◆ unpack() [43/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
real128 & value_to_unpack )
inline

Definition at line 47 of file real128.hpp.

47{ s.read( (char*)&value_to_unpack, sizeof(value_to_unpack) ); }

◆ unpack() [44/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
shared_string & v )
inline

Definition at line 320 of file raw.hpp.

320 {
321 std::vector<char> tmp; fc::raw::unpack(s,tmp);
322 FC_ASSERT(v.size() == 0);
323 if( tmp.size() ) {
324 v.append(tmp.begin(), tmp.end());
325 }
326 }
Here is the call graph for this function:

◆ unpack() [45/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
signed_int & vi )
inline

Definition at line 225 of file raw.hpp.

225 {
226 uint32_t v = 0; char b = 0; int by = 0;
227 do {
228 s.get(b);
229 v |= uint32_t(uint8_t(b) & 0x7f) << by;
230 by += 7;
231 } while( uint8_t(b) & 0x80 );
232 vi.value= (v>>1) ^ (~(v&1)+1ull); //reverse zigzag encoding
233 }

◆ unpack() [46/65]

template<typename Stream , typename T , std::size_t S>
auto fc::raw::unpack ( Stream & s,
std::array< T, S > & value ) -> std::enable_if_t< is_trivial_array< T > >
inline

Definition at line 647 of file raw.hpp.

648 {
649 s.read((char*)value.data(), S * sizeof(T));
650 }

◆ unpack() [47/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::deque< T > & value )
inline

Definition at line 540 of file raw.hpp.

540 {
541 unsigned_int size; fc::raw::unpack( s, size );
543 value.resize(size.value);
544 for( auto& i : value ) {
545 fc::raw::unpack( s, i );
546 }
547 }
Here is the call graph for this function:

◆ unpack() [48/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::list< T > & value )
inline

Definition at line 598 of file raw.hpp.

598 {
599 unsigned_int size; fc::raw::unpack( s, size );
601 while( size.value-- ) {
602 T i;
603 fc::raw::unpack( s, i );
604 value.emplace_back( std::move( i ) );
605 }
606 }
Here is the call graph for this function:

◆ unpack() [49/65]

template<typename Stream , typename K , typename V >
void fc::raw::unpack ( Stream & s,
std::map< K, V > & value )
inline

Definition at line 517 of file raw.hpp.

518 {
519 unsigned_int size; fc::raw::unpack( s, size );
521 value.clear();
522 for( uint32_t i = 0; i < size.value; ++i )
523 {
524 std::pair<K,V> tmp;
525 fc::raw::unpack( s, tmp );
526 value.insert( std::move(tmp) );
527 }
528 }
Here is the call graph for this function:

◆ unpack() [50/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::optional< T > & v )

Definition at line 278 of file raw.hpp.

279 { try {
280 bool b; fc::raw::unpack( s, b );
281 if( b ) { v = T(); fc::raw::unpack( s, *v ); }
282 } FC_RETHROW_EXCEPTIONS( warn, "optional<${type}>", ("type",fc::get_typename<T>::name() ) ) }
Here is the call graph for this function:

◆ unpack() [51/65]

template<typename Stream , typename K , typename V >
void fc::raw::unpack ( Stream & s,
std::pair< K, V > & value )
inline

Definition at line 474 of file raw.hpp.

475 {
476 fc::raw::unpack( s, value.first );
477 fc::raw::unpack( s, value.second );
478 }
Here is the call graph for this function:

◆ unpack() [52/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::set< T > & value )
inline

Definition at line 621 of file raw.hpp.

621 {
622 unsigned_int size; fc::raw::unpack( s, size );
624 for( uint64_t i = 0; i < size.value; ++i )
625 {
626 T tmp;
627 fc::raw::unpack( s, tmp );
628 value.insert( std::move(tmp) );
629 }
630 }
Here is the call graph for this function:

◆ unpack() [53/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::shared_ptr< T > & v )
inline

Definition at line 199 of file raw.hpp.

200 { try {
201 bool b; fc::raw::unpack( s, b );
202 if( b ) { v = std::make_shared<T>(); fc::raw::unpack( s, *v ); }
203 } FC_RETHROW_EXCEPTIONS( warn, "std::shared_ptr<T>", ("type",fc::get_typename<T>::name()) ) }
Here is the call graph for this function:

◆ unpack() [54/65]

template<typename Stream , typename K , typename V >
void fc::raw::unpack ( Stream & s,
std::unordered_map< K, V > & value )
inline

Definition at line 492 of file raw.hpp.

493 {
494 unsigned_int size; fc::raw::unpack( s, size );
496 value.clear();
497 value.reserve(size.value);
498 for( uint32_t i = 0; i < size.value; ++i )
499 {
500 std::pair<K,V> tmp;
501 fc::raw::unpack( s, tmp );
502 value.insert( std::move(tmp) );
503 }
504 }
Here is the call graph for this function:

◆ unpack() [55/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::unordered_set< T > & value )
inline

Definition at line 454 of file raw.hpp.

454 {
455 unsigned_int size; fc::raw::unpack( s, size );
457 value.clear();
458 value.reserve(size.value);
459 for( uint32_t i = 0; i < size.value; ++i )
460 {
461 T tmp;
462 fc::raw::unpack( s, tmp );
463 value.insert( std::move(tmp) );
464 }
465 }
Here is the call graph for this function:

◆ unpack() [56/65]

template<typename Stream , typename... T>
void fc::raw::unpack ( Stream & s,
std::variant< T... > & sv )

Definition at line 777 of file raw.hpp.

778 {
779 unsigned_int w;
780 fc::raw::unpack( s, w );
781 fc::from_index(sv, w.value);
782 std::visit( unpack_static_variant<Stream>(s), sv );
783 }
void from_index(variant &v, int index)
Here is the call graph for this function:

◆ unpack() [57/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
std::vector< char > & value )
inline

Definition at line 291 of file raw.hpp.

291 {
292 unsigned_int size; fc::raw::unpack( s, size );
294 value.resize(size.value);
295 if( value.size() )
296 s.read( value.data(), value.size() );
297 }
Here is the call graph for this function:

◆ unpack() [58/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
std::vector< T > & value )
inline

Definition at line 579 of file raw.hpp.

579 {
580 unsigned_int size; fc::raw::unpack( s, size );
582 value.resize(size.value);
583 for( auto& i : value ) {
584 fc::raw::unpack( s, i );
585 }
586 }
Here is the call graph for this function:

◆ unpack() [59/65]

template<typename Stream , typename T >
void fc::raw::unpack ( Stream & s,
T & v )
inline

Definition at line 665 of file raw.hpp.

666 { try {
668 } FC_RETHROW_EXCEPTIONS( warn, "error unpacking ${type}", ("type",fc::get_typename<T>::name() ) ) }
Here is the call graph for this function:

◆ unpack() [60/65]

template<typename Stream , typename T , size_t N>
void fc::raw::unpack ( Stream & s,
T(&) v[N] )
inline

Definition at line 183 of file raw.hpp.

184 { try {
185 unsigned_int size; fc::raw::unpack( s, size );
186 FC_ASSERT( size.value == N );
187 for (uint64_t i = 0; i < N; ++i)
188 fc::raw::unpack(s, v[i]);
189 } FC_RETHROW_EXCEPTIONS( warn, "${type} (&v)[${length}]", ("type",fc::get_typename<T>::name())("length",N) ) }
Here is the call graph for this function:

◆ unpack() [61/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
uint128 & u )
inline

Definition at line 138 of file uint128.hpp.

138{ s.read( (char*)&u, sizeof(u) ); }

◆ unpack() [62/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
UInt< 256 > & n )

Definition at line 800 of file raw.hpp.

800 {
801 UInt<128> tmp[2];
802 unpack( s, tmp[0] );
803 unpack( s, tmp[1] );
804 n = tmp[1];
805 n <<= 128;
806 n |= tmp[0];
807 }
Here is the call graph for this function:

◆ unpack() [63/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
unsigned_int & vi )
inline

Definition at line 235 of file raw.hpp.

235 {
236 uint64_t v = 0; char b = 0; uint8_t by = 0;
237 do {
238 s.get(b);
239 v |= uint32_t(uint8_t(b) & 0x7f) << by;
240 by += 7;
241 } while( uint8_t(b) & 0x80 && by < 32 );
242 vi.value = static_cast<uint32_t>(v);
243 }

◆ unpack() [64/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
variant & v )
inline

Definition at line 60 of file raw_variant.hpp.

61 {
62 uint8_t t;
63 unpack( s, t );
64 switch( t )
65 {
66 case variant::null_type:
67 return;
68 case variant::int64_type:
69 {
70 int64_t val;
71 raw::unpack(s,val);
72 v = val;
73 return;
74 }
75 case variant::uint64_type:
76 {
77 uint64_t val;
78 raw::unpack(s,val);
79 v = val;
80 return;
81 }
82 case variant::double_type:
83 {
84 double val;
85 raw::unpack(s,val);
86 v = val;
87 return;
88 }
89 case variant::bool_type:
90 {
91 bool val;
92 raw::unpack(s,val);
93 v = val;
94 return;
95 }
96 case variant::string_type:
97 {
98 fc::string val;
99 raw::unpack(s,val);
100 v = fc::move(val);
101 return;
102 }
103 case variant::array_type:
104 {
105 variants val;
106 raw::unpack(s,val);
107 v = fc::move(val);
108 return;
109 }
110 case variant::object_type:
111 {
112 variant_object val;
113 raw::unpack(s,val);
114 v = fc::move(val);
115 return;
116 }
117 case variant::blob_type:
118 {
119 blob val;
120 raw::unpack(s,val);
121 v = fc::move(val);
122 return;
123 }
124 default:
125 FC_THROW_EXCEPTION( parse_error_exception, "Unknown Variant Type ${t}", ("t", t) );
126 }
127 }
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
std::vector< fc::variant > variants
Definition variant.hpp:173
Here is the call graph for this function:

◆ unpack() [65/65]

template<typename Stream >
void fc::raw::unpack ( Stream & s,
variant_object & v )
inline

Definition at line 141 of file raw_variant.hpp.

142 {
143 unsigned_int vs;
144 unpack( s, vs );
145
147 mvo.reserve(vs.value);
148 for( uint32_t i = 0; i < vs.value; ++i )
149 {
152 fc::raw::unpack(s,key);
154 mvo.set( fc::move(key), fc::move(value) );
155 }
156 v = fc::move(mvo);
157 }
An order-preserving dictionary of variants.
mutable_variant_object & set(string key, variant var) &
uint8_t key[16]
Definition yubico_otp.c:41
Here is the call graph for this function:

◆ unpack_file()

template<typename T >
void fc::raw::unpack_file ( const fc::path & filename,
T & obj )

Definition at line 12 of file raw_unpack_file.hpp.

13 {
14 try {
15 fc::file_mapping fmap( filename.generic_string().c_str(), fc::read_only);
16 fc::mapped_region mapr( fmap, fc::read_only, 0, fc::file_size(filename) );
17 auto cs = (const char*)mapr.get_address();
18
19 fc::datastream<const char*> ds( cs, mapr.get_size() );
20 fc::raw::unpack(ds,obj);
21 } FC_RETHROW_EXCEPTIONS( info, "unpacking file ${file}", ("file",filename) );
22 }
@ read_only
uint64_t file_size(const path &p)
Here is the call graph for this function:

Variable Documentation

◆ has_feature_reflector_init_on_unpacked_reflected_types

bool fc::raw::has_feature_reflector_init_on_unpacked_reflected_types = true
constexpr

Definition at line 440 of file raw.hpp.

◆ is_trivial_array

template<typename T >
bool fc::raw::is_trivial_array = std::is_scalar<T>::value == true && std::is_pointer<T>::value == false
constexpr

Definition at line 30 of file raw_fwd.hpp.