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

ASF GitHub Bot commented on THRIFT-3382:
----------------------------------------

Github user hcorg commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/653#discussion_r42043448
  
    --- Diff: lib/cpp/src/thrift/TBase.h ---
    @@ -0,0 +1,36 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements. See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership. The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License. You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied. See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +#ifndef _THRIFT_TBASE_H_
    +#define _THRIFT_TBASE_H_ 1
    +
    +namespace apache {
    +namespace thrift {
    +
    +class TBase {
    +public:
    +  virtual ~TBase(){};
    +  virtual uint32_t read(::apache::thrift::protocol::TProtocol* iprot) = 0;
    --- End diff --
    
    this header is not self contained - it needs uint32_t and TProtocol 
definitions (for second thing - at least forward decl)


> TBase class for C++ Library
> ---------------------------
>
>                 Key: THRIFT-3382
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3382
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler, C++ - Library
>    Affects Versions: 0.9.3
>            Reporter: Adam Beberg
>            Assignee: Adam Beberg
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Unlike Other languages, C++ is missing a TBase class (the majority of other 
> langugaes call it that) that all generated structs always inherit from. This 
> prevents simple utility functions, and forces ugly template use.
> Something like this:
> {code:title=thtift/TBase.h}
> class TBase {
> public:
>   virtual ~TBase();
>   virtual uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
>   virtual uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
> }
> {code}



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

Reply via email to