[jira] [Closed] (THRIFT-1712) Add TBase class for c++

2015-08-31 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt closed THRIFT-1712.
---
Resolution: Won't Fix

I'm still working on such an approach, but it will be different.

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 000_line_first_140628v1.patch, 
> 010_base_struct_gen_140629v1.patch, 011_base_struct_rest_140619v2.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (THRIFT-2296) Add C++ Base class for service

2015-08-31 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt resolved THRIFT-2296.
-
Resolution: Invalid

I'm still working on it. But with another approach.
This approach wasn't useful.

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch, 
> 020_base_service_140303v6.patch, 020_base_service_140619v2.patch, 
> 021_base_service_rest_140619v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-29 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 011_base_struct_rest_140619v2.patch

A default implementation : TBaseStruct.h

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 000_line_first_140628v1.patch, 
> 010_base_struct_gen_140629v1.patch, 011_base_struct_rest_140619v2.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-29 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 010_base_struct_gen_140629v1.patch

When using the last patch, I found out that I need the classname of
the baseclass, only having the derived string is not enough.

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 000_line_first_140628v1.patch, 
> 010_base_struct_gen_140629v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-29 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 010_base_struct_gen_140628v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 000_line_first_140628v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 010_base_struct_gen_140628v1.patch
000_line_first_140628v1.patch

>Henrique Mendonça added a comment - 24/Jun/14 10:01:
>Thanks for your patches! Contribution is what we need, but please try to 
>add at least one test case on each patch and for each variant you are 
>>proposing. 

Thanks for the feedback. I will add a test case.
Additionally I have reworked the patch, the current
 version has a new approach:

- It needs less changes to the code
- It is more generic

The "line_first" modifier allows to set a custom include path and the 
base_struct modifier adds a given string at the right place.
Both options are "always on", but in the default case only
insert a "comment" /* xyz modifier off */

regards,

Martin




> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 000_line_first_140628v1.patch, 
> 010_base_struct_gen_140628v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 010_base_struct_gen_140619v3.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Description: 
The generated c++ classes for struct's do not have a common base class.

The patch adds two options to the compiler:

- line_first : first line before all includes
- base_struct : custom base class for structs

For example:

{code:title=MyService.thrift}
struct MyStruct {
   1:i32 val;
}
service MyService {
   void doSomething();
}
{code}

thrift --gen cpp:line_first='#include ',base_struct=':public 
TBase' ./MyService.thrift

{code:title=MyService_types.h}
#ifndef MyService_TYPES_H
#define MyService_TYPES_H

#include 
#include 
[]
class MyStruct:public TBase {
[...]
{code}

The default, without any option:

thrift --gen cpp ./MyService.thrift

{code:title=MyService_types.h}
#ifndef MyService_TYPES_H
#define MyService_TYPES_H

/* first line (modifier:off) */
#include 
[]
class MyStruct /* base_struct (modifier:off) */ {
[...

{code}


The idea is to have a base class for typecasting, which can be done with:

{code}
void processSignal(const TBase& tBase) {
  if (typeid(tBase).name() == typeid(MyStruct).name()) 
printf("MyStruct found!\n")
 
{code}


  was:
The generated c++ classes for struct's do not have a common base class.

The patch adds a "base_struct" option to the compiler:

- thrift --gen cpp:base_struct

this will use a TBaseStruct in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"

With this it's possible to extend the TBaseStruct class in the thrift 
installation.

I like to use this TBase class in QT, as a signal, for example:

{quote}
signals:
   void update(const TBase& tBase);
{quote}

And in the receiver slot I then can check which kind of message was send:
{quote}
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
User* user=(User*)&tBase;
processUserMessage(user);
   \}

{quote}


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 011_base_struct_rest_140619v2.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds two options to the compiler:
> - line_first : first line before all includes
> - base_struct : custom base class for structs
> For example:
> {code:title=MyService.thrift}
> struct MyStruct {
>1:i32 val;
> }
> service MyService {
>void doSomething();
> }
> {code}
> thrift --gen cpp:line_first='#include ',base_struct=':public 
> TBase' ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> #include 
> #include 
> []
> class MyStruct:public TBase {
> [...]
> {code}
> The default, without any option:
> thrift --gen cpp ./MyService.thrift
> {code:title=MyService_types.h}
> #ifndef MyService_TYPES_H
> #define MyService_TYPES_H
> /* first line (modifier:off) */
> #include 
> []
> class MyStruct /* base_struct (modifier:off) */ {
> [...
> {code}
> The idea is to have a base class for typecasting, which can be done with:
> {code}
> void processSignal(const TBase& tBase) {
>   if (typeid(tBase).name() == typeid(MyStruct).name()) 
> printf("MyStruct found!\n")
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2515) TLS Method error during make

2014-06-23 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2515:


Attachment: no_tls1_2.patch

Simple patch which disable TLSv_1_2+TLSv_1_1
But because newer distributions have this support its
not necessary to apply it.


> TLS Method error during make
> 
>
> Key: THRIFT-2515
> URL: https://issues.apache.org/jira/browse/THRIFT-2515
> Project: Thrift
>  Issue Type: Bug
>  Components: Build Process
>Reporter: Mike Winkelmann
>Assignee: Roger Meier
> Attachments: no_tls1_2.patch
>
>
> Hi,
> currently I have checked out the git repository in revision 
> 37042270ef670aad7b11c94e31bafc9d84092d76. I have checked out the repository 
> because in some forum thread I have read, that my error was resolved in the 
> git repo.
> My Problem is, that I get following errors due the make process:
> src/thrift/transport/TSSLSocket.cpp:73:24: error: use of undeclared 
> identifier 'TLSv1_1_method'; did you
>   mean 'TLSv1_method'?
> ctx_ = SSL_CTX_new(TLSv1_1_method());
>^~
>TLSv1_method
> src/thrift/transport/TSSLSocket.cpp:77:24: error: use of undeclared 
> identifier 'TLSv1_2_method'; did you
>   mean 'TLSv1_method'?
> ctx_ = SSL_CTX_new(TLSv1_2_method());
>^~
>TLSv1_method
> I have done following:
> ./configure CXXFLAGS='-g -O2'
> ./configure CFLAGS='-g -O2'
> ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
> make
> Thereafter I have got these two errors.
> Can someone help me and make a statement weather the bug is fixed ?
> Thanks and regards



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (THRIFT-2220) Add a new struct structv?

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt closed THRIFT-2220.
---

Resolution: Not a Problem

This was an early idea, as it turned out I don't needed this.

> Add a new struct structv?
> -
>
> Key: THRIFT-2220
> URL: https://issues.apache.org/jira/browse/THRIFT-2220
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Minor
>
> Thrift cannot extend structs, but maybe its possible to add a virtual base 
> struct?
> Today I updated the "TBase" patch for gen cpp.
> https://issues.apache.org/jira/browse/THRIFT-1712
> After that, I modified the compiler to accept a new struct type, which
> describes that the marshalled struct needs to be created before the
> read(iproto) starts. (write already is fine, because on writing the 
> specialized class is already created, only the "read" needs some factory, for 
> the real implementation)
> For example:
> {code}
> struct_v TMVBase<<-- struct_v tell the generator to created the
> TBase class with a factory ("v" 
> for virtual)
> service USB {
>void martin(1:TMVBase base);
> }
> {code}
> This is then generated into someting like this:
> {code}
> uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
> [...]
> switch (fid)   {
>   case 1:
> if (ftype == ::apache::thrift::protocol::T_STRUCT) {
>   // TBase struct create:this->base
>   this->base=TMVBase::create(iprot);
>   xfer += this->base->read(iprot);
>   this->__isset.base = true;
> } else {
>   xfer += iprot->skip(ftype);
> }
> break
> [..]
> {code}
> This would allow to create the derived classed (from TBase) during marshall, 
> without the need to define every method with any possible struct. Curently I 
> have modified thrifty.yy and some other things, so that
> yacc actually parse this new "struct_v" type. But the generated source
> for it needs to be changed some more.
> The Protocolhandlers need to write the struct name on the
> wire, of course (which they currenty don' do).
>  I think I can make a working prototype and post the patch.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2295) Make "oneway" more generic

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2295:


Attachment: (was: functionModifiers131227v1.patch)

> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: 040_functionModifiers140619v1.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2295) Make "oneway" more generic

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2295:


Attachment: 040_functionModifiers140619v1.patch

Updated against current git. Although the old one still should work.

The patch works fine here, tested with C# (Linux,Win) 
and C++ additionally it adds nothing new, 
but cleans up the code a bit (IMHO)




> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: 040_functionModifiers140619v1.patch, 
> functionModifiers131227v1.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: 021_base_service_rest_140619v1.patch
020_base_service_140619v2.patch

This updates the "base class for services" patch. 

changes:

-  id string is removed

But it turns out that this is not a good idea. 
I used the id to announce the services at a "broker" server.

And now the names look like 13ShmServer, which is the
mangled name. So I think that the servicename would be
a nice information in the base class. Additionally the 
base class has a "role", which is a hint what the implementation
can handle, so the broker sees that client X is connected to service Y.

So I think, having the servicename in the base class would be
useful.

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch, 
> 020_base_service_140303v6.patch, 020_base_service_140619v2.patch, 
> 021_base_service_rest_140619v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 011_base_struct_rest_140619v2.patch
010_base_struct_gen_140619v3.patch

This is an updated patch. It now removes the id string,
because the same can be achieved with typeid(var/class).name().
(Not completely, the name is "ugly"/mangled, but for type casting
this is ok).
The patch is now nearly identical to the version in 
https://issues.apache.org/jira/browse/THRIFT-2255

except:
a) its a compile time option
b) the base class can be configured/replaced at compile time

I would vote for "a" and "b" is only a feature which seems
to be useful for a base _service_ class, but not for a "struct".
I can prepare an update for a+b, in this case the patch _is_ identical to
"2255" except the different class names :)


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140619v3.patch, 
> 011_base_struct_rest_140619v2.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 011_base_struct_rest_140126v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 011_base_struct_rest_140302v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 010_base_struct_gen_140302v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-06-19 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 010_base_struct_gen_140126v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (THRIFT-1712) Add TBase class for c++

2014-06-10 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-1712:
-

Hello,

I have already ported this patch to the latest cpp generator changes,
the current one would not apply cleanly.

But what would be nice, if the same can be accomplished with typeid,
so there is no need to generate the classname as ASCII.

But currently I have not tested it. 
Maybe I give it a try this weekend.

regards,

Martin


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 010_base_struct_gen_140302v1.patch, 011_base_struct_rest_140126v1.patch, 
> 011_base_struct_rest_140302v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (THRIFT-2567) Csharp slow ?

2014-06-10 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2567:
-


Hello Jens,

>Jens Geyer added a comment - Yesterday 12:24
>really appreciate your work on this. Could you format the changes as a >patch 
>file, alternatively a GitHub pull request when you think it's ready to be 
>>reviewed?

There isn't an issue with with thrift. It was some performance
analysis. Luckily thrift in c# makes it easy to overwrite the
generated processor implementation, so that some tweaking
is possible.
Additionally I found the attached ArrayAsBytes.cs helpful, which
allows to cast a float[] array to a byte[] binary stream array. So there is
no need to call Buffer.BlockCopy from the thrift "byte layer" to
a float[] / vertex layer.
Overall, it looks, that mono on linux seems to be twice as fast as windows
(for the localhost communication)

regards,

Martin


> Csharp slow ?
> -
>
> Key: THRIFT-2567
> URL: https://issues.apache.org/jira/browse/THRIFT-2567
> Project: Thrift
>  Issue Type: Question
>  Components: C# - Library
>Affects Versions: 1.0
>Reporter: Martin Vogt
>Assignee: Jens Geyer
>Priority: Minor
> Attachments: ArrayAsByte.cs, Client.cs, Server.cs
>
>
> Hello,
> I have a simple csharp server/client for performance tests,
> something like this
> {quote}
> service {
>  binary getData();
> }
> {quote}
> which returns a 1MB buffer.(git snapshot from a few days ago).
> A thrift call client->server takes 8ms
> according to stopWatch.Elapsed. The same client->server 
> implemented from here(modified  of course):
> {quote}
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
> {quote}
> takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
> connections on windows)
> I tried to narrow it down where the actual problem is, but without
> luck so far.
> - Its not the binary stream creation during unmarshall:
> {quote}
> // pseudocode
>  byte[] getData() {
>   len=iprot.readi32()
>   byte[] x=new byte[len]
>   iprot.readAll(x,len);
>  return x;
> }
> {quote}
>  
> It _looks_ that its in the thrift c# library classes (TSocket,etc..),
> but up to now I haven't found an explanation for the  
> differences.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2567) Csharp slow ?

2014-06-10 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2567:


Attachment: ArrayAsByte.cs

Fast/ugly conversion from float[] to byte[] without the need for /unsafe

> Csharp slow ?
> -
>
> Key: THRIFT-2567
> URL: https://issues.apache.org/jira/browse/THRIFT-2567
> Project: Thrift
>  Issue Type: Question
>  Components: C# - Library
>Affects Versions: 1.0
>Reporter: Martin Vogt
>Assignee: Jens Geyer
>Priority: Minor
> Attachments: ArrayAsByte.cs, Client.cs, Server.cs
>
>
> Hello,
> I have a simple csharp server/client for performance tests,
> something like this
> {quote}
> service {
>  binary getData();
> }
> {quote}
> which returns a 1MB buffer.(git snapshot from a few days ago).
> A thrift call client->server takes 8ms
> according to stopWatch.Elapsed. The same client->server 
> implemented from here(modified  of course):
> {quote}
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
> {quote}
> takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
> connections on windows)
> I tried to narrow it down where the actual problem is, but without
> luck so far.
> - Its not the binary stream creation during unmarshall:
> {quote}
> // pseudocode
>  byte[] getData() {
>   len=iprot.readi32()
>   byte[] x=new byte[len]
>   iprot.readAll(x,len);
>  return x;
> }
> {quote}
>  
> It _looks_ that its in the thrift c# library classes (TSocket,etc..),
> but up to now I haven't found an explanation for the  
> differences.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2567) Csharp slow ?

2014-06-07 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2567:


Attachment: Server.cs
Client.cs

An addition:

Using this with mono/linux the same application transfers
the 12MB not in 12ms but in 2ms :)
(Unfortunately the application has to run under windows)
Hm. Maybe I should debug a bit more, to have at least the 
same performance as in linux.


> Csharp slow ?
> -
>
> Key: THRIFT-2567
> URL: https://issues.apache.org/jira/browse/THRIFT-2567
> Project: Thrift
>  Issue Type: Question
>  Components: C# - Library
>Affects Versions: 1.0
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: Client.cs, Server.cs
>
>
> Hello,
> I have a simple csharp server/client for performance tests,
> something like this
> {quote}
> service {
>  binary getData();
> }
> {quote}
> which returns a 1MB buffer.(git snapshot from a few days ago).
> A thrift call client->server takes 8ms
> according to stopWatch.Elapsed. The same client->server 
> implemented from here(modified  of course):
> {quote}
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
> {quote}
> takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
> connections on windows)
> I tried to narrow it down where the actual problem is, but without
> luck so far.
> - Its not the binary stream creation during unmarshall:
> {quote}
> // pseudocode
>  byte[] getData() {
>   len=iprot.readi32()
>   byte[] x=new byte[len]
>   iprot.readAll(x,len);
>  return x;
> }
> {quote}
>  
> It _looks_ that its in the thrift c# library classes (TSocket,etc..),
> but up to now I haven't found an explanation for the  
> differences.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (THRIFT-2567) Csharp slow ?

2014-06-07 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt resolved THRIFT-2567.
-

Resolution: Fixed

After debugging a while now the performance is the same
for the simple TCP server and thrift server :(
(Both around 20ms for 12MB over localhost)
Its not fast, but its consistent now.




> Csharp slow ?
> -
>
> Key: THRIFT-2567
> URL: https://issues.apache.org/jira/browse/THRIFT-2567
> Project: Thrift
>  Issue Type: Question
>  Components: C# - Library
>Affects Versions: 1.0
>Reporter: Martin Vogt
>Priority: Minor
>
> Hello,
> I have a simple csharp server/client for performance tests,
> something like this
> {quote}
> service {
>  binary getData();
> }
> {quote}
> which returns a 1MB buffer.(git snapshot from a few days ago).
> A thrift call client->server takes 8ms
> according to stopWatch.Elapsed. The same client->server 
> implemented from here(modified  of course):
> {quote}
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
> {quote}
> takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
> connections on windows)
> I tried to narrow it down where the actual problem is, but without
> luck so far.
> - Its not the binary stream creation during unmarshall:
> {quote}
> // pseudocode
>  byte[] getData() {
>   len=iprot.readi32()
>   byte[] x=new byte[len]
>   iprot.readAll(x,len);
>  return x;
> }
> {quote}
>  
> It _looks_ that its in the thrift c# library classes (TSocket,etc..),
> but up to now I haven't found an explanation for the  
> differences.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (THRIFT-2567) Csharp slow ?

2014-06-05 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2567:
---

 Summary: Csharp slow ?
 Key: THRIFT-2567
 URL: https://issues.apache.org/jira/browse/THRIFT-2567
 Project: Thrift
  Issue Type: Question
  Components: C# - Library
Affects Versions: 1.0
Reporter: Martin Vogt
Priority: Minor


Hello,

I have a simple csharp server/client for performance tests,
something like this
{quote}
service {
 binary getData();
}
{quote}

which returns a 1MB buffer.(git snapshot from a few days ago).

A thrift call client->server takes 8ms
according to stopWatch.Elapsed. The same client->server 
implemented from here(modified  of course):

{quote}
http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
{quote}

takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
connections on windows)

I tried to narrow it down where the actual problem is, but without
luck so far.
- Its not the binary stream creation during unmarshall:

{quote}
// pseudocode
 byte[] getData() {
  len=iprot.readi32()
  byte[] x=new byte[len]
  iprot.readAll(x,len);
 return x;
}
{quote}
 
It _looks_ that its in the thrift c# library classes (TSocket,etc..),
but up to now I haven't found an explanation for the  
differences.





--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-03-03 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: 020_base_service_140303v6.patch

Maybe its possible to have a unified base class for structs/services? 
But this patch still adds a new base class.

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch, 
> 020_base_service_140303v6.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-03-03 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 011_base_struct_rest_140302v1.patch
010_base_struct_gen_140302v1.patch

This updates the patch. I'm asking myself if the "id" string is necessary, or 
if this can be accomplished with typeid too.

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 010_base_struct_gen_140302v1.patch, 011_base_struct_rest_140126v1.patch, 
> 011_base_struct_rest_140302v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (THRIFT-2255) add Parent Class for generated Struct class

2014-02-23 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2255:
-

Hello,

I can give an update on this patch:

https://issues.apache.org/jira/browse/THRIFT-1712

This version does not work with exceptions. Additionally I think to remove
the copyTo implementation. It was in the patch since the beginning,
but up to now I haven't used the copy methods, so it does not seem to be usefull
and should be removed.(I will update the patch)


> add Parent Class for generated Struct class
> ---
>
> Key: THRIFT-2255
> URL: https://issues.apache.org/jira/browse/THRIFT-2255
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
> Environment: Linux and Windows
>Reporter: david han
>Assignee: Ben Craig
>  Labels: patch
> Fix For: 0.9.2
>
> Attachments: patch.tar.gz
>
>
> Cpp generated Class of struct dosn't have a parent Class, this will cause the 
> Program hold the Object must be using The instance class direct.
> The parent class may be helper full in for program to process manay type 
> Struct batch.
> I hope the New version of Thrift implement it.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: 020_base_service_140126v1.patch

This puts the default constructor into the implemenation, and
renames the static const char* identifier for the servicename to
"id", like in the TBaseStruct patch.


> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: (was: 020_base_service_140113v1.patch)

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: (was: base_service_131228v1.patch)

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140126v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: base_struct_gen_131228v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 011_base_struct_rest_140126v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: base_struct_rest_131228v1.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 011_base_struct_rest_140126v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 011_base_struct_rest_140126v1.patch
010_base_struct_gen_140126v1.patch


The ascii_fingerprints are not as unique as I thought. I seems that the 
fingerprint is only calculated by the elements in a field, for example
_pargs and _args have the same fingerprint and this can have the same 
fingerprint like an empty method, without any args.

This patch adds another static const char* "id" which is the name of class. 

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 011_base_struct_rest_140126v1.patch, base_struct_gen_131228v1.patch, 
> base_struct_rest_131228v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-01-26 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: 010_base_struct_gen_140113v2.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140126v1.patch, 
> 011_base_struct_rest_140126v1.patch, base_struct_gen_131228v1.patch, 
> base_struct_rest_131228v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2014-01-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: 020_base_service_140113v1.patch

This generates always a default constructor implementation and fixes the 
missing ~ in the TBaseService class.

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: 020_base_service_140113v1.patch, 
> base_service_131228v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2014-01-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: 010_base_struct_gen_140113v2.patch

This patch generates base classes and fingerprints for all structs, including 
_parg, _arg and _result from the function signatures. The "rest" patch does not 
need an update.

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: 010_base_struct_gen_140113v2.patch, 
> base_struct_gen_131228v1.patch, base_struct_rest_131228v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2304) Move client assignments from construtor in method

2013-12-31 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2304:


Attachment: setProto_Client-131231v1.patch

> Move client assignments from construtor in method
> -
>
> Key: THRIFT-2304
> URL: https://issues.apache.org/jira/browse/THRIFT-2304
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: setProto_Client-131231v1.patch
>
>
> The current generated client code in C++ look like this
> (namespace removed, for better formatting):
> {code}
> class MyServiceClient : virtual public MyServiceIf {
>  public:
>   MyServiceClient(shared_ptr< TProtocol> prot) :
> piprot_(prot),
> poprot_(prot) {
> iprot_ = prot.get();
> oprot_ = prot.get();
>   }
>  [...]
> {code}
> The member variables are assigned in the constructor.
> The patch puts the assignment into its own method:
> {code}
> class MyServiceClient : virtual public MyServiceIf {
>  public:
>   MyServiceClient(shared_ptr< TProtocol> prot) {
> setProtocol(prot);
>   }
>   [..]
> private:
>   void setProtocol(shared_ptr< TProtocol> prot) {
>  setProtocol(prot,prot);
>   }
>  void setProtocol(shared<:TProtocol> iprot,shared_ptr oprot) {
> piprot_=iprot;
> poprot_=oprot;
> iprot_ = iprot.get();
> oprot_ = oprot.get();
>   }
> {code}
> This allows to change the TProtocol instance, after the Client creation. 
> (With removing the private field or using a virtual method in a Service base 
> class)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (THRIFT-2304) Move client assignments from construtor in method

2013-12-31 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2304:
---

 Summary: Move client assignments from construtor in method
 Key: THRIFT-2304
 URL: https://issues.apache.org/jira/browse/THRIFT-2304
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Compiler
Affects Versions: 0.9.1
Reporter: Martin Vogt
Priority: Trivial


The current generated client code in C++ look like this
(namespace removed, for better formatting):

{code}
class MyServiceClient : virtual public MyServiceIf {
 public:
  MyServiceClient(shared_ptr< TProtocol> prot) :
piprot_(prot),
poprot_(prot) {
iprot_ = prot.get();
oprot_ = prot.get();
  }
 [...]
{code}

The member variables are assigned in the constructor.
The patch puts the assignment into its own method:

{code}
class MyServiceClient : virtual public MyServiceIf {
 public:
  MyServiceClient(shared_ptr< TProtocol> prot) {
setProtocol(prot);
  }
  [..]
private:
  void setProtocol(shared_ptr< TProtocol> prot) {
 setProtocol(prot,prot);
  }
 void setProtocol(shared<:TProtocol> iprot,shared_ptr oprot) {
piprot_=iprot;
poprot_=oprot;
iprot_ = iprot.get();
oprot_ = oprot.get();
  }
{code}

This allows to change the TProtocol instance, after the Client creation. (With 
removing the private field or using a virtual method in a Service base class)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2013-12-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: (was: base_service_131224v2.patch)

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: base_service_131228v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2013-12-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: base_service_131228v1.patch

-added a service name to the generator

Like in structs, which have the ascii_fingerprint, now every service
has a static service name which can be queried from the base class.

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: base_service_131228v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: base_struct_rest_131228v1.patch
base_struct_gen_131228v1.patch

This splits the patch in two parts:
- _gen contains the modifications to the cpp generator
- _rest contains the testcase and a sample TBaseStruct.h header

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_gen_131228v1.patch, 
> base_struct_rest_131228v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-28 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: base_struct_131224v4.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_gen_131228v1.patch, 
> base_struct_rest_131228v1.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (THRIFT-2295) Make "oneway" more generic

2013-12-27 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2295:
-



>> None = 0x01 ...
>>Only for the Bit-test. (x & 0x0 = 0x0).
>I would expect None to be literally "no bits set".

I have change that, including the uppercase MOD to e_mod,
which looks now more like the other enum implementations.

>>most likely the person who implemented oneway didn't know it too
>Not quite, I think. The keyword oneway lets the code generator behave 
>differently: It omits >the whole recv_Xxx() response part.

Yes, signal/slot have a void return and similar behaviour as "oneway".
Another reason is that some blocking must be avoided.

A client can issue a call to a server and gets some return value, like
{quote}
service MyService {
   i32 getRandom();
}
{quote}

If the server then emits a signal during getRandom and the
client is connected to the signal (+tcp stack full) there
is a deadlock.
So I think, the marshalling must be different for signal/slots too.
But this patch only makes the "oneway" implementation more generic.








> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: functionModifiers131227v1.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2295) Make "oneway" more generic

2013-12-27 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2295:


Attachment: (was: functionModifiers.patch)

> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: functionModifiers131227v1.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2295) Make "oneway" more generic

2013-12-27 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2295:


Attachment: functionModifiers131227v1.patch

changed None->0x0 and renamed MOD to e_mod, which is like the other enums.

> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: functionModifiers.patch, functionModifiers131227v1.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (THRIFT-2295) Make "oneway" more generic

2013-12-25 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2295:
-


Only for the Bit-test. (x & 0x0 = 0x0).
But there is no real reason.

Currently I don't know, these are just experiments, but I like
the idea to connect different services together. For example
to build a filtergraph or MVC.

Hm. I didn't know that these exists, most likely the person
who implemented oneway didn't know it too. Therefore
the reason to make the oneway implementation more generic.


> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: functionModifiers.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: base_service_131224v2.patch

This patch includes the TBaseService.h class

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: base_service_131224v2.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: (was: base_service_131224v1.patch)

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: base_service_131224v2.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Description: 
The generated c++ classes for struct's do not have a common base class.

The patch adds a "base_struct" option to the compiler:

- thrift --gen cpp:base_struct

this will use a TBaseStruct in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"

With this it's possible to extend the TBaseStruct class in the thrift 
installation.

I like to use this TBase class in QT, as a signal, for example:

{quote}
signals:
   void update(const TBase& tBase);
{quote}

And in the receiver slot I then can check which kind of message was send:
{quote}
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
User* user=(User*)&tBase;
processUserMessage(user);
   \}

{quote}

  was:
The generated c++ classes for struct's does not have a common base class.

The patch adds a "base_struct" option to the compiler:

- thrift --gen cpp:base_base

this will use a TBaseStruct in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"

With this it's possible to extend the TBaseStruct class in the thrift 
installation.

I like to use this TBase class in QT, as a signal, for example:

{quote}
signals:
   void update(const TBase& tBase);

And in the receiver slot I then can check which kind of message was send:
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
User* user=(User*)&tBase;
processUserMessage(user);
   }

{quote}


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_131224v4.patch
>
>
> The generated c++ classes for struct's do not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_struct
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> {quote}
> And in the receiver slot I then can check which kind of message was send:
> {quote}
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) \{
> User* user=(User*)&tBase;
> processUserMessage(user);
>\}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Description: 
The generated c++ classes for struct's does not have a common base class.

The patch adds a "base_struct" option to the compiler:

- thrift --gen cpp:base_base

this will use a TBaseStruct in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"

With this it's possible to extend the TBaseStruct class in the thrift 
installation.

I like to use this TBase class in QT, as a signal, for example:

{quote}
signals:
   void update(const TBase& tBase);

And in the receiver slot I then can check which kind of message was send:
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
User* user=(User*)&tBase;
processUserMessage(user);
   }

{quote}

  was:
The generated c++ classes for struct's does not have a common base class.

The patch adds a "base" option to the compiler:

- thrift --gen cpp:base

this will use a TBase in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base=MyBase,inc=\\\n"

With this it's possible to extend the TBase class in the thrift installation.

I like to use this TBase class in QT, as a signal, for example:

signals:
   void update(const TBase& tBase);

And in the receiver slot I then can check which kind of message was send:
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
User* user=(User*)&tBase;
processUserMessage(user);
   }


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_131224v4.patch
>
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base_struct" option to the compiler:
> - thrift --gen cpp:base_base
> this will use a TBaseStruct in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base_struct=MyBase,base_struct_inc=\\\n"
> With this it's possible to extend the TBaseStruct class in the thrift 
> installation.
> I like to use this TBase class in QT, as a signal, for example:
> {quote}
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}
> {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2296) Add C++ Base class for service

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2296:


Attachment: base_service_131224v1.patch

> Add C++ Base class for service
> --
>
> Key: THRIFT-2296
> URL: https://issues.apache.org/jira/browse/THRIFT-2296
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Reporter: Martin Vogt
>Priority: Minor
> Attachments: base_service_131224v1.patch
>
>
> This patch adds the possibilty to have a common base class
> for a service.
> It's against the TBase patch:
> https://issues.apache.org/jira/browse/THRIFT-1712



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (THRIFT-2296) Add C++ Base class for service

2013-12-24 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2296:
---

 Summary: Add C++ Base class for service
 Key: THRIFT-2296
 URL: https://issues.apache.org/jira/browse/THRIFT-2296
 Project: Thrift
  Issue Type: Improvement
  Components: C++ - Compiler
Reporter: Martin Vogt
Priority: Minor



This patch adds the possibilty to have a common base class
for a service.
It's against the TBase patch:

https://issues.apache.org/jira/browse/THRIFT-1712






--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (THRIFT-1712) Add TBase class for c++

2013-12-24 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-1712:
-

reworked version. This one seems actually to compile.

>Could you also have a look at the following comment within t_cpp_generator.cc:
>// TODO(dreiss): Make this an option when thrift structs
>// have a common base class.

I had a look at it, but I have no idea what actually should be done.

>indent() << "} else {" << endl <<
>indent() << "  xfer += iprot->skip(ftype);" << endl <<
>// TODO(dreiss): Make this an option when thrift structs
>// have a common base class.
>// indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" 
><< endl <<
>indent() << "}" << endl <<

The code seems unreleated to a base class.




> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_131224v4.patch
>
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: base_struct_131224v4.patch

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_131224v4.patch
>
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: TBase_reworked_131006.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Assignee: Ben Craig
>Priority: Minor
>  Labels: base, c++, class
> Attachments: base_struct_131224v4.patch
>
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2295) Make "oneway" more generic

2013-12-24 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2295:


Attachment: functionModifiers.patch

make oneway more generic

> Make "oneway" more generic
> --
>
> Key: THRIFT-2295
> URL: https://issues.apache.org/jira/browse/THRIFT-2295
> Project: Thrift
>  Issue Type: Improvement
>  Components: Compiler (General)
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: functionModifiers.patch
>
>
> I'm experimenting with different function modifiers 
> ("oneway","signal","slot", etc...)
> The current code does not make such tests easy, because the "oneway"
> modifier is hardcoded  as bool.
> The following patch improves the optional function modifier to be more 
> generic.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (THRIFT-2295) Make "oneway" more generic

2013-12-24 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2295:
---

 Summary: Make "oneway" more generic
 Key: THRIFT-2295
 URL: https://issues.apache.org/jira/browse/THRIFT-2295
 Project: Thrift
  Issue Type: Improvement
  Components: Compiler (General)
Affects Versions: 0.9.1
Reporter: Martin Vogt
Priority: Trivial


I'm experimenting with different function modifiers 
("oneway","signal","slot", etc...)

The current code does not make such tests easy, because the "oneway"
modifier is hardcoded  as bool.

The following patch improves the optional function modifier to be more generic.





--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (THRIFT-2249) Add SMP Build option to thrift.spec (and three config defines)

2013-11-27 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2249:


Attachment: thrift_spec.patch

Added +  %{?without_java: --without-java } and  %{?without_python:   
--without-python   }  options.

> Add SMP Build option to thrift.spec (and three config defines)
> --
>
> Key: THRIFT-2249
> URL: https://issues.apache.org/jira/browse/THRIFT-2249
> Project: Thrift
>  Issue Type: Improvement
>  Components: Build Process
>Affects Versions: 0.9.1
> Environment: RPM Build
>Reporter: Martin Vogt
>Assignee: Jake Farrell
>Priority: Trivial
> Attachments: thrift_spec.patch
>
>
> Hello,
> the patch improves the .spec file in contrib/.
> - parallel build option
> - add defines
> Tested on OpenSuSe 12.2.
> regards,
> Martin



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-2249) Add SMP Build option to thrift.spec (and three config defines)

2013-11-27 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2249:


Attachment: (was: thrift_spec.patch)

> Add SMP Build option to thrift.spec (and three config defines)
> --
>
> Key: THRIFT-2249
> URL: https://issues.apache.org/jira/browse/THRIFT-2249
> Project: Thrift
>  Issue Type: Improvement
>  Components: Build Process
>Affects Versions: 0.9.1
> Environment: RPM Build
>Reporter: Martin Vogt
>Assignee: Jake Farrell
>Priority: Trivial
>
> Hello,
> the patch improves the .spec file in contrib/.
> - parallel build option
> - add defines
> Tested on OpenSuSe 12.2.
> regards,
> Martin



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (THRIFT-2255) add Parent Class for generated Struct class

2013-11-06 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2255:
-

Hello David,

maybe you take a look at this patch:

https://issues.apache.org/jira/browse/THRIFT-1712

Your approach to always/unconditionally use a base class 
is ok too. But I think that the base class should have
some support from the generator.
Like the ascii_fingerprint, and a copy implementation.
The ascii_fingerprint is very usefully to identify the class,
for runtime casting.


My patch is waiting for some votes since a year or so.


regards,

Martin


> add Parent Class for generated Struct class
> ---
>
> Key: THRIFT-2255
> URL: https://issues.apache.org/jira/browse/THRIFT-2255
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
> Environment: Linux and Windows
>Reporter: david han
>  Labels: patch
> Fix For: 0.8
>
> Attachments: patch.tar.gz
>
>
> Cpp generated Class of struct dosn't have a parent Class, this will cause the 
> Program hold the Object must be using The instance class direct.
> The parent class may be helper full in for program to process manay type 
> Struct batch.
> I hope the New version of Thrift implement it.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-2249) Add SMP Build option to thrift.spec (and three config defines)

2013-11-02 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2249:


Attachment: thrift_spec.patch

> Add SMP Build option to thrift.spec (and three config defines)
> --
>
> Key: THRIFT-2249
> URL: https://issues.apache.org/jira/browse/THRIFT-2249
> Project: Thrift
>  Issue Type: Improvement
>  Components: Build Process
>Affects Versions: 0.9.1
> Environment: RPM Build
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: thrift_spec.patch
>
>
> Hello,
> the patch improves the .spec file in contrib/.
> - parallel build option
> - add defines
> Tested on OpenSuSe 12.2.
> regards,
> Martin



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Created] (THRIFT-2249) Add SMP Build option to thrift.spec (and three config defines)

2013-11-02 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2249:
---

 Summary: Add SMP Build option to thrift.spec (and three config 
defines)
 Key: THRIFT-2249
 URL: https://issues.apache.org/jira/browse/THRIFT-2249
 Project: Thrift
  Issue Type: Improvement
  Components: Build Process
Affects Versions: 0.9.1
 Environment: RPM Build
Reporter: Martin Vogt
Priority: Trivial



Hello,

the patch improves the .spec file in contrib/.

- parallel build option
- add defines

Tested on OpenSuSe 12.2.

regards,

Martin





--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (THRIFT-2220) Add a new struct structv?

2013-10-08 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2220:
-

Hello Henrique,

>It sounds like a nice idea, but have you thought about this on 
> other strongly typed languages, >e.g. Java, C#?
>I think it might get quite tricky to implement but might be doable.

No not yet. My idea is to make my simple API network "aware". It currently
is written in C++/Qt and is a simple message API (see below).
If this is done, my idea is to check a different language binding.
And I don't have the intention to make this struct everywhere available.
(map or part of other structs, etc..)

It should only be in the method signature, and NOT in for example:

// No intention to support this
map map;
struct User {
   string name;
   TBase something;
}

Only in a method for a FieldType eg:

service USB {
   i32 read(i32 vfd ,TBase base)
}

regards,

Martin


My API which should be made network aware:

class TUSB {
 public:
  static TSignal event;

  static in write(int vfd,const TBase& base);
  static int read(int vfd,TBase& base);
};



> Add a new struct structv?
> -
>
> Key: THRIFT-2220
> URL: https://issues.apache.org/jira/browse/THRIFT-2220
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Minor
>
> Thrift cannot extend structs, but maybe its possible to add a virtual base 
> struct?
> Today I updated the "TBase" patch for gen cpp.
> https://issues.apache.org/jira/browse/THRIFT-1712
> After that, I modified the compiler to accept a new struct type, which
> describes that the marshalled struct needs to be created before the
> read(iproto) starts. (write already is fine, because on writing the 
> specialized class is already created, only the "read" needs some factory, for 
> the real implementation)
> For example:
> {code}
> struct_v TMVBase<<-- struct_v tell the generator to created the
> TBase class with a factory ("v" 
> for virtual)
> service USB {
>void martin(1:TMVBase base);
> }
> {code}
> This is then generated into someting like this:
> {code}
> uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
> [...]
> switch (fid)   {
>   case 1:
> if (ftype == ::apache::thrift::protocol::T_STRUCT) {
>   // TBase struct create:this->base
>   this->base=TMVBase::create(iprot);
>   xfer += this->base->read(iprot);
>   this->__isset.base = true;
> } else {
>   xfer += iprot->skip(ftype);
> }
> break
> [..]
> {code}
> This would allow to create the derived classed (from TBase) during marshall, 
> without the need to define every method with any possible struct. Curently I 
> have modified thrifty.yy and some other things, so that
> yacc actually parse this new "struct_v" type. But the generated source
> for it needs to be changed some more.
> The Protocolhandlers need to write the struct name on the
> wire, of course (which they currenty don' do).
>  I think I can make a working prototype and post the patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (THRIFT-2220) Add a new struct structv?

2013-10-08 Thread Martin Vogt (JIRA)

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

Martin Vogt commented on THRIFT-2220:
-

Hello Jens,

>I probably just don't see it, but why do we need a new struct type? 

I don't think that the struct has to be known in the IDL as new type.

But at least for the compiler/generator there has to be an 
"escape identifier" to unmarshall the stream for a particular struct
with a factory helper.

For example I added in t_types.h two new methods set_is_base_Struct(bool flag)
and bool is_baseStruct(). This is currently set during the Thritfy.yy run.

During the generation this identifies the struct as a "virtual" struct. But 
this can
be done (I think) with a name compare during the run of:
 ./thrift --gen cpp:base=TBase.

Then if a struct of this name is found it sets in t_types.h the flag and
then the generation behaves different.
I haven't looked at the source, but I think it can be done in the generator 
alone.

regards,

Martin





> Add a new struct structv?
> -
>
> Key: THRIFT-2220
> URL: https://issues.apache.org/jira/browse/THRIFT-2220
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Minor
>
> Thrift cannot extend structs, but maybe its possible to add a virtual base 
> struct?
> Today I updated the "TBase" patch for gen cpp.
> https://issues.apache.org/jira/browse/THRIFT-1712
> After that, I modified the compiler to accept a new struct type, which
> describes that the marshalled struct needs to be created before the
> read(iproto) starts. (write already is fine, because on writing the 
> specialized class is already created, only the "read" needs some factory, for 
> the real implementation)
> For example:
> {code}
> struct_v TMVBase<<-- struct_v tell the generator to created the
> TBase class with a factory ("v" 
> for virtual)
> service USB {
>void martin(1:TMVBase base);
> }
> {code}
> This is then generated into someting like this:
> {code}
> uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
> [...]
> switch (fid)   {
>   case 1:
> if (ftype == ::apache::thrift::protocol::T_STRUCT) {
>   // TBase struct create:this->base
>   this->base=TMVBase::create(iprot);
>   xfer += this->base->read(iprot);
>   this->__isset.base = true;
> } else {
>   xfer += iprot->skip(ftype);
> }
> break
> [..]
> {code}
> This would allow to create the derived classed (from TBase) during marshall, 
> without the need to define every method with any possible struct. Curently I 
> have modified thrifty.yy and some other things, so that
> yacc actually parse this new "struct_v" type. But the generated source
> for it needs to be changed some more.
> The Protocolhandlers need to write the struct name on the
> wire, of course (which they currenty don' do).
>  I think I can make a working prototype and post the patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-2220) Add a new struct structv?

2013-10-06 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2220:


Issue Type: Improvement  (was: Bug)

> Add a new struct structv?
> -
>
> Key: THRIFT-2220
> URL: https://issues.apache.org/jira/browse/THRIFT-2220
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>
> Thrift cannot extend structs, but maybe its possible to add a virtual base 
> struct?
> Today I updated the "TBase" patch for gen cpp.
> https://issues.apache.org/jira/browse/THRIFT-1712
> After that, I modified the compiler to accept a new struct type, which
> describes that the marshalled struct needs to be created before the
> read(iproto) starts. (write already is fine, because on writing the 
> specialized class is already created, only the "read" needs some factory, for 
> the real implementation)
> For example:
> struct_v TMVBase<<-- struct_v tell the generator to created the
> TBase class with a factory ("v" 
> for virtual)
> service USB {
>void martin(1:TMVBase base);
> }
> This is then generated into someting like this:
> uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
> [...]
> switch (fid)   {
>   case 1:
> if (ftype == ::apache::thrift::protocol::T_STRUCT) {
>   // TBase struct create:this->base
>   this->base=TMVBase::create(iprot);
>   xfer += this->base->read(iprot);
>   this->__isset.base = true;
> } else {
>   xfer += iprot->skip(ftype);
> }
> break
> [..]
> This would allow to create the derived classed (from TBase) during marshall, 
> without the need to define every method with any possible struct. Curently I 
> have modified thrifty.yy and some other things, so that
> yacc actually parse this new "struct_v" type. But the generated source
> for it needs to be changed some more.
> The Protocolhandlers need to write the struct name on the
> wire, of course (which they currenty don' do).
>  I think I can make a working prototype and post the patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-2220) Add a new struct structv?

2013-10-06 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-2220:


Priority: Minor  (was: Major)

> Add a new struct structv?
> -
>
> Key: THRIFT-2220
> URL: https://issues.apache.org/jira/browse/THRIFT-2220
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Compiler
>Affects Versions: 0.9.1
>Reporter: Martin Vogt
>Priority: Minor
>
> Thrift cannot extend structs, but maybe its possible to add a virtual base 
> struct?
> Today I updated the "TBase" patch for gen cpp.
> https://issues.apache.org/jira/browse/THRIFT-1712
> After that, I modified the compiler to accept a new struct type, which
> describes that the marshalled struct needs to be created before the
> read(iproto) starts. (write already is fine, because on writing the 
> specialized class is already created, only the "read" needs some factory, for 
> the real implementation)
> For example:
> struct_v TMVBase<<-- struct_v tell the generator to created the
> TBase class with a factory ("v" 
> for virtual)
> service USB {
>void martin(1:TMVBase base);
> }
> This is then generated into someting like this:
> uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
> [...]
> switch (fid)   {
>   case 1:
> if (ftype == ::apache::thrift::protocol::T_STRUCT) {
>   // TBase struct create:this->base
>   this->base=TMVBase::create(iprot);
>   xfer += this->base->read(iprot);
>   this->__isset.base = true;
> } else {
>   xfer += iprot->skip(ftype);
> }
> break
> [..]
> This would allow to create the derived classed (from TBase) during marshall, 
> without the need to define every method with any possible struct. Curently I 
> have modified thrifty.yy and some other things, so that
> yacc actually parse this new "struct_v" type. But the generated source
> for it needs to be changed some more.
> The Protocolhandlers need to write the struct name on the
> wire, of course (which they currenty don' do).
>  I think I can make a working prototype and post the patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Created] (THRIFT-2220) Add a new struct structv?

2013-10-06 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-2220:
---

 Summary: Add a new struct structv?
 Key: THRIFT-2220
 URL: https://issues.apache.org/jira/browse/THRIFT-2220
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Compiler
Affects Versions: 0.9.1
Reporter: Martin Vogt



Thrift cannot extend structs, but maybe its possible to add a virtual base 
struct?

Today I updated the "TBase" patch for gen cpp.

https://issues.apache.org/jira/browse/THRIFT-1712

After that, I modified the compiler to accept a new struct type, which
describes that the marshalled struct needs to be created before the
read(iproto) starts. (write already is fine, because on writing the specialized 
class is already created, only the "read" needs some factory, for the real 
implementation)

For example:

struct_v TMVBase<<-- struct_v tell the generator to created the
TBase class with a factory ("v" for 
virtual)
service USB {
   void martin(1:TMVBase base);
}

This is then generated into someting like this:

uint32_t USB_martin_args::read(::apache::thrift::protocol::TProtocol* iprot) {
[...]

switch (fid)   {
  case 1:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
  // TBase struct create:this->base
  this->base=TMVBase::create(iprot);
  xfer += this->base->read(iprot);
  this->__isset.base = true;
} else {
  xfer += iprot->skip(ftype);
}
break
[..]
This would allow to create the derived classed (from TBase) during marshall, 
without the need to define every method with any possible struct. Curently I 
have modified thrifty.yy and some other things, so that
yacc actually parse this new "struct_v" type. But the generated source
for it needs to be changed some more.

The Protocolhandlers need to write the struct name on the
wire, of course (which they currenty don' do).
 I think I can make a working prototype and post the patch.






--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-10-06 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: TBase_reworked_131006.patch

Reworked version.

- Added Testcase
- cleanup in TBase

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Priority: Minor
>  Labels: base, c++, class
> Attachments: TBase_reworked_131006.patch
>
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-10-06 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: (was: tbase_cpp.patch)

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2013-10-06 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Description: 
The generated c++ classes for struct's does not have a common base class.

The patch adds a "base" option to the compiler:

- thrift --gen cpp:base

this will use a TBase in the thrift installation.

Another option allows to replace the baseclass with an arbitrary one:

-thrift --gen cpp:base=MyBase,inc=\\\n"

With this it's possible to extend the TBase class in the thrift installation.

I like to use this TBase class in QT, as a signal, for example:

signals:
   void update(const TBase& tBase);

And in the receiver slot I then can check which kind of message was send:
// compare static pointers
if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
User* user=(User*)&tBase;
processUserMessage(user);
   }

  was:The generated c++ classes for struct does not have a common base class.


> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Priority: Minor
>  Labels: base, c++, class
>
> The generated c++ classes for struct's does not have a common base class.
> The patch adds a "base" option to the compiler:
> - thrift --gen cpp:base
> this will use a TBase in the thrift installation.
> Another option allows to replace the baseclass with an arbitrary one:
> -thrift --gen cpp:base=MyBase,inc=\\\n"
> With this it's possible to extend the TBase class in the thrift installation.
> I like to use this TBase class in QT, as a signal, for example:
> signals:
>void update(const TBase& tBase);
> And in the receiver slot I then can check which kind of message was send:
> // compare static pointers
> if (tBase.ascii_fingerprint == User::ascii_fingerprint) {
> User* user=(User*)&tBase;
> processUserMessage(user);
>}



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (THRIFT-1731) error: expected identifier before ‘;’ token

2012-10-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1731:


Attachment: ns2.patch

enhance the empty check+ correct patch.

> error: expected identifier before ‘;’ token
> ---
>
> Key: THRIFT-1731
> URL: https://issues.apache.org/jira/browse/THRIFT-1731
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Compiler
>Affects Versions: 0.9
>Reporter: Martin Vogt
>Priority: Trivial
>  Labels: empty, namespaces
> Attachments: ns2.patch
>
>
> If the .thrift file contains no namespace the cpp generator
> creates a:
> using namespace ;
> line. This does not compile.

--
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


[jira] [Updated] (THRIFT-1731) error: expected identifier before ‘;’ token

2012-10-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1731:


Attachment: (was: ns.patch)

> error: expected identifier before ‘;’ token
> ---
>
> Key: THRIFT-1731
> URL: https://issues.apache.org/jira/browse/THRIFT-1731
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Compiler
>Affects Versions: 0.9
>Reporter: Martin Vogt
>Priority: Trivial
>  Labels: empty, namespaces
>
> If the .thrift file contains no namespace the cpp generator
> creates a:
> using namespace ;
> line. This does not compile.

--
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


[jira] [Updated] (THRIFT-1731) error: expected identifier before ‘;’ token

2012-10-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1731:


Attachment: ns.patch

enhance the empty ns check.

> error: expected identifier before ‘;’ token
> ---
>
> Key: THRIFT-1731
> URL: https://issues.apache.org/jira/browse/THRIFT-1731
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Compiler
>Affects Versions: 0.9
>Reporter: Martin Vogt
>Priority: Trivial
>  Labels: empty, namespaces
> Attachments: ns.patch
>
>
> If the .thrift file contains no namespace the cpp generator
> creates a:
> using namespace ;
> line. This does not compile.

--
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


[jira] [Created] (THRIFT-1731) error: expected identifier before ‘;’ token

2012-10-13 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-1731:
---

 Summary: error: expected identifier before ‘;’ token
 Key: THRIFT-1731
 URL: https://issues.apache.org/jira/browse/THRIFT-1731
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Compiler
Affects Versions: 0.9
Reporter: Martin Vogt
Priority: Trivial


If the .thrift file contains no namespace the cpp generator
creates a:

using namespace ;

line. This does not compile.


--
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


[jira] [Updated] (THRIFT-1730) error: ‘numeric_limits’ is not a member of ‘std’

2012-10-13 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1730:


Attachment: limits.patch

limits is missing

> error: ‘numeric_limits’ is not a member of ‘std’
> 
>
> Key: THRIFT-1730
> URL: https://issues.apache.org/jira/browse/THRIFT-1730
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.9
> Environment: OpenSuSE 11.1
>Reporter: Martin Vogt
>Priority: Trivial
> Attachments: limits.patch
>
>
> Compiler error with current git:
> src/thrift/transport/THttpClient.cpp: In member function ‘virtual void 
> apache::thrift::transport::THttpClient::flush()’:
> src/thrift/transport/THttpClient.cpp:104: error: ‘numeric_limits’ is not a 
> member of ‘std’
> src/thrift/transport/THttpClient.cpp:104: error: expected primary-expression 
> before ‘>’ token
> src/thrift/transport/THttpClient.cpp:104: error: ‘::max’ has not been declared

--
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


[jira] [Created] (THRIFT-1730) error: ‘numeric_limits’ is not a member of ‘std’

2012-10-13 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-1730:
---

 Summary: error: ‘numeric_limits’ is not a member of ‘std’
 Key: THRIFT-1730
 URL: https://issues.apache.org/jira/browse/THRIFT-1730
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.9
 Environment: OpenSuSE 11.1
Reporter: Martin Vogt
Priority: Trivial


Compiler error with current git:

src/thrift/transport/THttpClient.cpp: In member function ‘virtual void 
apache::thrift::transport::THttpClient::flush()’:
src/thrift/transport/THttpClient.cpp:104: error: ‘numeric_limits’ is not a 
member of ‘std’
src/thrift/transport/THttpClient.cpp:104: error: expected primary-expression 
before ‘>’ token
src/thrift/transport/THttpClient.cpp:104: error: ‘::max’ has not been declared


--
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


[jira] [Updated] (THRIFT-1712) Add TBase class for c++

2012-10-05 Thread Martin Vogt (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Vogt updated THRIFT-1712:


Attachment: tbase_cpp.patch

implementation for TBase+generator changes.

> Add TBase class for c++
> ---
>
> Key: THRIFT-1712
> URL: https://issues.apache.org/jira/browse/THRIFT-1712
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Compiler
>Affects Versions: 0.8
>Reporter: Martin Vogt
>Priority: Minor
>  Labels: base, c++, class
> Attachments: tbase_cpp.patch
>
>
> The generated c++ classes for struct does not have a common base class.

--
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


[jira] [Created] (THRIFT-1712) Add TBase class for c++

2012-10-05 Thread Martin Vogt (JIRA)
Martin Vogt created THRIFT-1712:
---

 Summary: Add TBase class for c++
 Key: THRIFT-1712
 URL: https://issues.apache.org/jira/browse/THRIFT-1712
 Project: Thrift
  Issue Type: New Feature
  Components: C++ - Compiler
Affects Versions: 0.8
Reporter: Martin Vogt
Priority: Minor


The generated c++ classes for struct does not have a common base class.

--
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