GRPC C++  1.66.0
Data Structures | Public Member Functions | Friends
grpc::ByteBuffer Class Referencefinal

A sequence of bytes. More...

#include <byte_buffer.h>

Public Member Functions

 ByteBuffer ()
 Constuct an empty buffer. More...
 
 ByteBuffer (const Slice *slices, size_t nslices)
 Construct buffer from slices, of which there are nslices. More...
 
 ByteBuffer (const ByteBuffer &buf)
 Construct a byte buffer by referencing elements of existing buffer buf. More...
 
 ~ByteBuffer ()
 
ByteBufferoperator= (const ByteBuffer &buf)
 Wrapper of core function grpc_byte_buffer_copy . More...
 
Status TrySingleSlice (Slice *slice) const
 
Status DumpToSingleSlice (Slice *slice) const
 Dump (read) the buffer contents into slics. More...
 
Status Dump (std::vector< Slice > *slices) const
 Dump (read) the buffer contents into slices. More...
 
void Clear ()
 Remove all data. More...
 
void Duplicate ()
 Make a duplicate copy of the internals of this byte buffer so that we have our own owned version of it. More...
 
void Release ()
 Forget underlying byte buffer without destroying Use this only for un-owned byte buffers. More...
 
size_t Length () const
 Buffer size in bytes. More...
 
void Swap (ByteBuffer *other)
 Swap the state of *this and *other. More...
 
bool Valid () const
 Is this ByteBuffer valid? More...
 

Friends

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

Detailed Description

A sequence of bytes.

Constructor & Destructor Documentation

◆ ByteBuffer() [1/3]

grpc::ByteBuffer::ByteBuffer ( )
inline

Constuct an empty buffer.

◆ ByteBuffer() [2/3]

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

Construct buffer from slices, of which there are nslices.

◆ ByteBuffer() [3/3]

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

Construct 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.

◆ ~ByteBuffer()

grpc::ByteBuffer::~ByteBuffer ( )
inline

Member Function Documentation

◆ Clear()

void grpc::ByteBuffer::Clear ( )
inline

Remove all data.

◆ Dump()

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

Dump (read) the buffer contents into slices.

◆ DumpToSingleSlice()

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

Dump (read) the buffer contents into slics.

◆ 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.

◆ Length()

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

Buffer size in bytes.

◆ 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.

◆ Release()

void grpc::ByteBuffer::Release ( )
inline

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

◆ Swap()

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

Swap the state of *this and *other.

◆ TrySingleSlice()

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

◆ Valid()

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

Is this ByteBuffer valid?

Friends And Related Function Documentation

◆ internal::CallbackServerStreamingHandler

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

◆ internal::CallbackUnaryHandler

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

◆ internal::CallOpGenericRecvMessage

◆ internal::CallOpRecvMessage

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

◆ internal::CallOpSendMessage

friend class internal::CallOpSendMessage
friend

◆ internal::DeserializeFuncType

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

◆ internal::ErrorMethodHandler

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

◆ internal::ExternalConnectionAcceptorImpl

friend class internal::ExternalConnectionAcceptorImpl
friend

◆ internal::GrpcByteBufferPeer

friend class internal::GrpcByteBufferPeer
friend

◆ internal::ServerStreamingHandler

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

◆ internal::UnaryDeserializeHelper

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

◆ ProtoBufferReader

friend class ProtoBufferReader
friend

◆ ProtoBufferWriter

friend class ProtoBufferWriter
friend

◆ SerializationTraits< ByteBuffer, void >

friend class SerializationTraits< ByteBuffer, void >
friend

◆ ServerInterface

friend class ServerInterface
friend

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