You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roger Meier (JIRA)" <ji...@apache.org> on 2012/10/07 21:56:03 UTC
[jira] [Commented] (THRIFT-539) struct hash and print methods for
C++
[ https://issues.apache.org/jira/browse/THRIFT-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471305#comment-13471305 ]
Roger Meier commented on THRIFT-539:
------------------------------------
rebase or Won't fix ?
> struct hash and print methods for C++
> -------------------------------------
>
> Key: THRIFT-539
> URL: https://issues.apache.org/jira/browse/THRIFT-539
> Project: Thrift
> Issue Type: New Feature
> Components: C++ - Compiler, C++ - Library
> Reporter: Nitay Joffe
> Priority: Minor
> Attachments: thrift-539.patch
>
>
> The current thrift compiler for C++ generates methods for structs like operator== and operator< since it uses maps,sets, etc but it does not generate a hash() method or a human readable print() method.
> The idea of this issue is to add functionality to the C++ compiler to generate:
> # A boost hash compatible hash_value() function. This should probably be an option to the compiler as it adds a dependency in generated code on boost.
> # An operator<< function for printing structs in a nice form. This should be safe to always do?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] [Commented] (THRIFT-539) struct hash and print methods for C++
Posted by Henrique Mendonça <he...@apache.org>.
That would be awesome Martin!
Thank you already,
Henrique
On 8 October 2012 14:01, Martin Vogt <mv...@gmail.com> wrote:
> On Sun, Oct 7, 2012 at 9:56 PM, Roger Meier (JIRA) <ji...@apache.org> wrote:
>>> The current thrift compiler for C++ generates methods for structs like operator== and operator< since it uses maps,sets, etc but it does not generate a hash() method or a human readable print() method.
>>> The idea of this issue is to add functionality to the C++ compiler to generate:
>>> # A boost hash compatible hash_value() function. This should probably be an option to the compiler as it adds a dependency in generated code on boost.
>>> # An operator<< function for printing structs in a nice form. This should be safe to always do?
>>
>
> I though about printing the struct and add this to the
> next iteration of my TBase patch.
> A print(...) method with pretty prints the struct as as json,
> additionally the compiler should generate a operator= method,
> which copies the object (over serialization, because its available)
>
> regards,
>
> Martin
Re: [jira] [Commented] (THRIFT-539) struct hash and print methods for C++
Posted by Martin Vogt <mv...@gmail.com>.
On Sun, Oct 7, 2012 at 9:56 PM, Roger Meier (JIRA) <ji...@apache.org> wrote:
>> The current thrift compiler for C++ generates methods for structs like operator== and operator< since it uses maps,sets, etc but it does not generate a hash() method or a human readable print() method.
>> The idea of this issue is to add functionality to the C++ compiler to generate:
>> # A boost hash compatible hash_value() function. This should probably be an option to the compiler as it adds a dependency in generated code on boost.
>> # An operator<< function for printing structs in a nice form. This should be safe to always do?
>
I though about printing the struct and add this to the
next iteration of my TBase patch.
A print(...) method with pretty prints the struct as as json,
additionally the compiler should generate a operator= method,
which copies the object (over serialization, because its available)
regards,
Martin