Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E7FFA200C55 for ; Thu, 13 Apr 2017 17:19:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E6B26160B98; Thu, 13 Apr 2017 15:19:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 11106160B8B for ; Thu, 13 Apr 2017 17:19:23 +0200 (CEST) Received: (qmail 17652 invoked by uid 500); 13 Apr 2017 15:19:23 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 17643 invoked by uid 99); 13 Apr 2017 15:19:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2017 15:19:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1EC29DFBBB; Thu, 13 Apr 2017 15:19:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: isapego@apache.org To: commits@ignite.apache.org Message-Id: <0c89e48ac981449aa498f0f62908cf8b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: Merge-related fix for C++ Date: Thu, 13 Apr 2017 15:19:23 +0000 (UTC) archived-at: Thu, 13 Apr 2017 15:19:25 -0000 Repository: ignite Updated Branches: refs/heads/ignite-3477-master 2c4ef9ee3 -> 024272844 Merge-related fix for C++ Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02427284 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02427284 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02427284 Branch: refs/heads/ignite-3477-master Commit: 024272844e6507482c2bee4bbb0cfdfa993fbe5e Parents: 2c4ef9e Author: Igor Sapego Authored: Thu Apr 13 18:18:43 2017 +0300 Committer: Igor Sapego Committed: Thu Apr 13 18:18:43 2017 +0300 ---------------------------------------------------------------------- .../core-test/include/ignite/binary_test_defs.h | 10 ++++---- .../cpp/core-test/src/continuous_query_test.cpp | 2 +- .../examples/include/ignite/examples/address.h | 26 +++++++++----------- .../include/ignite/examples/organization.h | 26 +++++++++----------- .../examples/include/ignite/examples/person.h | 16 ++++++------ 5 files changed, 37 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h index 6c2bde7..9d7dcd2 100644 --- a/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h +++ b/modules/platforms/cpp/core-test/include/ignite/binary_test_defs.h @@ -158,7 +158,7 @@ namespace ignite return GetBinaryStringHashCode(name); } - bool IsNull(const gt::BinaryInner& obj) + static bool IsNull(const gt::BinaryInner& obj) { return false; } @@ -197,7 +197,7 @@ namespace ignite return GetBinaryStringHashCode(name); } - bool IsNull(const gt::BinaryInner& obj) + static bool IsNull(const gt::BinaryInner& obj) { return obj.GetValue() == 0; } @@ -238,7 +238,7 @@ namespace ignite return GetBinaryStringHashCode(name); } - bool IsNull(const gt::BinaryOuter& obj) + static bool IsNull(const gt::BinaryOuter& obj) { return obj.GetValue() == 0 && obj.GetInner().GetValue(); } @@ -281,7 +281,7 @@ namespace ignite return GetBinaryStringHashCode(name); } - bool IsNull(const gt::BinaryFields& obj) + static bool IsNull(const gt::BinaryFields& obj) { return false; } @@ -334,7 +334,7 @@ namespace ignite return GetBinaryStringHashCode(name); } - bool IsNull(const gt::PureRaw& obj) + static bool IsNull(const gt::PureRaw& obj) { return false; } http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/core-test/src/continuous_query_test.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp index ea3d665..e092728 100644 --- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp +++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp @@ -295,7 +295,7 @@ namespace ignite IGNITE_BINARY_GET_FIELD_ID_AS_HASH - bool IsNull(const RangeFilter&) + static bool IsNull(const RangeFilter&) { return false; } http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/address.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/examples/include/ignite/examples/address.h b/modules/platforms/cpp/examples/include/ignite/examples/address.h index b19fb4d..6a06f60 100644 --- a/modules/platforms/cpp/examples/include/ignite/examples/address.h +++ b/modules/platforms/cpp/examples/include/ignite/examples/address.h @@ -59,48 +59,46 @@ namespace ignite template<> struct BinaryType { - int32_t GetTypeId() + static int32_t GetTypeId() { return GetBinaryStringHashCode("Address"); } - std::string GetTypeName() + static void GetTypeName(std::string& dst) { - return "Address"; + dst = "Address"; } - int32_t GetFieldId(const char* name) + static int32_t GetFieldId(const char* name) { return GetBinaryStringHashCode(name); } - int32_t GetHashCode(ignite::examples::Address obj) + static int32_t GetHashCode(ignite::examples::Address obj) { return 0; } - bool IsNull(ignite::examples::Address obj) + static bool IsNull(ignite::examples::Address obj) { return false; } - ignite::examples::Address GetNull() + static void GetNull(ignite::examples::Address& dst) { - return ignite::examples::Address("", 0); + dst = ignite::examples::Address("", 0); } - void Write(BinaryWriter& writer, ignite::examples::Address obj) + static void Write(BinaryWriter& writer, const ignite::examples::Address& obj) { writer.WriteString("street", obj.street); writer.WriteInt32("zip", obj.zip); } - ignite::examples::Address Read(BinaryReader& reader) + static void Read(BinaryReader& reader, ignite::examples::Address& dst) { - std::string street = reader.ReadString("street"); - int zip = reader.ReadInt32("zip"); - - return ignite::examples::Address(street, zip); + dst.street = reader.ReadString("street"); + dst.zip = reader.ReadInt32("zip"); } }; } http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/organization.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/examples/include/ignite/examples/organization.h b/modules/platforms/cpp/examples/include/ignite/examples/organization.h index e819d69..942897d 100644 --- a/modules/platforms/cpp/examples/include/ignite/examples/organization.h +++ b/modules/platforms/cpp/examples/include/ignite/examples/organization.h @@ -68,48 +68,46 @@ namespace ignite template<> struct BinaryType { - int32_t GetTypeId() + static int32_t GetTypeId() { return GetBinaryStringHashCode("Organization"); } - std::string GetTypeName() + static void GetTypeName(std::string& dst) { - return "Organization"; + dst = "Organization"; } - int32_t GetFieldId(const char* name) + static int32_t GetFieldId(const char* name) { return GetBinaryStringHashCode(name); } - int32_t GetHashCode(ignite::examples::Organization obj) + static int32_t GetHashCode(ignite::examples::Organization obj) { return 0; } - bool IsNull(ignite::examples::Organization obj) + static bool IsNull(ignite::examples::Organization obj) { return false; } - ignite::examples::Organization GetNull() + static void GetNull(ignite::examples::Organization& dst) { - return ignite::examples::Organization("", ignite::examples::Address()); + dst = ignite::examples::Organization("", ignite::examples::Address()); } - void Write(BinaryWriter& writer, ignite::examples::Organization obj) + static void Write(BinaryWriter& writer, const ignite::examples::Organization& obj) { writer.WriteString("name", obj.name); writer.WriteObject("addr", obj.addr); } - ignite::examples::Organization Read(BinaryReader& reader) + static void Read(BinaryReader& reader, ignite::examples::Organization& dst) { - std::string name = reader.ReadString("name"); - ignite::examples::Address addr = reader.ReadObject("addr"); - - return ignite::examples::Organization(name, addr); + dst.name = reader.ReadString("name"); + dst.addr = reader.ReadObject("addr"); } }; } http://git-wip-us.apache.org/repos/asf/ignite/blob/02427284/modules/platforms/cpp/examples/include/ignite/examples/person.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h index 64693a9..9a87ef2 100644 --- a/modules/platforms/cpp/examples/include/ignite/examples/person.h +++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h @@ -82,7 +82,7 @@ namespace ignite IGNITE_BINARY_IS_NULL_FALSE(Person) IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person) - void Write(BinaryWriter& writer, ignite::examples::Person obj) + static void Write(BinaryWriter& writer, const ignite::examples::Person& obj) { writer.WriteInt64("orgId", obj.orgId); writer.WriteString("firstName", obj.firstName); @@ -91,15 +91,13 @@ namespace ignite writer.WriteDouble("salary", obj.salary); } - ignite::examples::Person Read(BinaryReader& reader) + static void Read(BinaryReader& reader, ignite::examples::Person& dst) { - int64_t orgId = reader.ReadInt64("orgId"); - std::string firstName = reader.ReadString("firstName"); - std::string lastName = reader.ReadString("lastName"); - std::string resume = reader.ReadString("resume"); - double salary = reader.ReadDouble("salary"); - - return ignite::examples::Person(orgId, firstName, lastName, resume, salary); + dst.orgId = reader.ReadInt64("orgId"); + dst.firstName = reader.ReadString("firstName"); + dst.lastName = reader.ReadString("lastName"); + dst.resume = reader.ReadString("resume"); + dst.salary = reader.ReadDouble("salary"); } IGNITE_BINARY_TYPE_END