Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
grpc::ByteBuffer Class Referencefinal

A sequence of bytes. More...

#include <byte_buffer.h>

Classes

class  ByteBufferPointer
 

Public Member Functions

 ByteBuffer ()
 Constuct an empty buffer. More...
 
 ByteBuffer (const ByteBuffer &buf)
 
 ByteBuffer (const Slice *slices, size_t nslices)
 Construct buffer from slices, of which there are nslices. More...
 
void Clear ()
 Remove all data. More...
 
Status Dump (std::vector< Slice > *slices) const
 Dump (read) the buffer contents into slices. More...
 
Status DumpToSingleSlice (Slice *slice) const
 Dump (read) the buffer contents into slics. More...
 
void Duplicate ()
 
size_t Length () const
 Buffer size in bytes. More...
 
ByteBufferoperator= (const ByteBuffer &buf)
 
void Release ()
 
void Swap (ByteBuffer *other)
 Swap the state of *this and *other. More...
 
Status TrySingleSlice (Slice *slice) const
 
bool Valid () const
 Is this ByteBuffer valid? More...
 
 ~ByteBuffer ()
 

Private Member Functions

ByteBufferPointer bbuf_ptr () const
 
grpc_byte_bufferc_buffer ()
 
grpc_byte_buffer ** c_buffer_ptr ()
 
void set_buffer (grpc_byte_buffer *buf)
 

Private Attributes

grpc_byte_bufferbuffer_
 

Friends

template<class RequestType , class ResponseType >
class internal::CallbackServerStreamingHandler
 
template<class RequestType , class ResponseType >
class internal::CallbackUnaryHandler
 
class internal::CallOpGenericRecvMessage
 
template<class R >
class internal::CallOpRecvMessage
 
class internal::CallOpSendMessage
 
template<class R >
class internal::DeserializeFuncType
 
template<StatusCode code>
class internal::ErrorMethodHandler
 
class internal::ExternalConnectionAcceptorImpl
 
class internal::GrpcByteBufferPeer
 
template<class ServiceType , class RequestType , class ResponseType >
class internal::ServerStreamingHandler
 
template<class RequestType >
void * internal::UnaryDeserializeHelper (grpc_byte_buffer *, grpc::Status *, RequestType *)
 
class ProtoBufferReader
 
class ProtoBufferWriter
 
class SerializationTraits< ByteBuffer, void >
 
class ServerInterface
 

Detailed Description

A sequence of bytes.

Definition at line 61 of file include/grpcpp/impl/codegen/byte_buffer.h.

Constructor & Destructor Documentation

◆ ByteBuffer() [1/3]

grpc::ByteBuffer::ByteBuffer ( )
inline

Constuct an empty buffer.

Definition at line 64 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ ByteBuffer() [2/3]

grpc::ByteBuffer::ByteBuffer ( const Slice slices,
size_t  nslices 
)
inline

Construct buffer from slices, of which there are nslices.

Definition at line 67 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ ByteBuffer() [3/3]

grpc::ByteBuffer::ByteBuffer ( const ByteBuffer buf)
inline

Constuct a byte buffer by referencing elements of existing buffer 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.

Definition at line 96 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ ~ByteBuffer()

grpc::ByteBuffer::~ByteBuffer ( )
inline

Definition at line 98 of file include/grpcpp/impl/codegen/byte_buffer.h.

Member Function Documentation

◆ bbuf_ptr()

ByteBufferPointer grpc::ByteBuffer::bbuf_ptr ( ) const
inlineprivate

Definition at line 219 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ c_buffer()

grpc_byte_buffer* grpc::ByteBuffer::c_buffer ( )
inlineprivate

Definition at line 201 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ c_buffer_ptr()

grpc_byte_buffer** grpc::ByteBuffer::c_buffer_ptr ( )
inlineprivate

Definition at line 202 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ Clear()

void grpc::ByteBuffer::Clear ( )
inline

Remove all data.

Definition at line 129 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ Dump()

Status grpc::ByteBuffer::Dump ( std::vector< Slice > *  slices) const

Dump (read) the buffer contents into slices.

Definition at line 66 of file byte_buffer_cc.cc.

◆ DumpToSingleSlice()

Status grpc::ByteBuffer::DumpToSingleSlice ( Slice slice) const

Dump (read) the buffer contents into slics.

Definition at line 51 of file byte_buffer_cc.cc.

◆ Duplicate()

void grpc::ByteBuffer::Duplicate ( )
inline

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. This is not a deep copy; it is a referencing and its performance is size-independent.

Definition at line 141 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ Length()

size_t grpc::ByteBuffer::Length ( ) const
inline

Buffer size in bytes.

Definition at line 150 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ operator=()

ByteBuffer& grpc::ByteBuffer::operator= ( const ByteBuffer buf)
inline

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.

Definition at line 107 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ Release()

void grpc::ByteBuffer::Release ( )
inline

Forget underlying byte buffer without destroying Use this only for un-owned byte buffers

Definition at line 147 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ set_buffer()

void grpc::ByteBuffer::set_buffer ( grpc_byte_buffer buf)
inlineprivate

Definition at line 194 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ Swap()

void grpc::ByteBuffer::Swap ( ByteBuffer other)
inline

Swap the state of *this and *other.

Definition at line 157 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ TrySingleSlice()

Status grpc::ByteBuffer::TrySingleSlice ( Slice slice) const

Definition at line 35 of file byte_buffer_cc.cc.

◆ Valid()

bool grpc::ByteBuffer::Valid ( ) const
inline

Is this ByteBuffer valid?

Definition at line 164 of file include/grpcpp/impl/codegen/byte_buffer.h.

Friends And Related Function Documentation

◆ internal::CallbackServerStreamingHandler

template<class RequestType , class ResponseType >
friend class internal::CallbackServerStreamingHandler
friend

Definition at line 181 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::CallbackUnaryHandler

template<class RequestType , class ResponseType >
friend class internal::CallbackUnaryHandler
friend

Definition at line 179 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::CallOpGenericRecvMessage

Definition at line 172 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::CallOpRecvMessage

template<class R >
friend class internal::CallOpRecvMessage
friend

Definition at line 171 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::CallOpSendMessage

friend class internal::CallOpSendMessage
friend

Definition at line 169 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::DeserializeFuncType

template<class R >
friend class internal::DeserializeFuncType
friend

Definition at line 185 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::ErrorMethodHandler

template<StatusCode code>
friend class internal::ErrorMethodHandler
friend

Definition at line 183 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::ExternalConnectionAcceptorImpl

Definition at line 189 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::GrpcByteBufferPeer

friend class internal::GrpcByteBufferPeer
friend

Definition at line 188 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::ServerStreamingHandler

template<class ServiceType , class RequestType , class ResponseType >
friend class internal::ServerStreamingHandler
friend

Definition at line 177 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ internal::UnaryDeserializeHelper

template<class RequestType >
void* internal::UnaryDeserializeHelper ( grpc_byte_buffer ,
grpc::Status ,
RequestType *   
)
friend

◆ ProtoBufferReader

friend class ProtoBufferReader
friend

Definition at line 186 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ ProtoBufferWriter

friend class ProtoBufferWriter
friend

Definition at line 187 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ SerializationTraits< ByteBuffer, void >

friend class SerializationTraits< ByteBuffer, void >
friend

Definition at line 167 of file include/grpcpp/impl/codegen/byte_buffer.h.

◆ ServerInterface

friend class ServerInterface
friend

Definition at line 168 of file include/grpcpp/impl/codegen/byte_buffer.h.

Member Data Documentation

◆ buffer_

grpc_byte_buffer* grpc::ByteBuffer::buffer_
private

Definition at line 191 of file include/grpcpp/impl/codegen/byte_buffer.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:30