Ipelib
Classes | Public Member Functions | List of all members
ipe::Buffer Class Reference

#include <ipebase.h>

Public Member Functions

 Buffer () noexcept=default
 
 ~Buffer () noexcept
 
 Buffer (const Buffer &rhs) noexcept
 
 Buffer (Buffer &&rhs) noexcept
 
Bufferoperator= (const Buffer &rhs) noexcept
 
Bufferoperator= (Buffer &&rhs) noexcept
 
 Buffer (int size) noexcept
 
 Buffer (const char *data, int size) noexcept
 
char & operator[] (int index) noexcept
 
const char & operator[] (int index) const noexcept
 
int size () const noexcept
 
char * data () noexcept
 
const char * data () const noexcept
 

Detailed Description

A memory buffer.

Implements sharing semantics using reference counting.

Constructor & Destructor Documentation

ipe::Buffer::Buffer ( )
defaultnoexcept
Buffer::~Buffer ( )
noexcept

Destructor.

Buffer::Buffer ( const Buffer rhs)
noexcept

Copy constructor. Constant time, buffer is shared.

Buffer::Buffer ( Buffer &&  rhs)
noexcept

Move constructor. Constant time.

Buffer::Buffer ( int  size)
explicitnoexcept

Create buffer of specified size.

Buffer::Buffer ( const char *  data,
int  size 
)
explicitnoexcept

Create buffer by copying the data.

References ipe::String::data(), and ipe::String::size().

Member Function Documentation

Buffer & Buffer::operator= ( const Buffer rhs)
noexcept

Assignment operator (constant-time).

Buffer & Buffer::operator= ( Buffer &&  rhs)
noexcept

Assignment move operator (constant-time).

char& ipe::Buffer::operator[] ( int  index)
inlinenoexcept

Character access.

const char& ipe::Buffer::operator[] ( int  index) const
inlinenoexcept

Character access (const version).

int ipe::Buffer::size ( ) const
inlinenoexcept
char* ipe::Buffer::data ( )
inlinenoexcept
const char* ipe::Buffer::data ( ) const
inlinenoexcept

Return pointer to buffer data (const version).


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