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 ));
37 { vo(name,
variant( v, _max_depth )); }
41 const uint32_t _max_depth;
49 :vo(_vo),val(v),_max_depth(max_depth - 1) {
50 _FC_ASSERT( max_depth > 0,
"Recursion depth exceeded!" );
53 template<
typename Member,
class Class, Member (Class::*member)>
56 auto itr = vo.find(name);
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>>
An order-perserving dictionary of variant's.
Defines types and macros used to provide reflection.
to_variant_visitor(mutable_variant_object &mvo, const T &v, uint32_t max_depth)
void from_variant(const variant &v, std::array< unsigned char, N > &bi, uint32_t max_depth=1)
provides stack-based nullable value similar to boost::optional
void to_variant(const std::array< unsigned char, N > &bi, variant &v, uint32_t max_depth=1)
variant_object & get_object()
static void to_variant(const T &v, fc::variant &vo, uint32_t max_depth)
static void to_variant(const T &o, fc::variant &v, uint32_t max_depth=1)
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
defines visit functions for T Unless this is specialized, visit() will not be defined for T...
static void from_variant(const fc::variant &v, T &o, uint32_t max_depth=1)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
void operator()(const char *name) const
static void from_variant(const fc::variant &v, T &o, uint32_t max_depth)
const variant_object & vo
void operator()(const char *name) const
#define _FC_ASSERT(cond, msg)
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
const std::string & get_string() const
const uint32_t _max_depth
from_variant_visitor(const variant_object &_vo, T &v, uint32_t max_depth)
An order-perserving dictionary of variant's.