Commit graph

43 commits

Author SHA1 Message Date
Peter Conrad
56d9e4d968 Fix for OSX build 2019-11-26 08:26:16 +01:00
Nathan Hourt
dadfe189d4 Add FC_REFLECT_DERIVED_NO_TYPENAME
This is moved to FC from graphene/protocol/types.hpp
2019-09-02 10:02:51 -05:00
Nathan Hourt
94cb1858b8 Fix constexprs, unused code 2019-08-31 12:48:52 -05:00
Nathan Hourt
c69ea32613 Improve reflection system and static_variant
Previously, fc reflection generated visitor infrastructure capable of
visiting each field of a struct; however, this is only useful for run-
time operations on structures. No compile-time information was preserved
about the fields of a struct, making compile-time introspection of types
impossible.

Now FC reflection generates rich compile-time information about the
members of structs, including types, names, and structure, allowing
code to be written to explore types in detail at compile-time and fetch
arbitrary fields at runtime without needing to iterate over the unwanted
fields.

To make this a reality, a new `typelist` type was added to store this
compile-time information. This type is also useful within the context of
`static_variant`, as SV previously used implementation detail types in a
private namespace to provide this functionality. Now `static_variant`
uses the reusable functionality of `typelist` to operate, dramatically
reducing the amount of code dedicated to `static_variant` and also
making `static_variant` types more flexible to work with since their
infrastructure is now based on the `typelist` public interface.
2019-08-30 14:21:36 -05:00
Nathan Hourt
45cb433d47 Fixes from code review 2019-08-30 11:52:05 -05:00
Nathan Hourt
9f7f1b4790 Replace improper static_variant operator overloads with comparators 2019-08-28 15:51:14 -05:00
Peter Conrad
42be69c3f7 Removed unused var 2019-08-02 17:31:28 +02:00
Peter Conrad
a11a50d4e1 Replaced true_type, false_type, is_class, is_enum with std type_traits 2019-06-06 14:41:47 +02:00
Peter Conrad
632a90709e Replace fc::array with std::array 2019-06-06 14:41:47 +02:00
Peter Conrad
579914c84d Removed unused stuff 2019-04-04 17:59:51 +02:00
Nathan Hourt
df01faa1ab Add missing typename reflection for flat_map 2019-03-29 17:36:24 -05:00
John Jones
19590fd413 Removal of smart_ref 2019-02-15 08:23:05 -05:00
Haruka Ma
bf36c189c2
Silence wrong tag warning 2018-11-07 16:41:20 +09:00
abitmore
70dbcc11e3 Added visit_local_member(...) methods to reflector 2018-09-30 10:11:28 -04:00
Peter Conrad
1dcacbafc9 Removed signed_int 2018-08-19 18:26:46 +02:00
John Jones
9ba8886c8b Change string to static 2018-08-12 19:57:43 -05:00
John Jones
e896188875 additional templates for get_typename 2018-08-10 20:40:21 -05:00
John Jones
da33edc384 additional typenames 2018-08-10 15:33:25 -05:00
Peter Conrad
1eb7b9d5c6 Added some missing checks, fixed indentation, handle different meanings of max_depth 2018-03-19 15:49:07 +01:00
Peter Conrad
a91822616e Added max_depth to remaining variant conversions 2018-03-18 10:49:44 +01:00
Peter Conrad
81c8d89341 Added max_depth parameter to variant conversions 2018-03-13 22:00:18 +01:00
cwyyprog
d157c2c756
Update typename.hpp 2017-11-14 17:11:24 +08:00
theoreticalbts
ea78d2e75d reflect.hpp: Improve reflection of enum types
- Fix implementation of FC_REFLECT_VISIT_ENUM()
- Re-enable visit() for enum
- Add typename information for enum
2016-09-23 12:21:28 -04:00
theoreticalbts
360d86da80 Fix uninitialized variable warning 2016-08-29 13:11:37 -04:00
theoreticalbts
21d62f0a96 Throw when deserializing an integer into a value not in enum 2016-08-26 16:28:36 -04:00
theoreticalbts
80b2341e77 Throw when parsing a string as enum if the string parses as integer but does not exist in enum 2016-08-26 15:29:43 -04:00
theoreticalbts
8d99ea94e6 Avoid undefined behavior in enum deserialization
atoi() has undefined behavior when given a string that can't be parsed as an integer.
This patch replaces atoi() with boost_lexical_cast() and throws an exception when we get
something that's not a number.
2016-08-26 15:01:26 -04:00
theoreticalbts
b391ecb4c7 deque: Add std::deque to serialization / reflection 2015-06-01 17:13:51 -04:00
Daniel Larimer
6c589678df adding extra reflection helpers 2015-04-29 13:17:38 -04:00
Daniel Larimer
1fb31737a7 RPC now supports remote callbacks
to_variant now skips null optional members on reflected objects.
2015-03-31 11:31:56 -04:00
Daniel Larimer
9c0f222e06 reflecting typename for arbitrary vectors 2015-03-04 11:14:15 -05:00
Nathan Hourt
72088c548b Tweak FC enum reflection
Previously when enum values not defined in the original enum type were
used in serialized objects, FC threw exceptions when it encountered
these values. Now it just serializes unknown values to and from numbers
instead of names.

As an added benefit, the compiler now warns you if a value is defined in
the enum, but not reflected!
2014-10-31 16:30:18 -04:00
Nathan Hourt
1284c5e686 Fix build wrt fc::ip::address multiple definitions 2014-06-26 10:41:20 -04:00
Daniel Larimer
4385bbe49a serialization and copy support for exceptions 2014-06-12 02:23:52 -04:00
Daniel Larimer
0a11b29984 update error reporting 2014-05-13 16:41:27 -04:00
Daniel Larimer
3a34299199 update json validation and varint hashing 2014-05-07 21:27:37 -04:00
Vikram Rajkumar
1bdc40368f Make fc::reflector<ENUM>::to_string work with C++11 strongly typed enumerations 2014-04-22 15:57:11 -04:00
Eric Frias
d27be6851b Fix serializing enums 2014-04-02 08:54:12 -04:00
dnotestein
5b103e5754 Add get_typename for std::vector<char> 2014-02-15 22:48:09 -05:00
Daniel Larimer
9410980885 various updates 2013-08-23 20:14:46 -04:00
Daniel Larimer
9173154160 enable reflecting empty structs 2013-07-23 13:00:18 -04:00
Daniel Larimer
cd28770deb Updating crypto functions. 2013-06-27 14:18:02 -04:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00