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 8DD4B200CBE for ; Fri, 7 Jul 2017 12:21:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8C668168C72; Fri, 7 Jul 2017 10:21:04 +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 D39E3168C6F for ; Fri, 7 Jul 2017 12:21:03 +0200 (CEST) Received: (qmail 64529 invoked by uid 500); 7 Jul 2017 10:21:03 -0000 Mailing-List: contact issues-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list issues@geode.apache.org Received: (qmail 64512 invoked by uid 99); 7 Jul 2017 10:21:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2017 10:21:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 987081A08C7 for ; Fri, 7 Jul 2017 10:21:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id SrcCJ_-ZDq6T for ; Fri, 7 Jul 2017 10:21:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2A60B5F60D for ; Fri, 7 Jul 2017 10:21:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7324AE00A0 for ; Fri, 7 Jul 2017 10:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2A8BB20D1F for ; Fri, 7 Jul 2017 10:21:00 +0000 (UTC) Date: Fri, 7 Jul 2017 10:21:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-3019) Refactor Struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 07 Jul 2017 10:21:04 -0000 [ https://issues.apache.org/jira/browse/GEODE-3019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077918#comment-16077918 ] ASF GitHub Bot commented on GEODE-3019: --------------------------------------- Github user pivotal-jbarrett commented on a diff in the pull request: https://github.com/apache/geode-native/pull/107#discussion_r126115701 --- Diff: src/cppcache/include/geode/Struct.hpp --- @@ -138,7 +138,7 @@ class CPPCACHE_EXPORT Struct : public Serializable { * Returns the name of the field corresponding to the index number in the * Struct */ - virtual const char* getFieldName(const int32_t index) const; + virtual const std::string* getFieldName(const int32_t index) const; --- End diff -- I am too not a huge fan of returning `std::string*` but the current behavior is to return `nullptr` if the field does not exist at that index. @dgkimura would you be happier if this method threw [`out_of_range`](http://en.cppreference.com/w/cpp/error/out_of_range)? I think I might like that better than null. > Refactor Struct > --------------- > > Key: GEODE-3019 > URL: https://issues.apache.org/jira/browse/GEODE-3019 > Project: Geode > Issue Type: Task > Components: native client > Reporter: Jacob S. Barrett > > Refactor Struct (geode/Struct.hpp): > * Replace {{char *}} with {{std::string}} > * Replace {{m_fieldname}} type with {{std::unordered_map}} > * Add vector for index to field name lookup. -- This message was sent by Atlassian JIRA (v6.4.14#64029)