GRPC C++  0.11.0.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Friends
grpc::Slice Class Reference

A wrapper around grpc_slice. More...

#include <slice.h>

Public Types

enum  AddRef { ADD_REF }
 
enum  StealRef { STEAL_REF }
 

Public Member Functions

 Slice ()
 Construct an empty slice. More...
 
 ~Slice ()
 
 Slice (gpr_slice slice, AddRef)
 Construct a slice from slice, adding a reference. More...
 
 Slice (gpr_slice slice, StealRef)
 Construct a slice from slice, stealing a reference. More...
 
 Slice (const Slice &other)
 Copy constructor, adds a reference. More...
 
Sliceoperator= (Slice other)
 Assignment, reference count is unchanged. More...
 
size_t size () const
 Byte size. More...
 
const gpr_uint8 * begin () const
 Raw pointer to the beginning (first element) of the slice. More...
 
const gpr_uint8 * end () const
 Raw pointer to the end (one byte past the last element) of the slice. More...
 

Friends

class ByteBuffer
 

Detailed Description

A wrapper around grpc_slice.

A slice represents a contiguous reference counted array of bytes. It is cheap to take references to a slice, and it is cheap to create a slice pointing to a subset of another slice.

Member Enumeration Documentation

Enumerator
ADD_REF 
Enumerator
STEAL_REF 

Constructor & Destructor Documentation

grpc::Slice::Slice ( )

Construct an empty slice.

grpc::Slice::~Slice ( )
grpc::Slice::Slice ( gpr_slice  slice,
AddRef   
)

Construct a slice from slice, adding a reference.

grpc::Slice::Slice ( gpr_slice  slice,
StealRef   
)

Construct a slice from slice, stealing a reference.

grpc::Slice::Slice ( const Slice other)

Copy constructor, adds a reference.

Member Function Documentation

const gpr_uint8* grpc::Slice::begin ( ) const
inline

Raw pointer to the beginning (first element) of the slice.

const gpr_uint8* grpc::Slice::end ( ) const
inline

Raw pointer to the end (one byte past the last element) of the slice.

Slice& grpc::Slice::operator= ( Slice  other)
inline

Assignment, reference count is unchanged.

size_t grpc::Slice::size ( ) const
inline

Byte size.

Friends And Related Function Documentation

friend class ByteBuffer
friend

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