Go to the documentation of this file.
19 #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
20 #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
35 template <
class RequestType,
class ResponseType>
37 template <
class RequestType,
class ResponseType>
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;
60 class ExternalConnectionAcceptorImpl;
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 "
95 reinterpret_cast<grpc_slice*>(const_cast<Slice*>(slices)), nslices);
125 Status Dump(std::vector<Slice>* slices)
const;
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_);
233 #endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
General method handler class for errors that prevent real method use e.g., handle unknown method by r...
Definition: byte_buffer.h:44
This is a specialization of the protobuf class ZeroCopyOutputStream.
Definition: proto_buffer_writer.h:53
::grpc_impl::internal::RpcMethodHandler< ServiceType, RequestType, ResponseType > RpcMethodHandler
Definition: method_handler.h:36
Definition: call_op_set.h:524
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
This header provides an object that reads bytes directly from a grpc::ByteBuffer, via the ZeroCopyInp...
Definition: alarm.h:24
Definition: call_op_set.h:286
size_t Length() const
Buffer size in bytes.
Definition: byte_buffer.h:149
virtual const Status & ok()=0
ByteBuffer(const Slice *slices, size_t nslices)
Construct buffer from slices, of which there are nslices.
Definition: byte_buffer.h:73
ByteBuffer & operator=(const ByteBuffer &buf)
Wrapper of core function grpc_byte_buffer_copy .
Definition: byte_buffer.h:113
Definition: byte_buffer.h:38
~ByteBuffer()
Definition: byte_buffer.h:104
virtual grpc_byte_buffer * grpc_byte_buffer_copy(grpc_byte_buffer *bb)=0
virtual void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)=0
ByteBuffer()
Constuct an empty buffer.
Definition: byte_buffer.h:70
Did it work? If it didn't, why?
Definition: status.h:31
::grpc_impl::internal::ServerStreamingHandler< ServiceType, RequestType, ResponseType > ServerStreamingHandler
Definition: method_handler.h:46
void Clear()
Remove all data.
Definition: byte_buffer.h:128
static Status Deserialize(ByteBuffer *byte_buffer, ByteBuffer *dest)
Definition: byte_buffer.h:219
Definition: byte_buffer.h:62
Definition: grpc_types.h:40
A sequence of bytes.
Definition: byte_buffer.h:67
static Status Serialize(const ByteBuffer &source, ByteBuffer *buffer, bool *own_buffer)
Definition: byte_buffer.h:223
void Swap(ByteBuffer *other)
Swap the state of *this and *other.
Definition: byte_buffer.h:156
This is a specialization of the protobuf class ZeroCopyInputStream The principle is to get one chunk ...
Definition: proto_buffer_reader.h:46
A wrapper class of an application provided rpc method handler.
Definition: byte_buffer.h:40
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
virtual grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slice, size_t nslices)=0
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:58
friend class internal::GrpcByteBufferPeer
Definition: byte_buffer.h:186
A wrapper around grpc_slice.
Definition: slice.h:35
static const Status & OK
An OK pre-defined instance.
Definition: status.h:105
Status Dump(std::vector< Slice > *slices) const
Dump (read) the buffer contents into slices.
ByteBuffer(const ByteBuffer &buf)
Constuct a byte buffer by referencing elements of existing buffer buf.
Definition: byte_buffer.h:102
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm_impl.h:33
friend class internal::ExternalConnectionAcceptorImpl
Definition: byte_buffer.h:187
bool Valid() const
Is this ByteBuffer valid?
Definition: byte_buffer.h:163
virtual size_t grpc_byte_buffer_length(grpc_byte_buffer *bb) GRPC_MUST_USE_RESULT=0
CoreCodegenInterface * g_core_codegen_interface
Definition: completion_queue_impl.h:93
Definition: byte_buffer.h:36
Definition: byte_buffer.h:58
void Release()
Forget underlying byte buffer without destroying Use this only for un-owned byte buffers.
Definition: byte_buffer.h:146
Definition: server_interface.h:68
::grpc_impl::internal::ErrorMethodHandler< code > ErrorMethodHandler
Definition: method_handler.h:62
A wrapper class of an application provided server streaming handler.
Definition: byte_buffer.h:42