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

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

Github user szenker commented on the pull request:

    https://github.com/apache/thrift/pull/798#issuecomment-173337036
  
    Adding the const keyword is not just syntactical sugar. It requires users 
which derive from TTransport to be more strict when they implement their own 
version of isOpen() and getOrigin() as it enforces them to not alter the 
internal state of their custom TTransport implementation when we are calling 
one of those methods from the Thrift C++ library. So from the Thrift library 
point of view, we can refactor the C++ library and call isOpen() more or less 
often without introducing side effects in the users code. peek() should be also 
const in my opinion, as it should return true in case data is available for 
reading.
    
    @hcorg: I took a quick look into your fork on github (cpp_v2). I really 
like the way how you refactored the c++ code generator. How can I get involved 
in the refactoring of the cpp_v2 library / compiler? Especially I'm interested 
in supporting to refactor the asynchronous client and server. E.g. to add 
exception support and the ability to do pipelining.


> C++ TTransport::isOpen() and TTransport::getOrigin() should be const member 
> functions
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3560
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3560
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.9.3, 0.9.4, 1.0
>            Reporter: Sebastian Zenker
>            Priority: Minor
>              Labels: easyfix
>
> ... as they should not alter the state of TTransport. Also peek() should be 
> const in my opinion, but this requires some more refactoring.



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

Reply via email to