Optibits
Loading...
Searching...
No Matches
Optibits::Buffer Class Reference

Public Member Functions

 Buffer (void *buffer, std::size_t size, std::function< void(void *)> purger)
 Creates a Buffer. The purger will be called when freed or re-assigned.
 
 Buffer (Buffer &&other) noexcept
 
Bufferoperator= (Buffer &&other) noexcept
 
 Buffer (std::size_t size)
 Creates a new Buffer by allocating memory. Memory is not initialized.
 
 Buffer (std::vector< std::uint8_t > &&vector) noexcept
 Takes ownership of the given vector.
 
 Buffer (const Buffer &other)
 Makes a copy of the given buffer.
 
Bufferoperator= (const Buffer &other)
 Makes a copy of the given buffer.
 
void drop ()
 Drops the members of the buffer. (Basically resets them)
 
const std::uint8_t * data () const
 
std::uint8_t * data ()
 
std::size_t size () const
 

Constructor & Destructor Documentation

◆ Buffer() [1/5]

Optibits::Buffer::Buffer ( void * buffer,
std::size_t size,
std::function< void(void *)> purger )

Creates a Buffer. The purger will be called when freed or re-assigned.

Parameters
buffer
size
purger

◆ Buffer() [2/5]

Optibits::Buffer::Buffer ( Optibits::Buffer && other)
noexcept

Allow efficient transfer

◆ Buffer() [3/5]

Optibits::Buffer::Buffer ( std::size_t size)
explicit

Creates a new Buffer by allocating memory. Memory is not initialized.

Parameters
size

◆ Buffer() [4/5]

Optibits::Buffer::Buffer ( std::vector< std::uint8_t > && vector)
explicitnoexcept

Takes ownership of the given vector.

Parameters
vector

◆ Buffer() [5/5]

Optibits::Buffer::Buffer ( const Buffer & other)

Makes a copy of the given buffer.

Parameters
other

Member Function Documentation

◆ operator=()

Optibits::Buffer & Optibits::Buffer::operator= ( const Buffer & other)

Makes a copy of the given buffer.

Parameters
other
Returns


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