From a00326c66060ed464695dd7f9d1355334cc1891d Mon Sep 17 00:00:00 2001 From: oknenavin Date: Sun, 30 Jun 2024 23:10:35 +0300 Subject: [PATCH] - json: classes' key default changed to 'simple' - json: simple-key => trivial-key --- src/cxon/lang/common/cio/class.hxx | 30 +++++++++---------- src/cxon/lang/json/class.hxx | 20 ++++++++----- test/src/json/json.core-compound.cxx | 3 ++ .../json.node-time.native-apache_builds.hxx | 3 -- .../src/json/json.node-time.native-canada.hxx | 3 -- .../json.node-time.native-citm_catalog.hxx | 5 ---- test/src/json/json.node-time.native-emoji.hxx | 1 - .../json.node-time.native-github_events.hxx | 19 ------------ .../json/json.node-time.native-gsoc_2018.hxx | 3 -- .../json.node-time.native-instruments.hxx | 7 ----- .../json/json.node-time.native-marine_ik.hxx | 15 ---------- test/src/json/json.node-time.native-mesh.hxx | 3 -- .../src/json/json.node-time.native-random.hxx | 3 -- .../json/json.node-time.native-twitter.hxx | 15 ---------- .../json.node-time.native-update_center.hxx | 6 ---- 15 files changed, 30 insertions(+), 106 deletions(-) diff --git a/src/cxon/lang/common/cio/class.hxx b/src/cxon/lang/common/cio/class.hxx index 0d3c3252..2e617283 100644 --- a/src/cxon/lang/common/cio/class.hxx +++ b/src/cxon/lang/common/cio/class.hxx @@ -42,12 +42,12 @@ namespace cxon { namespace cio { namespace cls { // traits template struct is_bare_class; - // simple-key-class support types - struct cxon_simple_key_class_tag {}; + // trivial-key-class support types + struct cxon_nontrivial_key_class_tag {}; template - struct is_simple_key_class; + struct is_trivial_key_class; template - constexpr bool are_simple_key_fields(Fs&&... fs); + constexpr bool are_trivial_key_fields(Fs&&... fs); // ordered-keys-class support types struct cxon_ordered_keys_class_tag {}; @@ -78,34 +78,34 @@ namespace cxon { namespace cio { namespace cls { template struct is_bare_class : imp::is_bare_class_ {}; - // simple-key-class support types + // trivial-key-class support types namespace imp { template > - struct is_simple_key_class_ : std::false_type {}; + struct is_trivial_key_class_ : std::true_type {}; template - struct is_simple_key_class_> : std::true_type {}; + struct is_trivial_key_class_> : std::false_type {}; } template - struct is_simple_key_class : imp::is_simple_key_class_ {}; + struct is_trivial_key_class : imp::is_trivial_key_class_ {}; namespace imp { template - constexpr bool is_simple_key_(const char* s, std::size_t n, unsigned i = 0) { - return i == n || (!chr::imp::should_escape_(s[i]) && is_simple_key_(s, n, i + 1)); + constexpr bool is_trivial_key_(const char* s, std::size_t n, unsigned i = 0) { + return i == n || (!chr::imp::should_escape_(s[i]) && is_trivial_key_(s, n, i + 1)); } template - constexpr bool are_simple_key_fields_() { + constexpr bool are_trivial_key_fields_() { return true; } template - constexpr bool are_simple_key_fields_(F&& f, Fs&&... fs) { - return is_simple_key_(f.name, f.nale) && are_simple_key_fields_(std::forward(fs)...); + constexpr bool are_trivial_key_fields_(F&& f, Fs&&... fs) { + return is_trivial_key_(f.name, f.nale) && are_trivial_key_fields_(std::forward(fs)...); } } template - constexpr bool are_simple_key_fields(Fs&&... fs) { - return imp::are_simple_key_fields_(std::forward(fs)...); + constexpr bool are_trivial_key_fields(Fs&&... fs) { + return imp::are_trivial_key_fields_(std::forward(fs)...); } // ordered-keys-class support types diff --git a/src/cxon/lang/json/class.hxx b/src/cxon/lang/json/class.hxx index 0fada155..fcc0b0f3 100644 --- a/src/cxon/lang/json/class.hxx +++ b/src/cxon/lang/json/class.hxx @@ -54,9 +54,9 @@ namespace cxon { // cio::val::sink read #define CXON_JSON_CLS_FIELD_ASIS_DFLT(F, ...) CXON_JSON_CLS_FIELD_DFLT(CXON_T_, #F, F, __VA_ARGS__) #define CXON_JSON_CLS_FIELD_SKIP(N) cxon::json::cls::make_field(N, {}) -#define CXON_JSON_CLS_SIMPLE_KEY(T)\ +#define CXON_JSON_CLS_NONTRIVIAL_KEY(T)\ namespace cxon { namespace cio { namespace cls { \ - template <> struct is_simple_key_class : std::true_type {}; \ + template <> struct is_trivial_key_class : std::false_type {}; \ }}} #define CXON_JSON_CLS_READ(Type, ...)\ @@ -65,7 +65,8 @@ namespace cxon { // cio::val::sink read inline auto read_value(Type& t, II& i, II e, Cx& cx) -> enable_for_t { \ using CXON_T_ = Type; \ static CXON_CXX17_CONSTEXPR auto fs = json::cls::make_fields(__VA_ARGS__); \ - CXON_IF_CONSTEXPR (cio::cls::is_simple_key_class::value || cio::cls::are_simple_key_fields(__VA_ARGS__)) { \ + CXON_IF_CONSTEXPR (cio::cls::is_trivial_key_class::value) { \ + /*static_assert(cio::cls::are_trivial_key_fields(__VA_ARGS__), "unexpected, use nontrivial key(s)");*/ \ using Y = bind_traits_t; \ /*CXON_IF_CONSTEXPR (cio::cls::is_ordered_keys_class::value || cio::cls::are_fields_ordered(__VA_ARGS__)) { \ using Y = bind_traits_t; \ @@ -86,7 +87,8 @@ namespace cxon { // cio::val::sink read inline auto write_value(O& o, const Type& t, Cx& cx) -> enable_for_t { \ using CXON_T_ = Type; \ static CXON_CXX17_CONSTEXPR auto fs = json::cls::make_fields(__VA_ARGS__); \ - CXON_IF_CONSTEXPR (cio::cls::is_simple_key_class::value || cio::cls::are_simple_key_fields(__VA_ARGS__)) { \ + CXON_IF_CONSTEXPR (cio::cls::is_trivial_key_class::value) { \ + /*static_assert(cio::cls::are_trivial_key_fields(__VA_ARGS__), "unexpected, use nontrivial key(s)");*/ \ using Y = bind_traits_t; \ return json::cls::write_fields(o, t, fs, cx); \ } \ @@ -97,15 +99,16 @@ namespace cxon { // cio::val::sink read CXON_JSON_CLS_READ(Type, __VA_ARGS__) \ CXON_JSON_CLS_WRITE(Type, __VA_ARGS__) -#define CXON_JSON_CLS_SIMPLE_KEY_MEMBER()\ - using cxon_simple_key_class_tag = cxon::cio::cls::cxon_simple_key_class_tag; +#define CXON_JSON_CLS_NONTRIVIAL_KEY_MEMBER()\ + using cxon_nontrivial_key_class_tag = cxon::cio::cls::cxon_nontrivial_key_class_tag; #define CXON_JSON_CLS_READ_MEMBER(Type, ...) \ template \ static auto read_value(Type& t, II& i, II e, Cx& cx) -> cxon::enable_for_t { \ using CXON_T_ = Type; ((void)((CXON_T_*)0)); \ static CXON_CXX17_CONSTEXPR auto fs = cxon::json::cls::make_fields(__VA_ARGS__); \ - CXON_IF_CONSTEXPR (cxon::cio::cls::is_simple_key_class::value || cxon::cio::cls::are_simple_key_fields(__VA_ARGS__)) { \ + CXON_IF_CONSTEXPR (cxon::cio::cls::is_trivial_key_class::value) { \ + /*static_assert(cxon::cio::cls::are_trivial_key_fields(__VA_ARGS__), "unexpected, use nontrivial key(s)");*/ \ using Y = cxon::bind_traits_t; \ /*CXON_IF_CONSTEXPR (cxon::cio::cls::is_ordered_keys_class::value || cxon::cio::cls::are_fields_ordered(__VA_ARGS__)) { \ using Y = cxon::bind_traits_t; \ @@ -124,7 +127,8 @@ namespace cxon { // cio::val::sink read static auto write_value(O& o, const Type& t, Cx& cx) -> cxon::enable_for_t { \ using CXON_T_ = Type; ((void)((CXON_T_*)0)); \ static CXON_CXX17_CONSTEXPR auto fs = cxon::json::cls::make_fields(__VA_ARGS__); \ - CXON_IF_CONSTEXPR (cxon::cio::cls::is_simple_key_class::value || cxon::cio::cls::are_simple_key_fields(__VA_ARGS__)) { \ + CXON_IF_CONSTEXPR (cxon::cio::cls::is_trivial_key_class::value) { \ + /*static_assert(cxon::cio::cls::are_trivial_key_fields(__VA_ARGS__), "unexpected, use nontrivial key(s)");*/ \ using Y = cxon::bind_traits_t; \ return cxon::json::cls::write_fields(o, t, fs, cx); \ } \ diff --git a/test/src/json/json.core-compound.cxx b/test/src/json/json.core-compound.cxx index f80795ad..d4fe1824 100644 --- a/test/src/json/json.core-compound.cxx +++ b/test/src/json/json.core-compound.cxx @@ -1009,6 +1009,7 @@ namespace { bool operator ==(const Struct10& t) const { return a == t.a && b == t.b; } }; } +CXON_JSON_CLS_NONTRIVIAL_KEY(Struct10) CXON_JSON_CLS_READ(Struct10, CXON_JSON_CLS_FIELD_ASIS(a), CXON_JSON_CLS_FIELD_SKIP("skip1"), @@ -1446,6 +1447,7 @@ namespace { struct Struct15 { std::string a, b, c, d; bool operator ==(const Struct15& t) const { return a == t.a && b == t.b && c == t.c && d == t.d; } + CXON_JSON_CLS_NONTRIVIAL_KEY_MEMBER() }; } CXON_JSON_CLS(Struct15, @@ -1561,6 +1563,7 @@ namespace { Struct18(int a = 0) : a(a) {} bool operator ==(const Struct18& o) const { return a == o.a; } CXON_JSON_CLS_MEMBER(Struct18, CXON_JSON_CLS_FIELD_NAME("\t", a)) + CXON_JSON_CLS_NONTRIVIAL_KEY_MEMBER() }; struct Struct19 { Struct18 a; diff --git a/test/src/json/json.node-time.native-apache_builds.hxx b/test/src/json/json.node-time.native-apache_builds.hxx index 197dc8b8..60389cc1 100644 --- a/test/src/json/json.node-time.native-apache_builds.hxx +++ b/test/src/json/json.node-time.native-apache_builds.hxx @@ -20,7 +20,6 @@ namespace test { namespace apache_builds { std::string color; CXON_JSON_CLS_MEMBER(job, CXON_JSON_CLS_FIELD_ASIS(name), CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(color)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct view { @@ -28,7 +27,6 @@ namespace test { namespace apache_builds { std::string url; CXON_JSON_CLS_MEMBER(view, CXON_JSON_CLS_FIELD_ASIS(name), CXON_JSON_CLS_FIELD_ASIS(url)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -65,7 +63,6 @@ namespace test { namespace apache_builds { CXON_JSON_CLS_FIELD_ASIS(useSecurity), CXON_JSON_CLS_FIELD_ASIS(views) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-canada.hxx b/test/src/json/json.node-time.native-canada.hxx index 286e2e72..1fa789dc 100644 --- a/test/src/json/json.node-time.native-canada.hxx +++ b/test/src/json/json.node-time.native-canada.hxx @@ -20,7 +20,6 @@ namespace test { namespace canada { std::vector>> coordinates; CXON_JSON_CLS_MEMBER(geometry, CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(coordinates)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct feature { @@ -29,7 +28,6 @@ namespace test { namespace canada { struct geometry geometry; CXON_JSON_CLS_MEMBER(feature, CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(properties), CXON_JSON_CLS_FIELD_ASIS(geometry)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -37,7 +35,6 @@ namespace test { namespace canada { std::vector features; CXON_JSON_CLS_MEMBER(object, CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(features)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-citm_catalog.hxx b/test/src/json/json.node-time.native-citm_catalog.hxx index 63471a14..5d8fd282 100644 --- a/test/src/json/json.node-time.native-citm_catalog.hxx +++ b/test/src/json/json.node-time.native-citm_catalog.hxx @@ -37,7 +37,6 @@ namespace test { namespace citm_catalog { CXON_JSON_CLS_FIELD_ASIS(subtitle), CXON_JSON_CLS_FIELD_ASIS(topicIds) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct price { @@ -46,7 +45,6 @@ namespace test { namespace citm_catalog { unsigned long long seatCategoryId; CXON_JSON_CLS_MEMBER(price, CXON_JSON_CLS_FIELD_ASIS(amount), CXON_JSON_CLS_FIELD_ASIS(audienceSubCategoryId), CXON_JSON_CLS_FIELD_ASIS(seatCategoryId)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct area { @@ -61,7 +59,6 @@ namespace test { namespace citm_catalog { unsigned long long seatCategoryId; CXON_JSON_CLS_MEMBER(seat, CXON_JSON_CLS_FIELD_ASIS(areas), CXON_JSON_CLS_FIELD_ASIS(seatCategoryId)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct performance { @@ -86,7 +83,6 @@ namespace test { namespace citm_catalog { CXON_JSON_CLS_FIELD_ASIS(start), CXON_JSON_CLS_FIELD_ASIS(venueCode) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -115,7 +111,6 @@ namespace test { namespace citm_catalog { CXON_JSON_CLS_FIELD_ASIS(topicSubTopics), CXON_JSON_CLS_FIELD_ASIS(venueNames) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-emoji.hxx b/test/src/json/json.node-time.native-emoji.hxx index 4575f405..9e29d424 100644 --- a/test/src/json/json.node-time.native-emoji.hxx +++ b/test/src/json/json.node-time.native-emoji.hxx @@ -33,7 +33,6 @@ namespace test { namespace emoji { CXON_JSON_CLS_FIELD_ASIS_DFLT(ios_version , self.ios_version.empty()), CXON_JSON_CLS_FIELD_ASIS_DFLT(skin_tones , !self.skin_tones) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; using object = std::vector; diff --git a/test/src/json/json.node-time.native-github_events.hxx b/test/src/json/json.node-time.native-github_events.hxx index 01fca5d1..6691e85b 100644 --- a/test/src/json/json.node-time.native-github_events.hxx +++ b/test/src/json/json.node-time.native-github_events.hxx @@ -31,7 +31,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(id) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct repo_type { @@ -40,7 +39,6 @@ namespace test { namespace github_events { std::string name; CXON_JSON_CLS_MEMBER(repo_type, CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(id), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct author_type { @@ -48,7 +46,6 @@ namespace test { namespace github_events { std::string name; CXON_JSON_CLS_MEMBER(author_type, CXON_JSON_CLS_FIELD_ASIS(email), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct commit_type { @@ -65,7 +62,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(sha), CXON_JSON_CLS_FIELD_ASIS(author) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct user_type { @@ -111,7 +107,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(followers_url), CXON_JSON_CLS_FIELD_ASIS(following_url) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct forkee_type { @@ -246,7 +241,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(size), CXON_JSON_CLS_FIELD_ASIS(watchers) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct pull_request_type { @@ -255,7 +249,6 @@ namespace test { namespace github_events { std::optional diff_url; CXON_JSON_CLS_MEMBER(pull_request_type, CXON_JSON_CLS_FIELD_ASIS(html_url), CXON_JSON_CLS_FIELD_ASIS(patch_url), CXON_JSON_CLS_FIELD_ASIS(diff_url)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct issue_type { @@ -300,7 +293,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(comments_url), CXON_JSON_CLS_FIELD_ASIS(comments) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct comment_type { @@ -328,7 +320,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(updated_at), CXON_JSON_CLS_FIELD_ASIS(id) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct page_type { @@ -347,7 +338,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(summary), CXON_JSON_CLS_FIELD_ASIS(action) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload { @@ -394,7 +384,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(head), CXON_JSON_CLS_FIELD_ASIS(size) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_create_event : payload { @@ -414,7 +403,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(ref), CXON_JSON_CLS_FIELD_ASIS(ref_type) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_fork_event : payload { @@ -423,7 +411,6 @@ namespace test { namespace github_events { payload_fork_event(forkee_type&& forkee) : payload(payload::fork_event), forkee(std::move(forkee)) {} CXON_JSON_CLS_WRITE_MEMBER(payload_fork_event, CXON_JSON_CLS_FIELD_ASIS(forkee)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_watch_event : payload { @@ -432,7 +419,6 @@ namespace test { namespace github_events { payload_watch_event(std::string&& action) : payload(payload::watch_event), action(std::move(action)) {} CXON_JSON_CLS_WRITE_MEMBER(payload_watch_event, CXON_JSON_CLS_FIELD_ASIS(action)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_issue_comment_event : payload { @@ -450,7 +436,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(issue), CXON_JSON_CLS_FIELD_ASIS_DFLT(comment, self.comment == comment_type {}) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_gollum_event : payload { @@ -459,7 +444,6 @@ namespace test { namespace github_events { payload_gollum_event(std::vector&& pages) : payload(payload::gollum_event), pages(std::move(pages)) {} CXON_JSON_CLS_WRITE_MEMBER(payload_gollum_event, CXON_JSON_CLS_FIELD_ASIS(pages)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct payload_proxy { @@ -496,7 +480,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS_DFLT(comment, self.comment == comment_type {}), CXON_JSON_CLS_FIELD_ASIS(pages) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct org_type { @@ -513,7 +496,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(id) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct event_type { @@ -536,7 +518,6 @@ namespace test { namespace github_events { CXON_JSON_CLS_FIELD_ASIS(payload), CXON_JSON_CLS_FIELD_ASIS(id) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; using object = std::vector; diff --git a/test/src/json/json.node-time.native-gsoc_2018.hxx b/test/src/json/json.node-time.native-gsoc_2018.hxx index 65749eb9..84cde065 100644 --- a/test/src/json/json.node-time.native-gsoc_2018.hxx +++ b/test/src/json/json.node-time.native-gsoc_2018.hxx @@ -28,7 +28,6 @@ namespace test { namespace gsoc_2018 { CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(logo) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct author { @@ -36,7 +35,6 @@ namespace test { namespace gsoc_2018 { std::string name; CXON_JSON_CLS_MEMBER(author, CXON_JSON_CLS_FIELD_NAME("@type", type), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct participant { @@ -55,7 +53,6 @@ namespace test { namespace gsoc_2018 { CXON_JSON_CLS_FIELD_ASIS(sponsor), CXON_JSON_CLS_FIELD_ASIS(author) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; using object = cxon::ordered::object; diff --git a/test/src/json/json.node-time.native-instruments.hxx b/test/src/json/json.node-time.native-instruments.hxx index e1466494..7094ccc8 100644 --- a/test/src/json/json.node-time.native-instruments.hxx +++ b/test/src/json/json.node-time.native-instruments.hxx @@ -21,7 +21,6 @@ namespace test { namespace instruments { unsigned value; CXON_JSON_CLS_MEMBER(envelope_node, CXON_JSON_CLS_FIELD_ASIS(tick), CXON_JSON_CLS_FIELD_ASIS(value)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct envelope { @@ -40,7 +39,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(sustain_end), CXON_JSON_CLS_FIELD_ASIS(sustain_start) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct instrument { @@ -113,7 +111,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(volume_ramp_down), CXON_JSON_CLS_FIELD_ASIS(volume_ramp_up) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() # ifdef CXON_USE_GPERF static unsigned hash(const char *str, std::size_t len) { @@ -230,7 +227,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(volcmd), CXON_JSON_CLS_FIELD_ASIS(volval) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct pattern { @@ -247,7 +243,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(rows_per_beat), CXON_JSON_CLS_FIELD_ASIS(rows_per_measure) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct sample { @@ -284,7 +279,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(vibrato_type), CXON_JSON_CLS_FIELD_ASIS(volume) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -309,7 +303,6 @@ namespace test { namespace instruments { CXON_JSON_CLS_FIELD_ASIS(samples), CXON_JSON_CLS_FIELD_ASIS(version) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-marine_ik.hxx b/test/src/json/json.node-time.native-marine_ik.hxx index 84dac1f9..296f8c0a 100644 --- a/test/src/json/json.node-time.native-marine_ik.hxx +++ b/test/src/json/json.node-time.native-marine_ik.hxx @@ -19,7 +19,6 @@ namespace test { namespace marine_ik { std::string name; CXON_JSON_CLS_MEMBER(image, CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(uuid), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct key { @@ -29,7 +28,6 @@ namespace test { namespace marine_ik { std::vector rot; CXON_JSON_CLS_MEMBER(key, CXON_JSON_CLS_FIELD_ASIS(pos), CXON_JSON_CLS_FIELD_ASIS(time), CXON_JSON_CLS_FIELD_ASIS(scl), CXON_JSON_CLS_FIELD_ASIS(rot)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct element { @@ -37,7 +35,6 @@ namespace test { namespace marine_ik { std::vector keys; CXON_JSON_CLS_MEMBER(element, CXON_JSON_CLS_FIELD_ASIS(parent), CXON_JSON_CLS_FIELD_ASIS(keys)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct data_metadata { @@ -58,7 +55,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(bones), CXON_JSON_CLS_FIELD_ASIS(vertices) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct frame { @@ -68,7 +64,6 @@ namespace test { namespace marine_ik { std::string name; CXON_JSON_CLS_MEMBER(frame, CXON_JSON_CLS_FIELD_ASIS(hierarchy), CXON_JSON_CLS_FIELD_ASIS(length), CXON_JSON_CLS_FIELD_ASIS(fps), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct bone { @@ -85,7 +80,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(scl), CXON_JSON_CLS_FIELD_ASIS(name) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct data { @@ -114,7 +108,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(bones), CXON_JSON_CLS_FIELD_ASIS(faces) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; @@ -124,7 +117,6 @@ namespace test { namespace marine_ik { struct data data; CXON_JSON_CLS_MEMBER(geometry, CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(uuid), CXON_JSON_CLS_FIELD_ASIS(data)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct texture { @@ -149,7 +141,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(uuid), CXON_JSON_CLS_FIELD_ASIS(magFilter) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object_metadata { @@ -159,7 +150,6 @@ namespace test { namespace marine_ik { float version; CXON_JSON_CLS_MEMBER(object_metadata, CXON_JSON_CLS_FIELD_ASIS(sourceFile), CXON_JSON_CLS_FIELD_ASIS(generator), CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(version)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct material { @@ -192,7 +182,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(depthWrite), CXON_JSON_CLS_FIELD_ASIS(specular) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct child { @@ -217,7 +206,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_ASIS(receiveShadow), CXON_JSON_CLS_FIELD_ASIS(geometry) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object_ { @@ -227,7 +215,6 @@ namespace test { namespace marine_ik { std::string uuid; CXON_JSON_CLS_MEMBER(object_, CXON_JSON_CLS_FIELD_ASIS(children), CXON_JSON_CLS_FIELD_ASIS(type), CXON_JSON_CLS_FIELD_ASIS(matrix), CXON_JSON_CLS_FIELD_ASIS(uuid)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct animation { @@ -236,7 +223,6 @@ namespace test { namespace marine_ik { std::string name; CXON_JSON_CLS_MEMBER(animation, CXON_JSON_CLS_FIELD_ASIS(tracks), CXON_JSON_CLS_FIELD_ASIS(fps), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -257,7 +243,6 @@ namespace test { namespace marine_ik { CXON_JSON_CLS_FIELD_NAME("object", object_), CXON_JSON_CLS_FIELD_ASIS(animations) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-mesh.hxx b/test/src/json/json.node-time.native-mesh.hxx index ba0bc29a..9a541867 100644 --- a/test/src/json/json.node-time.native-mesh.hxx +++ b/test/src/json/json.node-time.native-mesh.hxx @@ -19,12 +19,10 @@ namespace test { namespace mesh { std::vector usedBones; CXON_JSON_CLS_MEMBER(batch, CXON_JSON_CLS_FIELD_ASIS(indexRange), CXON_JSON_CLS_FIELD_ASIS(vertexRange), CXON_JSON_CLS_FIELD_ASIS(usedBones)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct morph_targets { CXON_JSON_CLS_MEMBER(morph_targets) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -47,7 +45,6 @@ namespace test { namespace mesh { CXON_JSON_CLS_FIELD_ASIS(normals), CXON_JSON_CLS_FIELD_ASIS(indices) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-random.hxx b/test/src/json/json.node-time.native-random.hxx index cf568501..45983be3 100644 --- a/test/src/json/json.node-time.native-random.hxx +++ b/test/src/json/json.node-time.native-random.hxx @@ -19,7 +19,6 @@ namespace test { namespace random { std::string phone; CXON_JSON_CLS_MEMBER(friend_, CXON_JSON_CLS_FIELD_ASIS(id), CXON_JSON_CLS_FIELD_ASIS(name), CXON_JSON_CLS_FIELD_ASIS(phone)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct result { @@ -48,7 +47,6 @@ namespace test { namespace random { CXON_JSON_CLS_FIELD_ASIS(friends), CXON_JSON_CLS_FIELD_ASIS(field) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -58,7 +56,6 @@ namespace test { namespace random { std::vector result; CXON_JSON_CLS_MEMBER(object, CXON_JSON_CLS_FIELD_ASIS(id), CXON_JSON_CLS_FIELD_ASIS(jsonrpc), CXON_JSON_CLS_FIELD_ASIS(total), CXON_JSON_CLS_FIELD_ASIS(result)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-twitter.hxx b/test/src/json/json.node-time.native-twitter.hxx index b0bff455..d5a8ec21 100644 --- a/test/src/json/json.node-time.native-twitter.hxx +++ b/test/src/json/json.node-time.native-twitter.hxx @@ -21,7 +21,6 @@ namespace test { namespace twitter { std::string iso_language_code; CXON_JSON_CLS_MEMBER(metadata, CXON_JSON_CLS_FIELD_ASIS(result_type), CXON_JSON_CLS_FIELD_ASIS(iso_language_code)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct url { @@ -31,7 +30,6 @@ namespace test { namespace twitter { std::vector indices; CXON_JSON_CLS_MEMBER(url, CXON_JSON_CLS_FIELD_NAME("url", url_), CXON_JSON_CLS_FIELD_ASIS(expanded_url), CXON_JSON_CLS_FIELD_ASIS(display_url), CXON_JSON_CLS_FIELD_ASIS(indices)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct user_mention { @@ -48,7 +46,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS(id_str), CXON_JSON_CLS_FIELD_ASIS(indices) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct size { @@ -57,7 +54,6 @@ namespace test { namespace twitter { std::string resize; CXON_JSON_CLS_MEMBER(size, CXON_JSON_CLS_FIELD_ASIS(w), CXON_JSON_CLS_FIELD_ASIS(h), CXON_JSON_CLS_FIELD_ASIS(resize)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct sizes { @@ -67,7 +63,6 @@ namespace test { namespace twitter { size small; CXON_JSON_CLS_MEMBER(sizes, CXON_JSON_CLS_FIELD_ASIS(medium), CXON_JSON_CLS_FIELD_ASIS(large), CXON_JSON_CLS_FIELD_ASIS(thumb), CXON_JSON_CLS_FIELD_ASIS(small)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct media { @@ -98,21 +93,18 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS_DFLT(source_status_id , self.source_status_id == 0), CXON_JSON_CLS_FIELD_ASIS_DFLT(source_status_id_str , self.source_status_id_str.empty()) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct description { std::vector urls; CXON_JSON_CLS_MEMBER(description, CXON_JSON_CLS_FIELD_ASIS(urls)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct urls { std::vector urls_; CXON_JSON_CLS_MEMBER(urls, CXON_JSON_CLS_FIELD_NAME("urls", urls_)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct hashtag { @@ -120,7 +112,6 @@ namespace test { namespace twitter { std::vector indices; CXON_JSON_CLS_MEMBER(hashtag, CXON_JSON_CLS_FIELD_ASIS(text), CXON_JSON_CLS_FIELD_ASIS(indices)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct entity { @@ -141,7 +132,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS_DFLT(description , self.description.urls.empty()), CXON_JSON_CLS_FIELD_ASIS_DFLT(media , self.media.empty()) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct user { @@ -228,7 +218,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS(follow_request_sent), CXON_JSON_CLS_FIELD_ASIS(notifications) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() # ifdef CXON_USE_GPERF static unsigned hash(const char *str, std::size_t len) { @@ -383,7 +372,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS_DFLT(possibly_sensitive, !self.possibly_sensitive), CXON_JSON_CLS_FIELD_ASIS(lang) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() # ifdef CXON_USE_GPERF static unsigned hash(const char *str, std::size_t len) { @@ -525,7 +513,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS_DFLT(possibly_sensitive , !self.possibly_sensitive), CXON_JSON_CLS_FIELD_ASIS(lang) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() # ifdef CXON_USE_GPERF static unsigned hash(const char *str, std::size_t len) { @@ -635,7 +622,6 @@ namespace test { namespace twitter { CXON_JSON_CLS_FIELD_ASIS(since_id), CXON_JSON_CLS_FIELD_ASIS(since_id_str) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -643,7 +629,6 @@ namespace test { namespace twitter { struct search_metadata search_metadata; CXON_JSON_CLS_MEMBER(object, CXON_JSON_CLS_FIELD_ASIS(statuses), CXON_JSON_CLS_FIELD_ASIS(search_metadata)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }} diff --git a/test/src/json/json.node-time.native-update_center.hxx b/test/src/json/json.node-time.native-update_center.hxx index e573516e..87abd315 100644 --- a/test/src/json/json.node-time.native-update_center.hxx +++ b/test/src/json/json.node-time.native-update_center.hxx @@ -28,7 +28,6 @@ namespace test { namespace update_center { CXON_JSON_CLS_FIELD_ASIS(url), CXON_JSON_CLS_FIELD_ASIS(version) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct dependency { @@ -37,7 +36,6 @@ namespace test { namespace update_center { std::string version; CXON_JSON_CLS_MEMBER(dependency, CXON_JSON_CLS_FIELD_ASIS(name), CXON_JSON_CLS_FIELD_ASIS(optional), CXON_JSON_CLS_FIELD_ASIS(version)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct developer { @@ -46,7 +44,6 @@ namespace test { namespace update_center { std::string name; CXON_JSON_CLS_MEMBER(developer, CXON_JSON_CLS_FIELD_ASIS(developerId), CXON_JSON_CLS_FIELD_ASIS(email), CXON_JSON_CLS_FIELD_ASIS(name)) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct plugin { @@ -89,7 +86,6 @@ namespace test { namespace update_center { CXON_JSON_CLS_FIELD_ASIS(version), CXON_JSON_CLS_FIELD_ASIS(wiki) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() # ifdef CXON_USE_GPERF static unsigned hash(const char *str, std::size_t len) { @@ -176,7 +172,6 @@ namespace test { namespace update_center { CXON_JSON_CLS_FIELD_ASIS(digest), CXON_JSON_CLS_FIELD_ASIS(signature) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; struct object { @@ -195,7 +190,6 @@ namespace test { namespace update_center { CXON_JSON_CLS_FIELD_ASIS(signature), CXON_JSON_CLS_FIELD_ASIS(updateCenterVersion) ) - CXON_JSON_CLS_SIMPLE_KEY_MEMBER() }; }}