You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2016/02/23 21:47:18 UTC
[jira] [Commented] (THRIFT-1372) Incorrect skeleton code generated
for services that extend another service
[ https://issues.apache.org/jira/browse/THRIFT-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15159616#comment-15159616 ]
Jens Geyer commented on THRIFT-1372:
------------------------------------
Related: http://stackoverflow.com/q/35573286/499466
I think, the real question here is: Do we need these skeletons at all? C++ is the only language supporting this (AFAIK) and this ticket now lives for nearly 5 years.
Why don't we just drop skeletons?
> Incorrect skeleton code generated for services that extend another service
> --------------------------------------------------------------------------
>
> Key: THRIFT-1372
> URL: https://issues.apache.org/jira/browse/THRIFT-1372
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Compiler
> Affects Versions: 0.8
> Reporter: Jens Geyer
>
> {code}
> service Calculator extends shared.SharedService {
> void ping(),
> i32 add(1:i32 num1, 2:i32 num2),
> i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),
> oneway void zip()
> }
> {code}
> which extends
> {code}
> service SharedService {
> SharedStruct getStruct(1: i32 key)
> }
> {code}
> The generated server skeleton class CalculatorHandler inherits ONLY from CalculatorIf, which correctly inherits from SharedServiceIf, and thus the CalculatorHandler looks like this (less interesting stuff omitted):
> {code}
> class CalculatorHandler : virtual public CalculatorIf {
> public:
> CalculatorHandler();
> void ping();
> int32_t add(const int32_t num1, const int32_t num2);
> int32_t calculate(const int32_t logid, const Work& w);
> void zip();
> };
> {code}
> From my understanding, the class should also implement the getStruct() member. Otherwise the inheritance from SharedService seems not to make much sense. In contrast, the CalculatorNull class inherits the getStruct() member from SharedServiceNull, which is what one would expect.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)