You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by thrift thrift <th...@gmail.com> on 2010/08/12 02:51:26 UTC
About function Overload in IDL
Hi, all
I made two functions in thrift IDL, which names are
string Execute(1:i32 clientID, 2:string cmd, 3:string param1, 4:string
param2, 5:string param3, 6:string param4) ,
string Execute(1:i32 clientID, 2 string cmd, et:ParamList paramList)
But I found that the generated codes are the same for this two funtions like
below
void process_Execute(int32_t seqid, ::apache::thrift: rotocol::TProtocol*
iprot, ::apache::thrift: rotocol::TProtocol* oprot);
So, Does thrift IDL support function overload? If support, how to do it?
Thanks very much.
Re: About function Overload in IDL
Posted by Bryan Duxbury <br...@rapleaf.com>.
Incidentally, I am about to commit
https://issues.apache.org/jira/browse/THRIFT-570 that deals with this.
On Wed, Aug 11, 2010 at 6:00 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> This is not supported, because many thrift languages can't handle it.
>
> On Aug 11, 2010 5:52 PM, "thrift thrift" <th...@gmail.com> wrote:
> > Hi, all
> > I made two functions in thrift IDL, which names are
> >
> > string Execute(1:i32 clientID, 2:string cmd, 3:string param1, 4:string
> > param2, 5:string param3, 6:string param4) ,
> > string Execute(1:i32 clientID, 2 string cmd, et:ParamList paramList)
> >
> > But I found that the generated codes are the same for this two funtions
> like
> > below
> >
> > void process_Execute(int32_t seqid, ::apache::thrift: rotocol::TProtocol*
> > iprot, ::apache::thrift: rotocol::TProtocol* oprot);
> >
> >
> > So, Does thrift IDL support function overload? If support, how to do it?
> > Thanks very much.
>
Re: About function Overload in IDL
Posted by Jonathan Ellis <jb...@gmail.com>.
This is not supported, because many thrift languages can't handle it.
On Aug 11, 2010 5:52 PM, "thrift thrift" <th...@gmail.com> wrote:
> Hi, all
> I made two functions in thrift IDL, which names are
>
> string Execute(1:i32 clientID, 2:string cmd, 3:string param1, 4:string
> param2, 5:string param3, 6:string param4) ,
> string Execute(1:i32 clientID, 2 string cmd, et:ParamList paramList)
>
> But I found that the generated codes are the same for this two funtions
like
> below
>
> void process_Execute(int32_t seqid, ::apache::thrift: rotocol::TProtocol*
> iprot, ::apache::thrift: rotocol::TProtocol* oprot);
>
>
> So, Does thrift IDL support function overload? If support, how to do it?
> Thanks very much.
RE: About function Overload in IDL
Posted by Mark Slee <ms...@facebook.com>.
No, this is not supported, since not all target languages support function overloading. We should be throwing an error in the compiler if the same method name is detected twice.
-----Original Message-----
From: thrift thrift [mailto:thriftuser@gmail.com]
Sent: Wednesday, August 11, 2010 5:51 PM
To: thrift-user@incubator.apache.org
Subject: About function Overload in IDL
Hi, all
I made two functions in thrift IDL, which names are
string Execute(1:i32 clientID, 2:string cmd, 3:string param1, 4:string
param2, 5:string param3, 6:string param4) ,
string Execute(1:i32 clientID, 2 string cmd, et:ParamList paramList)
But I found that the generated codes are the same for this two funtions like
below
void process_Execute(int32_t seqid, ::apache::thrift: rotocol::TProtocol*
iprot, ::apache::thrift: rotocol::TProtocol* oprot);
So, Does thrift IDL support function overload? If support, how to do it?
Thanks very much.