GRPC C++  1.30.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)
 Constuct 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 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 ::grpc_impl::internal::RpcMethodHandler
 
template<class ServiceType , class RequestType , class ResponseType >
class ::grpc_impl::internal::ServerStreamingHandler
 
template<class RequestType , class ResponseType >
class ::grpc_impl::internal::CallbackUnaryHandler
 
template<class RequestType , class ResponseType >
class ::grpc_impl::internal::CallbackServerStreamingHandler
 
template<StatusCode code>
class ::grpc_impl::internal::ErrorMethodHandler
 
template<class R >
class internal::DeserializeFuncType
 
class ProtoBufferReader
 
class ProtoBufferWriter
 
class internal::GrpcByteBufferPeer
 
class internal::ExternalConnectionAcceptorImpl
 

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

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.

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

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

◆ Valid()

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

Is this ByteBuffer valid?

Friends And Related Function Documentation

◆ ::grpc_impl::internal::CallbackServerStreamingHandler

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

◆ ::grpc_impl::internal::CallbackUnaryHandler

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

◆ ::grpc_impl::internal::ErrorMethodHandler

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

◆ ::grpc_impl::internal::RpcMethodHandler

template<class ServiceType , class RequestType , class ResponseType >
friend class ::grpc_impl::internal::RpcMethodHandler
friend

◆ ::grpc_impl::internal::ServerStreamingHandler

template<class ServiceType , class RequestType , class ResponseType >
friend class ::grpc_impl::internal::ServerStreamingHandler
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::ExternalConnectionAcceptorImpl

friend class internal::ExternalConnectionAcceptorImpl
friend

◆ internal::GrpcByteBufferPeer

friend class internal::GrpcByteBufferPeer
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: