[
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<std::string,
> int32_t>}}
> * Add vector for index to field name lookup.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)