[ 
https://issues.apache.org/jira/browse/GEODE-3019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16078231#comment-16078231
 ] 

ASF GitHub Bot commented on GEODE-3019:
---------------------------------------

Github user dgkimura commented on a diff in the pull request:

    https://github.com/apache/geode-native/pull/107#discussion_r126173633
  
    --- 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 --
    
    Yeah, if we consider when field does not exist at index a failure case, 
then I agree that throwing is better than returning `nullptr` and expecting 
someone else to handle it or blow up later.


> 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<std::string, 
> int32_t>}}
> * Add vector for index to field name lookup.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to