Wire Sysio Wire Sysion 1.0.0
|
#include <abi_serializer.hpp>
Public Types | |
using | yield_function_t = fc::optional_delegate<void(size_t)> |
passed recursion_depth on each invocation | |
typedef std::function< fc::variant(fc::datastream< const char * > &, bool, bool, const abi_serializer::yield_function_t &)> | unpack_function |
typedef std::function< void(const fc::variant &, fc::datastream< char * > &, bool, bool, const abi_serializer::yield_function_t &)> | pack_function |
Public Member Functions | |
abi_serializer () | |
abi_serializer (const abi_def &abi, const yield_function_t &yield) | |
abi_serializer (const abi_def &abi, const fc::microseconds &max_serialization_time) | |
void | set_abi (const abi_def &abi, const yield_function_t &yield) |
void | set_abi (const abi_def &abi, const fc::microseconds &max_serialization_time) |
std::string_view | resolve_type (const std::string_view &t) const |
bool | is_array (const std::string_view &type) const |
bool | is_optional (const std::string_view &type) const |
bool | is_type (const std::string_view &type, const yield_function_t &yield) const |
bool | is_type (const std::string_view &type, const fc::microseconds &max_serialization_time) const |
bool | is_builtin_type (const std::string_view &type) const |
bool | is_integer (const std::string_view &type) const |
int | get_integer_size (const std::string_view &type) const |
bool | is_struct (const std::string_view &type) const |
std::string_view | fundamental_type (const std::string_view &type) const |
const struct_def & | get_struct (const std::string_view &type) const |
type_name | get_action_type (name action) const |
type_name | get_table_type (name action) const |
type_name | get_action_result_type (name action_result) const |
std::optional< string > | get_error_message (uint64_t error_code) const |
fc::variant | binary_to_variant (const std::string_view &type, const bytes &binary, const yield_function_t &yield, bool short_path=false) const |
fc::variant | binary_to_variant (const std::string_view &type, const bytes &binary, const fc::microseconds &max_serialization_time, bool short_path=false) const |
fc::variant | binary_to_variant (const std::string_view &type, fc::datastream< const char * > &binary, const yield_function_t &yield, bool short_path=false) const |
fc::variant | binary_to_variant (const std::string_view &type, fc::datastream< const char * > &binary, const fc::microseconds &max_serialization_time, bool short_path=false) const |
bytes | variant_to_binary (const std::string_view &type, const fc::variant &var, const fc::microseconds &max_serialization_time, bool short_path=false) const |
bytes | variant_to_binary (const std::string_view &type, const fc::variant &var, const yield_function_t &yield, bool short_path=false) const |
void | variant_to_binary (const std::string_view &type, const fc::variant &var, fc::datastream< char * > &ds, const fc::microseconds &max_serialization_time, bool short_path=false) const |
void | variant_to_binary (const std::string_view &type, const fc::variant &var, fc::datastream< char * > &ds, const yield_function_t &yield, bool short_path=false) const |
void | add_specialized_unpack_pack (const string &name, std::pair< abi_serializer::unpack_function, abi_serializer::pack_function > unpack_pack) |
Static Public Member Functions | |
template<typename T , typename Resolver > | |
static void | to_variant (const T &o, fc::variant &vo, Resolver resolver, const yield_function_t &yield) |
namespace sysio::chain::impl | |
template<typename T , typename Resolver > | |
static void | to_variant (const T &o, fc::variant &vo, Resolver resolver, const fc::microseconds &max_serialization_time) |
template<typename T , typename Resolver > | |
static void | to_log_variant (const T &o, fc::variant &vo, Resolver resolver, const yield_function_t &yield) |
template<typename T , typename Resolver > | |
static void | from_variant (const fc::variant &v, T &o, Resolver resolver, const yield_function_t &yield) |
template<typename T , typename Resolver > | |
static void | from_variant (const fc::variant &v, T &o, Resolver resolver, const fc::microseconds &max_serialization_time) |
template<typename Vec > | |
static bool | is_empty_abi (const Vec &abi_vec) |
template<typename Vec > | |
static bool | to_abi (const Vec &abi_vec, abi_def &abi) |
static yield_function_t | create_yield_function (const fc::microseconds &max_serialization_time) |
Static Public Attributes | |
static constexpr size_t | max_recursion_depth = 32 |
Friends | |
struct | impl::abi_from_variant |
struct | impl::abi_to_variant |
struct | impl::abi_traverse_context_with_path |
Describes the binary representation message and table contents so that it can be converted to and from JSON.
Definition at line 32 of file abi_serializer.hpp.
std::function<void(const fc::variant&, fc::datastream<char*>&, bool, bool, const abi_serializer::yield_function_t&)> sysio::chain::abi_serializer::pack_function |
Definition at line 115 of file abi_serializer.hpp.
std::function<fc::variant(fc::datastream<const char*>&, bool, bool, const abi_serializer::yield_function_t&)> sysio::chain::abi_serializer::unpack_function |
Definition at line 114 of file abi_serializer.hpp.
using sysio::chain::abi_serializer::yield_function_t = fc::optional_delegate<void(size_t)> |
Definition at line 35 of file abi_serializer.hpp.
|
inline |
Definition at line 37 of file abi_serializer.hpp.
sysio::chain::abi_serializer::abi_serializer | ( | const abi_def & | abi, |
const yield_function_t & | yield ) |
Definition at line 73 of file abi_serializer.cpp.
sysio::chain::abi_serializer::abi_serializer | ( | const abi_def & | abi, |
const fc::microseconds & | max_serialization_time ) |
void sysio::chain::abi_serializer::add_specialized_unpack_pack | ( | const string & | name, |
std::pair< abi_serializer::unpack_function, abi_serializer::pack_function > | unpack_pack ) |
Definition at line 83 of file abi_serializer.cpp.
fc::variant sysio::chain::abi_serializer::binary_to_variant | ( | const std::string_view & | type, |
const bytes & | binary, | ||
const fc::microseconds & | max_serialization_time, | ||
bool | short_path = false ) const |
Definition at line 451 of file abi_serializer.cpp.
fc::variant sysio::chain::abi_serializer::binary_to_variant | ( | const std::string_view & | type, |
const bytes & | binary, | ||
const yield_function_t & | yield, | ||
bool | short_path = false ) const |
Definition at line 445 of file abi_serializer.cpp.
fc::variant sysio::chain::abi_serializer::binary_to_variant | ( | const std::string_view & | type, |
fc::datastream< const char * > & | binary, | ||
const fc::microseconds & | max_serialization_time, | ||
bool | short_path = false ) const |
Definition at line 461 of file abi_serializer.cpp.
fc::variant sysio::chain::abi_serializer::binary_to_variant | ( | const std::string_view & | type, |
fc::datastream< const char * > & | binary, | ||
const yield_function_t & | yield, | ||
bool | short_path = false ) const |
Definition at line 455 of file abi_serializer.cpp.
|
inlinestatic |
Definition at line 123 of file abi_serializer.hpp.
|
static |
Definition at line 933 of file abi_serializer.hpp.
|
static |
Definition at line 927 of file abi_serializer.hpp.
std::string_view sysio::chain::abi_serializer::fundamental_type | ( | const std::string_view & | type | ) | const |
type
Definition at line 225 of file abi_serializer.cpp.
Definition at line 615 of file abi_serializer.cpp.
Definition at line 604 of file abi_serializer.cpp.
std::optional< string > sysio::chain::abi_serializer::get_error_message | ( | uint64_t | error_code | ) | const |
Definition at line 621 of file abi_serializer.cpp.
int sysio::chain::abi_serializer::get_integer_size | ( | const std::string_view & | type | ) | const |
Definition at line 195 of file abi_serializer.cpp.
const struct_def & sysio::chain::abi_serializer::get_struct | ( | const std::string_view & | type | ) | const |
Definition at line 252 of file abi_serializer.cpp.
Definition at line 609 of file abi_serializer.cpp.
bool sysio::chain::abi_serializer::is_array | ( | const std::string_view & | type | ) | const |
Definition at line 208 of file abi_serializer.cpp.
bool sysio::chain::abi_serializer::is_builtin_type | ( | const std::string_view & | type | ) | const |
Definition at line 187 of file abi_serializer.cpp.
|
inlinestatic |
Definition at line 98 of file abi_serializer.hpp.
bool sysio::chain::abi_serializer::is_integer | ( | const std::string_view & | type | ) | const |
Definition at line 191 of file abi_serializer.cpp.
bool sysio::chain::abi_serializer::is_optional | ( | const std::string_view & | type | ) | const |
Definition at line 212 of file abi_serializer.cpp.
bool sysio::chain::abi_serializer::is_struct | ( | const std::string_view & | type | ) | const |
bool sysio::chain::abi_serializer::is_type | ( | const std::string_view & | type, |
const fc::microseconds & | max_serialization_time ) const |
Definition at line 221 of file abi_serializer.cpp.
bool sysio::chain::abi_serializer::is_type | ( | const std::string_view & | type, |
const yield_function_t & | yield ) const |
Definition at line 216 of file abi_serializer.cpp.
std::string_view sysio::chain::abi_serializer::resolve_type | ( | const std::string_view & | t | ) | const |
t
or internal string type Definition at line 314 of file abi_serializer.cpp.
void sysio::chain::abi_serializer::set_abi | ( | const abi_def & | abi, |
const fc::microseconds & | max_serialization_time ) |
void sysio::chain::abi_serializer::set_abi | ( | const abi_def & | abi, |
const yield_function_t & | yield ) |
The ABI vector may contain duplicates which would make it an invalid ABI
Definition at line 131 of file abi_serializer.cpp.
|
inlinestatic |
4 == packsize of empty Abi
Definition at line 104 of file abi_serializer.hpp.
|
static |
Definition at line 917 of file abi_serializer.hpp.
|
static |
Definition at line 912 of file abi_serializer.hpp.
|
static |
Definition at line 904 of file abi_serializer.hpp.
bytes sysio::chain::abi_serializer::variant_to_binary | ( | const std::string_view & | type, |
const fc::variant & | var, | ||
const fc::microseconds & | max_serialization_time, | ||
bool | short_path = false ) const |
Definition at line 590 of file abi_serializer.cpp.
bytes sysio::chain::abi_serializer::variant_to_binary | ( | const std::string_view & | type, |
const fc::variant & | var, | ||
const yield_function_t & | yield, | ||
bool | short_path = false ) const |
Definition at line 584 of file abi_serializer.cpp.
void sysio::chain::abi_serializer::variant_to_binary | ( | const std::string_view & | type, |
const fc::variant & | var, | ||
fc::datastream< char * > & | ds, | ||
const fc::microseconds & | max_serialization_time, | ||
bool | short_path = false ) const |
Definition at line 600 of file abi_serializer.cpp.
void sysio::chain::abi_serializer::variant_to_binary | ( | const std::string_view & | type, |
const fc::variant & | var, | ||
fc::datastream< char * > & | ds, | ||
const yield_function_t & | yield, | ||
bool | short_path = false ) const |
Definition at line 594 of file abi_serializer.cpp.
|
friend |
Definition at line 166 of file abi_serializer.hpp.
|
friend |
Definition at line 167 of file abi_serializer.hpp.
|
friend |
Definition at line 168 of file abi_serializer.hpp.
|
staticconstexpr |
Definition at line 119 of file abi_serializer.hpp.