BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
8 void to_variant(
const T& o, variant& v, uint32_t max_depth );
10 void from_variant(
const variant& v, T& o, uint32_t max_depth );
18 :vo(mvo),val(v),_max_depth(max_depth - 1) {
19 _FC_ASSERT( max_depth > 0,
"Recursion depth exceeded!" );
22 template<
typename Member,
class Class, Member (Class::*member)>
25 this->add(vo,name,(val.*member));
33 vo(name,
variant( *v, _max_depth ));
36 void add( mutable_variant_object& vo,
const char* name,
const M& v )
const
37 { vo(name, variant( v, _max_depth )); }
39 mutable_variant_object& vo;
41 const uint32_t _max_depth;
50 _FC_ASSERT( max_depth > 0,
"Recursion depth exceeded!" );
53 template<
typename Member,
class Class, Member (Class::*member)>
66 template<
typename T,
typename Dummy =
void>
69 struct if_enum<T,
std::enable_if_t<!std::is_enum<T>::value>>
85 struct if_enum<T,
std::enable_if_t<std::is_enum<T>::value>>
to_variant_visitor(mutable_variant_object &mvo, const T &v, uint32_t max_depth)
iterator find(const string &key) const
void operator()(const char *name) const
An order-perserving dictionary of variant's.
const uint32_t _max_depth
An order-perserving dictionary of variant's.
const std::string & get_string() const
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
Defines types and macros used to provide reflection.
static void to_variant(const T &v, fc::variant &vo, uint32_t max_depth)
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
void to_variant(const std::array< unsigned char, N > &bi, variant &v, uint32_t max_depth=1)
#define _FC_ASSERT(cond, msg)
static void to_variant(const T &o, fc::variant &v, uint32_t max_depth=1)
void operator()(const char *name) const
void from_variant(const variant &v, std::array< unsigned char, N > &bi, uint32_t max_depth=1)
variant_object & get_object()
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
static void from_variant(const fc::variant &v, T &o, uint32_t max_depth)
const variant_object & vo
static void from_variant(const fc::variant &v, T &o, uint32_t max_depth=1)
defines visit functions for T Unless this is specialized, visit() will not be defined for T.
provides stack-based nullable value similar to boost::optional
from_variant_visitor(const variant_object &_vo, T &v, uint32_t max_depth)