BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Defines types and macros used to provide reflection. More...
#include <fc/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <stdint.h>
#include <string.h>
#include <type_traits>
#include <fc/reflect/typename.hpp>
#include <fc/reflect/typelist.hpp>
Go to the source code of this file.
Namespaces | |
fc | |
fc::member_names | |
fc::impl | |
Macros | |
#define | FC_CONCAT_BASE_MEMBER_REFLECTIONS(r, derived, base) ::add_list<typelist::transform<reflector<base>::members, impl::Derivation_reflection_transformer<derived>>> |
Macro to transform reflected fields of a base class to a derived class and concatenate them to a type list. More... | |
#define | FC_CONCAT_MEMBER_REFLECTION(r, container, idx, member) |
Macro to concatenate a new field_reflection to a typelist. More... | |
#define | FC_REFLECT_MEMBER_NAME(r, container, idx, member) template<> struct member_name<container, idx> { constexpr static const char* value = BOOST_PP_STRINGIZE(member); }; |
#define | FC_REFLECT_TEMPLATE_MEMBER_NAME(r, data, idx, member) |
#define | FC_CONCAT_TYPE(r, x, TYPE) ::add<TYPE> |
Macro to concatenate a new type to a typelist. More... | |
#define | FC_REFLECT_VISIT_BASE(r, visitor, base) fc::reflector<base>::visit( visitor ); |
#define | TEMPLATE template |
#define | FC_REFLECT_VISIT_MEMBER(r, visitor, elem) |
#define | FC_REFLECT_VISIT_MEMBER_I(r, visitor, I, elem) case I: FC_REFLECT_VISIT_MEMBER( r, visitor, elem ) break; |
#define | FC_REFLECT_DERIVED_IMPL_INLINE(TYPE, INHERITS, MEMBERS) |
#define | FC_REFLECT_VISIT_ENUM(r, enum_type, elem) v.operator()(BOOST_PP_STRINGIZE(elem), int64_t(enum_type::elem) ); |
#define | FC_REFLECT_ENUM_TO_STRING(r, enum_type, elem) case enum_type::elem: return BOOST_PP_STRINGIZE(elem); |
#define | FC_REFLECT_ENUM_TO_FC_STRING(r, enum_type, elem) case enum_type::elem: return std::string(BOOST_PP_STRINGIZE(elem)); |
#define | FC_REFLECT_ENUM_FROM_STRING(r, enum_type, elem) if( strcmp( s, BOOST_PP_STRINGIZE(elem) ) == 0 ) return enum_type::elem; |
#define | FC_REFLECT_ENUM_FROM_STRING_CASE(r, enum_type, elem) case enum_type::elem: |
#define | FC_REFLECT_ENUM(ENUM, FIELDS) |
#define | FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS) |
Specializes fc::reflector for TYPE where type inherits other reflected classes. More... | |
#define | FC_REFLECT_DERIVED_TEMPLATE(TEMPLATE_ARGS, TYPE, INHERITS, MEMBERS) |
#define | FC_REFLECT_DERIVED_NO_TYPENAME(TYPE, INHERITS, MEMBERS) |
#define | FC_REFLECT(TYPE, MEMBERS) FC_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) |
Specializes fc::reflector for TYPE. More... | |
#define | FC_REFLECT_TEMPLATE(TEMPLATE_ARGS, TYPE, MEMBERS) FC_REFLECT_DERIVED_TEMPLATE( TEMPLATE_ARGS, TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) |
#define | FC_REFLECT_EMPTY(TYPE) FC_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, BOOST_PP_SEQ_NIL ) |
#define | FC_REFLECT_TYPENAME(TYPE) |
Functions | |
void | fc::throw_bad_enum_cast (int64_t i, const char *e) |
void | fc::throw_bad_enum_cast (const char *k, const char *e) |
Defines types and macros used to provide reflection.
Definition in file reflect.hpp.
#define FC_CONCAT_BASE_MEMBER_REFLECTIONS | ( | r, | |
derived, | |||
base | |||
) | ::add_list<typelist::transform<reflector<base>::members, impl::Derivation_reflection_transformer<derived>>> |
Macro to transform reflected fields of a base class to a derived class and concatenate them to a type list.
Definition at line 114 of file reflect.hpp.
#define FC_CONCAT_MEMBER_REFLECTION | ( | r, | |
container, | |||
idx, | |||
member | |||
) |
Macro to concatenate a new field_reflection
to a typelist.
Definition at line 117 of file reflect.hpp.
#define FC_CONCAT_TYPE | ( | r, | |
x, | |||
TYPE | |||
) | ::add<TYPE> |
Macro to concatenate a new type to a typelist.
Definition at line 127 of file reflect.hpp.
#define FC_REFLECT | ( | TYPE, | |
MEMBERS | |||
) | FC_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) |
Specializes fc::reflector for TYPE.
TYPE | - the type to reflect |
MEMBERS | - a sequence of member names. (field1)(field2)(field3) |
Definition at line 388 of file reflect.hpp.
#define FC_REFLECT_DERIVED | ( | TYPE, | |
INHERITS, | |||
MEMBERS | |||
) |
Specializes fc::reflector for TYPE where type inherits other reflected classes.
TYPE | - the type to reflect |
INHERITS | - a sequence of base class names (basea)(baseb)(basec) |
MEMBERS | - a sequence of member names. (field1)(field2)(field3) |
Definition at line 305 of file reflect.hpp.
#define FC_REFLECT_DERIVED_IMPL_INLINE | ( | TYPE, | |
INHERITS, | |||
MEMBERS | |||
) |
Definition at line 207 of file reflect.hpp.
#define FC_REFLECT_DERIVED_NO_TYPENAME | ( | TYPE, | |
INHERITS, | |||
MEMBERS | |||
) |
Definition at line 357 of file reflect.hpp.
#define FC_REFLECT_DERIVED_TEMPLATE | ( | TEMPLATE_ARGS, | |
TYPE, | |||
INHERITS, | |||
MEMBERS | |||
) |
Definition at line 330 of file reflect.hpp.
#define FC_REFLECT_EMPTY | ( | TYPE | ) | FC_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, BOOST_PP_SEQ_NIL ) |
Definition at line 395 of file reflect.hpp.
#define FC_REFLECT_ENUM | ( | ENUM, | |
FIELDS | |||
) |
Definition at line 229 of file reflect.hpp.
#define FC_REFLECT_ENUM_FROM_STRING | ( | r, | |
enum_type, | |||
elem | |||
) | if( strcmp( s, BOOST_PP_STRINGIZE(elem) ) == 0 ) return enum_type::elem; |
Definition at line 224 of file reflect.hpp.
#define FC_REFLECT_ENUM_FROM_STRING_CASE | ( | r, | |
enum_type, | |||
elem | |||
) | case enum_type::elem: |
Definition at line 226 of file reflect.hpp.
#define FC_REFLECT_ENUM_TO_FC_STRING | ( | r, | |
enum_type, | |||
elem | |||
) | case enum_type::elem: return std::string(BOOST_PP_STRINGIZE(elem)); |
Definition at line 221 of file reflect.hpp.
#define FC_REFLECT_ENUM_TO_STRING | ( | r, | |
enum_type, | |||
elem | |||
) | case enum_type::elem: return BOOST_PP_STRINGIZE(elem); |
Definition at line 219 of file reflect.hpp.
#define FC_REFLECT_MEMBER_NAME | ( | r, | |
container, | |||
idx, | |||
member | |||
) | template<> struct member_name<container, idx> { constexpr static const char* value = BOOST_PP_STRINGIZE(member); }; |
Definition at line 121 of file reflect.hpp.
#define FC_REFLECT_TEMPLATE | ( | TEMPLATE_ARGS, | |
TYPE, | |||
MEMBERS | |||
) | FC_REFLECT_DERIVED_TEMPLATE( TEMPLATE_ARGS, TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) |
Definition at line 392 of file reflect.hpp.
#define FC_REFLECT_TEMPLATE_MEMBER_NAME | ( | r, | |
data, | |||
idx, | |||
member | |||
) |
Definition at line 123 of file reflect.hpp.
#define FC_REFLECT_TYPENAME | ( | TYPE | ) |
Definition at line 398 of file reflect.hpp.
#define FC_REFLECT_VISIT_BASE | ( | r, | |
visitor, | |||
base | |||
) | fc::reflector<base>::visit( visitor ); |
Definition at line 186 of file reflect.hpp.
#define FC_REFLECT_VISIT_ENUM | ( | r, | |
enum_type, | |||
elem | |||
) | v.operator()(BOOST_PP_STRINGIZE(elem), int64_t(enum_type::elem) ); |
Definition at line 217 of file reflect.hpp.
#define FC_REFLECT_VISIT_MEMBER | ( | r, | |
visitor, | |||
elem | |||
) |
Definition at line 198 of file reflect.hpp.
#define FC_REFLECT_VISIT_MEMBER_I | ( | r, | |
visitor, | |||
I, | |||
elem | |||
) | case I: FC_REFLECT_VISIT_MEMBER( r, visitor, elem ) break; |
Definition at line 203 of file reflect.hpp.
#define TEMPLATE template |
Definition at line 191 of file reflect.hpp.