Go to the documentation of this file.
19 #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H
20 #define GRPCPP_SUPPORT_BYTE_BUFFER_H
33 class ServerInterface;
35 class ServerInterface;
38 template <
class RequestType,
class ResponseType>
39 class CallbackUnaryHandler;
40 template <
class RequestType,
class ResponseType>
41 class CallbackServerStreamingHandler;
42 template <
class RequestType>
44 template <
class ServiceType,
class RequestType,
class ResponseType>
45 class ServerStreamingHandler;
46 template <grpc::StatusCode code>
47 class ErrorMethodHandler;
48 class CallOpSendMessage;
50 class CallOpRecvMessage;
51 class CallOpGenericRecvMessage;
52 class ExternalConnectionAcceptorImpl;
54 class DeserializeFuncType;
55 class GrpcByteBufferPeer;
59 namespace experimental {
61 template <
class RequestType>
62 class CallbackSessionHandler;
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 "
132 Status Dump(std::vector<Slice>* slices)
const;
161 other->buffer_ = buffer_;
166 bool Valid()
const {
return (buffer_ !=
nullptr); }
175 template <
class RequestType>
178 template <
class ServiceType,
class RequestType,
class ResponseType>
180 template <
class RequestType,
class ResponseType>
182 template <
class RequestType,
class ResponseType>
184 template <
class RequestType>
186 template <StatusCode code>
208 class ByteBufferPointer {
223 ByteBufferPointer bbuf_ptr()
const {
return ByteBufferPointer(
this); }
230 dest->set_buffer(byte_buffer->buffer_);
243 #endif // GRPCPP_SUPPORT_BYTE_BUFFER_H
This is a specialization of the protobuf class ZeroCopyOutputStream.
Definition: proto_buffer_writer.h:56
Definition: call_op_set.h:528
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:147
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
Definition: call_op_set.h:287
size_t Length() const
Buffer size in bytes.
Definition: byte_buffer.h:154
General method handler class for errors that prevent real method use e.g., handle unknown method by r...
Definition: completion_queue.h:81
GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)
Destroys byte_buffer deallocating all its memory.
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
Status DumpToSingleSlice(Slice *slice) const
Dump (read) the buffer contents into slics.
GRPCAPI size_t grpc_byte_buffer_length(grpc_byte_buffer *bb)
Returns the size of the given byte buffer, in bytes.
~ByteBuffer()
Definition: byte_buffer.h:104
ByteBuffer()
Construct an empty buffer.
Definition: byte_buffer.h:70
Did it work? If it didn't, why?
Definition: status.h:34
void * UnaryDeserializeHelper(grpc_byte_buffer *, grpc::Status *, RequestType *)
A helper function with reduced templating to do deserializing.
Definition: method_handler.h:82
void Clear()
Remove all data.
Definition: byte_buffer.h:135
static Status Deserialize(ByteBuffer *byte_buffer, ByteBuffer *dest)
Definition: byte_buffer.h:229
Definition: call_op_set.h:515
Definition: grpc_types.h:41
A sequence of bytes.
Definition: byte_buffer.h:67
Definition: server_callback_handlers.h:37
static Status Serialize(const ByteBuffer &source, ByteBuffer *buffer, bool *own_buffer)
Definition: byte_buffer.h:233
void Swap(ByteBuffer *other)
Swap the state of *this and *other.
Definition: byte_buffer.h:159
This is a specialization of the protobuf class ZeroCopyInputStream The principle is to get one chunk ...
Definition: proto_buffer_reader.h:47
Definition: server_callback_handlers.h:451
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice_type.h:62
Defines how to serialize and deserialize some type.
Definition: serialization_traits.h:63
GRPCAPI grpc_byte_buffer * grpc_byte_buffer_copy(grpc_byte_buffer *bb)
Copies input byte buffer bb.
friend class internal::GrpcByteBufferPeer
Definition: byte_buffer.h:192
A wrapper around grpc_slice.
Definition: slice.h:33
Definition: server_callback_handlers.h:911
A wrapper class of an application provided server streaming handler.
Definition: completion_queue.h:77
static const Status & OK
An OK pre-defined instance.
Definition: status.h:111
Status Dump(std::vector< Slice > *slices) const
Dump (read) the buffer contents into slices.
ByteBuffer(const ByteBuffer &buf)
Construct a byte buffer by referencing elements of existing buffer buf.
Definition: byte_buffer.h:102
friend class internal::ExternalConnectionAcceptorImpl
Definition: byte_buffer.h:193
bool Valid() const
Is this ByteBuffer valid?
Definition: byte_buffer.h:166
Definition: call_op_set.h:427
void Release()
Forget underlying byte buffer without destroying Use this only for un-owned byte buffers.
Definition: byte_buffer.h:151
Definition: server_interface.h:59
Status TrySingleSlice(Slice *slice) const
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slices, size_t nslices)
Returns a RAW byte buffer instance over the given slices (up to nslices).