19 #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
20 #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
35 template <
class RequestType,
class ResponseType>
36 class CallbackUnaryHandler;
37 template <
class RequestType,
class ResponseType>
38 class CallbackServerStreamingHandler;
39 template <
class ServiceType,
class RequestType,
class ResponseType>
41 template <
class ServiceType,
class RequestType,
class ResponseType>
43 template <::grpc::StatusCode code>
51 class ServerInterface;
53 class ServerInterface;
56 class CallOpSendMessage;
58 class CallOpRecvMessage;
59 class CallOpGenericRecvMessage;
60 class ExternalConnectionAcceptorImpl;
62 class DeserializeFuncType;
63 class GrpcByteBufferPeer;
77 static_assert(std::is_same<decltype(slices[0].slice_),
grpc_slice>::value,
78 "Slice must have same representation as grpc_slice");
80 "Slice must have same representation as grpc_slice");
85 "ByteBuffer must have same representation as "
88 "ByteBuffer must have same representation as "
150 return buffer_ ==
nullptr
158 other->buffer_ = buffer_;
163 bool Valid()
const {
return (buffer_ !=
nullptr); }
172 template <
class ServiceType,
class RequestType,
class ResponseType>
174 template <
class ServiceType,
class RequestType,
class ResponseType>
176 template <
class RequestType,
class ResponseType>
177 friend class ::grpc_impl::internal::CallbackUnaryHandler;
178 template <
class RequestType,
class ResponseType>
179 friend class ::grpc_impl::internal::CallbackServerStreamingHandler;
180 template <StatusCode code>
202 class ByteBufferPointer {
213 ByteBufferPointer bbuf_ptr()
const {
return ByteBufferPointer(
this); }
220 dest->set_buffer(byte_buffer->buffer_);
A sequence of bytes.
Definition: byte_buffer.h:67
void Clear()
Remove all data.
Definition: byte_buffer.h:128
friend class internal::GrpcByteBufferPeer
Definition: byte_buffer.h:186
size_t Length() const
Buffer size in bytes.
Definition: byte_buffer.h:149
void Duplicate()
Make a duplicate copy of the internals of this byte buffer so that we have our own owned version of i...
Definition: byte_buffer.h:140
void Swap(ByteBuffer *other)
Swap the state of *this and *other.
Definition: byte_buffer.h:156
ByteBuffer(const ByteBuffer &buf)
Constuct a byte buffer by referencing elements of existing buffer buf.
Definition: byte_buffer.h:102
friend class internal::ExternalConnectionAcceptorImpl
Definition: byte_buffer.h:187
ByteBuffer(const Slice *slices, size_t nslices)
Construct buffer from slices, of which there are nslices.
Definition: byte_buffer.h:73
ByteBuffer()
Constuct an empty buffer.
Definition: byte_buffer.h:70
Status Dump(std::vector< Slice > *slices) const
Dump (read) the buffer contents into slices.
void Release()
Forget underlying byte buffer without destroying Use this only for un-owned byte buffers.
Definition: byte_buffer.h:146
bool Valid() const
Is this ByteBuffer valid?
Definition: byte_buffer.h:163
~ByteBuffer()
Definition: byte_buffer.h:104
ByteBuffer & operator=(const ByteBuffer &buf)
Wrapper of core function grpc_byte_buffer_copy .
Definition: byte_buffer.h:113
virtual grpc_byte_buffer * grpc_byte_buffer_copy(grpc_byte_buffer *bb)=0
virtual grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slice, size_t nslices)=0
virtual const Status & ok()=0
virtual void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)=0
virtual size_t grpc_byte_buffer_length(grpc_byte_buffer *bb) GRPC_MUST_USE_RESULT=0
This is a specialization of the protobuf class ZeroCopyInputStream The principle is to get one chunk ...
Definition: proto_buffer_reader.h:46
This is a specialization of the protobuf class ZeroCopyOutputStream.
Definition: proto_buffer_writer.h:53
static Status Deserialize(ByteBuffer *byte_buffer, ByteBuffer *dest)
Definition: byte_buffer.h:219
static Status Serialize(const ByteBuffer &source, ByteBuffer *buffer, bool *own_buffer)
Definition: byte_buffer.h:223
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
Definition: server_interface.h:59
A wrapper around grpc_slice.
Definition: slice.h:35
Did it work? If it didn't, why?
Definition: status.h:31
static const Status & OK
An OK pre-defined instance.
Definition: status.h:105
Definition: call_op_set.h:514
Definition: call_op_set.h:422
Definition: call_op_set.h:286
Definition: call_op_set.h:501
::grpc_impl::internal::ServerStreamingHandler< ServiceType, RequestType, ResponseType > ServerStreamingHandler
Definition: method_handler.h:46
::grpc_impl::internal::RpcMethodHandler< ServiceType, RequestType, ResponseType > RpcMethodHandler
Definition: method_handler.h:36
::grpc_impl::internal::ErrorMethodHandler< code > ErrorMethodHandler
Definition: method_handler.h:62
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
CoreCodegenInterface * g_core_codegen_interface
Definition: completion_queue_impl.h:90
Definition: grpc_types.h:40
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60