diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-12-18 11:40:52 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-12-18 11:40:52 -0800 |
commit | bb303513dce4e78d898035b9f7f5ae11b7b452dd (patch) | |
tree | 708cacfd6a93bdfff3fa76e813afe909f3e62fe6 /include/grpcpp/impl/codegen/byte_buffer.h | |
parent | 00c9c40004d011f01c72d253a530edb3364992bf (diff) | |
parent | d198607457a6f5d47e8c134277ebfe3706f9476b (diff) |
Merge master
Diffstat (limited to 'include/grpcpp/impl/codegen/byte_buffer.h')
-rw-r--r-- | include/grpcpp/impl/codegen/byte_buffer.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/grpcpp/impl/codegen/byte_buffer.h b/include/grpcpp/impl/codegen/byte_buffer.h index abba5549b8..a77e36dfc5 100644 --- a/include/grpcpp/impl/codegen/byte_buffer.h +++ b/include/grpcpp/impl/codegen/byte_buffer.h @@ -45,8 +45,10 @@ template <class ServiceType, class RequestType, class ResponseType> class RpcMethodHandler; template <class ServiceType, class RequestType, class ResponseType> class ServerStreamingHandler; -template <class ServiceType, class RequestType, class ResponseType> +template <class RequestType, class ResponseType> class CallbackUnaryHandler; +template <class RequestType, class ResponseType> +class CallbackServerStreamingHandler; template <StatusCode code> class ErrorMethodHandler; template <class R> @@ -91,7 +93,9 @@ class ByteBuffer final { } /// Constuct a byte buffer by referencing elements of existing buffer - /// \a buf. Wrapper of core function grpc_byte_buffer_copy + /// \a buf. Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. ByteBuffer(const ByteBuffer& buf); ~ByteBuffer() { @@ -100,6 +104,9 @@ class ByteBuffer final { } } + /// Wrapper of core function grpc_byte_buffer_copy . This is not + /// a deep copy; it is just a referencing. As a result, its performance is + /// size-independent. ByteBuffer& operator=(const ByteBuffer&); /// Dump (read) the buffer contents into \a slices. @@ -115,7 +122,9 @@ class ByteBuffer final { /// Make a duplicate copy of the internals of this byte /// buffer so that we have our own owned version of it. - /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable + /// bbuf.Duplicate(); is equivalent to bbuf=bbuf; but is actually readable. + /// This is not a deep copy; it is a referencing and its performance + /// is size-independent. void Duplicate() { buffer_ = g_core_codegen_interface->grpc_byte_buffer_copy(buffer_); } @@ -156,8 +165,10 @@ class ByteBuffer final { friend class internal::RpcMethodHandler; template <class ServiceType, class RequestType, class ResponseType> friend class internal::ServerStreamingHandler; - template <class ServiceType, class RequestType, class ResponseType> + template <class RequestType, class ResponseType> friend class internal::CallbackUnaryHandler; + template <class RequestType, class ResponseType> + friend class ::grpc::internal::CallbackServerStreamingHandler; template <StatusCode code> friend class internal::ErrorMethodHandler; template <class R> |