From 3a57465259f32f0894fe578cf2c661de3de1fba0 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Wed, 28 Aug 2019 15:46:33 -0500 Subject: [PATCH 1/5] Replace improper static_variant operator overloads with comparators --- libraries/fc | 2 +- .../include/graphene/protocol/base.hpp | 2 +- .../graphene/protocol/fee_schedule.hpp | 26 ++++++------- tests/common/database_fixture.cpp | 2 +- tests/common/database_fixture.hpp | 2 +- tests/tests/bitasset_tests.cpp | 38 +++++++++---------- tests/tests/fee_tests.cpp | 14 +++---- 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libraries/fc b/libraries/fc index 1eebd3c692..9f7f1b4790 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 1eebd3c69267d2867ba9299b5b5fe63fdc758d3f +Subproject commit 9f7f1b479067ffe75e293b8e54aa13f7bd052b0a diff --git a/libraries/protocol/include/graphene/protocol/base.hpp b/libraries/protocol/include/graphene/protocol/base.hpp index fbdf39fb06..f7cb4ef594 100644 --- a/libraries/protocol/include/graphene/protocol/base.hpp +++ b/libraries/protocol/include/graphene/protocol/base.hpp @@ -117,7 +117,7 @@ namespace graphene { namespace protocol { * @note static_variant compares only the type tag and not the * content. */ - typedef flat_set extensions_type; + using extensions_type = future_extensions::flat_set_type; ///@} diff --git a/libraries/protocol/include/graphene/protocol/fee_schedule.hpp b/libraries/protocol/include/graphene/protocol/fee_schedule.hpp index 590ae840d5..9d867819ef 100644 --- a/libraries/protocol/include/graphene/protocol/fee_schedule.hpp +++ b/libraries/protocol/include/graphene/protocol/fee_schedule.hpp @@ -30,14 +30,14 @@ namespace graphene { namespace protocol { template struct transform_to_fee_parameters> { - typedef fc::static_variant< typename T::fee_parameters_type... > type; + using type = fc::static_variant< typename T::fee_parameters_type... >; }; - typedef transform_to_fee_parameters::type fee_parameters; + using fee_parameters = transform_to_fee_parameters::type; template class fee_helper { public: - const typename Operation::fee_parameters_type& cget(const flat_set& parameters)const + const typename Operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( typename Operation::fee_parameters_type() ); FC_ASSERT( itr != parameters.end() ); @@ -48,13 +48,13 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const account_create_operation::fee_parameters_type& cget(const flat_set& parameters)const + const account_create_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( account_create_operation::fee_parameters_type() ); FC_ASSERT( itr != parameters.end() ); return itr->get(); } - typename account_create_operation::fee_parameters_type& get(flat_set& parameters)const + typename account_create_operation::fee_parameters_type& get(fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( account_create_operation::fee_parameters_type() ); FC_ASSERT( itr != parameters.end() ); @@ -65,7 +65,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const bid_collateral_operation::fee_parameters_type& cget(const flat_set& parameters)const + const bid_collateral_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( bid_collateral_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -80,7 +80,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const asset_update_issuer_operation::fee_parameters_type& cget(const flat_set& parameters)const + const asset_update_issuer_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( asset_update_issuer_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -95,7 +95,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const asset_claim_pool_operation::fee_parameters_type& cget(const flat_set& parameters)const + const asset_claim_pool_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( asset_claim_pool_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -110,7 +110,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const htlc_create_operation::fee_parameters_type& cget(const flat_set& parameters)const + const htlc_create_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( htlc_create_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -124,7 +124,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const htlc_redeem_operation::fee_parameters_type& cget(const flat_set& parameters)const + const htlc_redeem_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( htlc_redeem_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -137,7 +137,7 @@ namespace graphene { namespace protocol { template<> class fee_helper { public: - const htlc_extend_operation::fee_parameters_type& cget(const flat_set& parameters)const + const htlc_extend_operation::fee_parameters_type& cget(const fee_parameters::flat_set_type& parameters)const { auto itr = parameters.find( htlc_extend_operation::fee_parameters_type() ); if ( itr != parameters.end() ) @@ -190,7 +190,7 @@ namespace graphene { namespace protocol { return fee_helper().get(parameters); } template - const bool exists()const + bool exists()const { auto itr = parameters.find(typename Operation::fee_parameters_type()); return itr != parameters.end(); @@ -199,7 +199,7 @@ namespace graphene { namespace protocol { /** * @note must be sorted by fee_parameters.which() and have no duplicates */ - flat_set parameters; + fee_parameters::flat_set_type parameters; uint32_t scale = GRAPHENE_100_PERCENT; ///< fee * scale / GRAPHENE_100_PERCENT private: static void set_fee_parameters(fee_schedule& sched); diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index f4f88100e1..c8bf3517d9 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -798,7 +798,7 @@ void database_fixture::issue_uia( account_id_type recipient_id, asset amount ) } void database_fixture::change_fees( - const flat_set< fee_parameters >& new_params, + const fee_parameters::flat_set_type& new_params, uint32_t new_scale /* = 0 */ ) { diff --git a/tests/common/database_fixture.hpp b/tests/common/database_fixture.hpp index 136d25ea46..e626475fb0 100644 --- a/tests/common/database_fixture.hpp +++ b/tests/common/database_fixture.hpp @@ -353,7 +353,7 @@ struct database_fixture { * finish creating a block */ void enable_fees(); - void change_fees( const flat_set< fee_parameters >& new_params, uint32_t new_scale = 0 ); + void change_fees( const fee_parameters::flat_set_type& new_params, uint32_t new_scale = 0 ); void upgrade_to_lifetime_member( account_id_type account ); void upgrade_to_lifetime_member( const account_object& account ); void upgrade_to_annual_member( account_id_type account ); diff --git a/tests/tests/bitasset_tests.cpp b/tests/tests/bitasset_tests.cpp index 62bc8b943d..2c07857e76 100644 --- a/tests/tests/bitasset_tests.cpp +++ b/tests/tests/bitasset_tests.cpp @@ -648,7 +648,7 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) // this should pass BOOST_TEST_MESSAGE( "Evaluating a good operation" ); - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // test with a market issued asset BOOST_TEST_MESSAGE( "Sending a non-bitasset." ); @@ -677,25 +677,25 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) // back by self BOOST_TEST_MESSAGE( "Message should contain: op.new_options.short_backing_asset == asset_obj.get_id()" ); op.new_options.short_backing_asset = bit_usd_id; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.new_options.short_backing_asset = correct_asset_id; // prediction market with different precision BOOST_TEST_MESSAGE( "Message should contain: for a PM, asset_obj.precision != new_backing_asset.precision" ); op.asset_to_update = asset_objs.prediction; op.issuer = asset_objs.prediction(db).issuer; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.asset_to_update = bit_usd_id; op.issuer = asset_objs.bit_usd(db).issuer; // checking old backing asset instead of new backing asset BOOST_TEST_MESSAGE( "Message should contain: to be backed by an asset which is not market issued asset nor CORE" ); op.new_options.short_backing_asset = asset_objs.six_precision; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); BOOST_TEST_MESSAGE( "Message should contain: modified a blockchain-controlled market asset to be backed by an asset " "which is not backed by CORE" ); op.new_options.short_backing_asset = asset_objs.prediction; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.new_options.short_backing_asset = correct_asset_id; // CHILDUSER is a non-committee asset backed by PARENT which is backed by CORE @@ -707,15 +707,15 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) op.issuer = asset_objs.bit_parent(db).issuer; op.new_options.short_backing_asset = asset_objs.bit_usdbacked; // this should generate a warning in the log, but not fail. - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // changing the backing asset to a UIA should work BOOST_TEST_MESSAGE( "Switching to a backing asset that is a UIA should work. No warning should be produced." ); op.new_options.short_backing_asset = asset_objs.user_issued; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // A -> B -> C, change B to be backed by A (circular backing) BOOST_TEST_MESSAGE( "Message should contain: A cannot be backed by B which is backed by A." ); op.new_options.short_backing_asset = asset_objs.bit_child_bitasset; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.new_options.short_backing_asset = asset_objs.user_issued; BOOST_TEST_MESSAGE( "Message should contain: but this asset is a backing asset for a committee-issued asset." ); // CHILDCOMMITTEE is a committee asset backed by PARENT which is backed by CORE @@ -724,7 +724,7 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) create_bitasset( "CHILDCOMMITTEE", GRAPHENE_COMMITTEE_ACCOUNT, 100, charge_market_fee, 2, asset_objs.bit_parent ); // it should again work, generating 2 warnings in the log. 1 for the above, and 1 new one. - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.asset_to_update = asset_objs.bit_usd; op.issuer = asset_objs.bit_usd(db).issuer; op.new_options.short_backing_asset = correct_asset_id; @@ -738,7 +738,7 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) op.asset_to_update = asset_objs.bit_usdbacked2; op.issuer = asset_objs.bit_usdbacked2(db).issuer; op.new_options.short_backing_asset = asset_objs.bit_usdbacked; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // set everything to a more normal state op.asset_to_update = asset_objs.bit_usdbacked; op.issuer = asset_objs.bit_usd(db).issuer; @@ -748,25 +748,25 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_before_922_931 ) BOOST_TEST_MESSAGE( "Message should contain: op.new_options.feed_lifetime_sec <= chain_parameters.block_interval" ); const auto good_feed_lifetime = op.new_options.feed_lifetime_sec; op.new_options.feed_lifetime_sec = db.get_global_properties().parameters.block_interval; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); BOOST_TEST_MESSAGE( "Message should contain: op.new_options.feed_lifetime_sec <= chain_parameters.block_interval" ); op.new_options.feed_lifetime_sec = db.get_global_properties().parameters.block_interval - 1; // default interval > 1 - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.new_options.feed_lifetime_sec = good_feed_lifetime; // Force settlement delay must exceed block interval. BOOST_TEST_MESSAGE( "Message should contain: op.new_options.force_settlement_delay_sec <= chain_parameters.block_interval" ); const auto good_force_settlement_delay_sec = op.new_options.force_settlement_delay_sec; op.new_options.force_settlement_delay_sec = db.get_global_properties().parameters.block_interval; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); BOOST_TEST_MESSAGE( "Message should contain: op.new_options.force_settlement_delay_sec <= chain_parameters.block_interval" ); op.new_options.force_settlement_delay_sec = db.get_global_properties().parameters.block_interval - 1; // default interval > 1 - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); op.new_options.force_settlement_delay_sec = good_force_settlement_delay_sec; // this should pass BOOST_TEST_MESSAGE( "We should be all good again." ); - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); } /****** @@ -794,7 +794,7 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_after_922_931 ) // this should pass BOOST_TEST_MESSAGE( "Evaluating a good operation" ); - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // test with a market issued asset BOOST_TEST_MESSAGE( "Sending a non-bitasset." ); @@ -853,13 +853,13 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_after_922_931 ) // changing the backing asset to a UIA should work BOOST_TEST_MESSAGE( "Switching to a backing asset that is a UIA should work." ); op.new_options.short_backing_asset = asset_objs.user_issued; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); // A -> B -> C, change B to be backed by A (circular backing) BOOST_TEST_MESSAGE( "Check for circular backing. This should generate an exception" ); op.new_options.short_backing_asset = asset_objs.bit_child_bitasset; REQUIRE_EXCEPTION_WITH_TEXT( evaluator.evaluate(op), "'A' backed by 'B' backed by 'A'" ); op.new_options.short_backing_asset = asset_objs.user_issued; - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); BOOST_TEST_MESSAGE( "Creating CHILDCOMMITTEE" ); // CHILDCOMMITTEE is a committee asset backed by PARENT which is backed by CORE // Cannot change PARENT's backing asset from CORE to something else because that will make CHILDCOMMITTEE @@ -907,7 +907,7 @@ BOOST_AUTO_TEST_CASE( bitasset_evaluator_test_after_922_931 ) // this should pass BOOST_TEST_MESSAGE( "We should be all good again." ); - BOOST_CHECK( evaluator.evaluate(op) == void_result() ); + BOOST_CHECK( evaluator.evaluate(op).is_type() ); } diff --git a/tests/tests/fee_tests.cpp b/tests/tests/fee_tests.cpp index 6051509424..4e509a5dbb 100644 --- a/tests/tests/fee_tests.cpp +++ b/tests/tests/fee_tests.cpp @@ -763,7 +763,7 @@ BOOST_AUTO_TEST_CASE( fee_refund_test ) // C++ -- The above commented out statement doesn't work, I don't know why // so we will use the following rather lengthy initialization instead { - flat_set< fee_parameters > new_fees; + fee_parameters::flat_set_type new_fees; { limit_order_create_operation::fee_parameters_type create_fee_params; create_fee_params.fee = order_create_fee; @@ -880,7 +880,7 @@ BOOST_AUTO_TEST_CASE( non_core_fee_refund_test ) generate_block( skip ); - flat_set< fee_parameters > new_fees; + fee_parameters::flat_set_type new_fees; { limit_order_create_operation::fee_parameters_type create_fee_params; create_fee_params.fee = order_create_fee; @@ -1266,7 +1266,7 @@ BOOST_AUTO_TEST_CASE( hf445_fee_refund_cross_test ) generate_block( skip ); - flat_set< fee_parameters > new_fees; + fee_parameters::flat_set_type new_fees; { limit_order_create_operation::fee_parameters_type create_fee_params; create_fee_params.fee = order_create_fee; @@ -1772,9 +1772,9 @@ BOOST_AUTO_TEST_CASE( bsip26_fee_refund_test ) generate_block( skip ); - flat_set< fee_parameters > new_fees; - flat_set< fee_parameters > new_fees1; - flat_set< fee_parameters > new_fees2; + fee_parameters::flat_set_type new_fees; + fee_parameters::flat_set_type new_fees1; + fee_parameters::flat_set_type new_fees2; { limit_order_create_operation::fee_parameters_type create_fee_params; create_fee_params.fee = order_create_fee; @@ -2329,7 +2329,7 @@ BOOST_AUTO_TEST_CASE( bsip26_fee_refund_cross_test ) generate_block( skip ); - flat_set< fee_parameters > new_fees; + fee_parameters::flat_set_type new_fees; { limit_order_create_operation::fee_parameters_type create_fee_params; create_fee_params.fee = order_create_fee; From 95787eef45c496246b857e433ca61f97de2ec30f Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Sat, 31 Aug 2019 10:49:54 -0500 Subject: [PATCH 2/5] Bump FC --- libraries/fc | 2 +- .../protocol/include/graphene/protocol/types.hpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/fc b/libraries/fc index 9f7f1b4790..a75fcb56f3 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 9f7f1b479067ffe75e293b8e54aa13f7bd052b0a +Subproject commit a75fcb56f3cd51eb28d43673c9ea583fe23cfe34 diff --git a/libraries/protocol/include/graphene/protocol/types.hpp b/libraries/protocol/include/graphene/protocol/types.hpp index 0927fa1d87..7b1d2c0e83 100644 --- a/libraries/protocol/include/graphene/protocol/types.hpp +++ b/libraries/protocol/include/graphene/protocol/types.hpp @@ -77,9 +77,18 @@ namespace fc { \ template<> struct reflector {\ typedef TYPE type; \ typedef std::true_type is_defined; \ + using native_members = \ + typename typelist::builder<>::type \ + BOOST_PP_SEQ_FOR_EACH_I( FC_CONCAT_MEMBER_REFLECTION, TYPE, MEMBERS ) ::finalize; \ + using inherited_members = \ + typename typelist::builder<>::type \ + BOOST_PP_SEQ_FOR_EACH( FC_CONCAT_BASE_MEMBER_REFLECTIONS, TYPE, INHERITS ) ::finalize; \ + using members = typename typelist::concat::type; \ + using base_classes = typename typelist::builder<>::type \ + BOOST_PP_SEQ_FOR_EACH( FC_CONCAT_TYPE, x, INHERITS ) ::finalize; \ enum member_count_enum { \ - local_member_count = 0 BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_MEMBER_COUNT, +, MEMBERS ),\ - total_member_count = local_member_count BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_BASE_MEMBER_COUNT, +, INHERITS )\ + local_member_count = typelist::length(), \ + total_member_count = typelist::length() \ }; \ FC_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ }; \ From 33cb896d87a700836efb873985d09fac86edfb0f Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Sun, 1 Sep 2019 10:34:10 -0500 Subject: [PATCH 3/5] Bump FC --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index a75fcb56f3..4b7bcb951d 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit a75fcb56f3cd51eb28d43673c9ea583fe23cfe34 +Subproject commit 4b7bcb951d5c6fd8be95a3d92a8b84115ce0cdd4 From 938201ad6568c7c0d2bdf95291c488099aafd7aa Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Mon, 2 Sep 2019 09:54:11 -0500 Subject: [PATCH 4/5] Fix build --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index 4b7bcb951d..7e69567dd0 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 4b7bcb951d5c6fd8be95a3d92a8b84115ce0cdd4 +Subproject commit 7e69567dd05525f83120f672d72a15118123d6de From 787f7e5a2b79161978b3eca7b2fa9657d9af3eee Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Mon, 2 Sep 2019 11:52:40 -0500 Subject: [PATCH 5/5] Move FC_REFLECT_DERIVED_NO_TYPENAME to FC --- libraries/fc | 2 +- .../include/graphene/protocol/types.hpp | 22 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/libraries/fc b/libraries/fc index 7e69567dd0..9db1417b25 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 7e69567dd05525f83120f672d72a15118123d6de +Subproject commit 9db1417b2529e7456226676f0c0ad1f09e2dd449 diff --git a/libraries/protocol/include/graphene/protocol/types.hpp b/libraries/protocol/include/graphene/protocol/types.hpp index 7b1d2c0e83..b861efc78a 100644 --- a/libraries/protocol/include/graphene/protocol/types.hpp +++ b/libraries/protocol/include/graphene/protocol/types.hpp @@ -72,28 +72,6 @@ namespace raw { \ #define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type) GRAPHENE_EXTERNAL_SERIALIZATION(extern, type) #define GRAPHENE_IMPLEMENT_EXTERNAL_SERIALIZATION(type) GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, type) -#define FC_REFLECT_DERIVED_NO_TYPENAME( TYPE, INHERITS, MEMBERS ) \ -namespace fc { \ -template<> struct reflector {\ - typedef TYPE type; \ - typedef std::true_type is_defined; \ - using native_members = \ - typename typelist::builder<>::type \ - BOOST_PP_SEQ_FOR_EACH_I( FC_CONCAT_MEMBER_REFLECTION, TYPE, MEMBERS ) ::finalize; \ - using inherited_members = \ - typename typelist::builder<>::type \ - BOOST_PP_SEQ_FOR_EACH( FC_CONCAT_BASE_MEMBER_REFLECTIONS, TYPE, INHERITS ) ::finalize; \ - using members = typename typelist::concat::type; \ - using base_classes = typename typelist::builder<>::type \ - BOOST_PP_SEQ_FOR_EACH( FC_CONCAT_TYPE, x, INHERITS ) ::finalize; \ - enum member_count_enum { \ - local_member_count = typelist::length(), \ - total_member_count = typelist::length() \ - }; \ - FC_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ -}; \ -} // fc - #define GRAPHENE_NAME_TO_OBJECT_TYPE(x, prefix, name) BOOST_PP_CAT(prefix, BOOST_PP_CAT(name, _object_type)) #define GRAPHENE_NAME_TO_ID_TYPE(x, y, name) BOOST_PP_CAT(name, _id_type) #define GRAPHENE_DECLARE_ID(x, space_prefix_seq, name) \