CARLA
Loading...
Searching...
No Matches
carla::BufferView Class Reference

Creating a constant view from an existing buffer. More...

#include <BufferView.h>

Inheritance diagram for carla::BufferView:

Public Types

Member types
using value_type = unsigned char
using size_type = uint32_t
using const_iterator = const value_type *

Public Member Functions

Data access
const value_type & operator[] (size_t i) const
 Access the byte at position i.
const value_type * data () const noexcept
 Direct access to the allocated memory or nullptr if no memory is allocated.
boost::asio::const_buffer cbuffer () const noexcept
 Make a boost::asio::buffer from this buffer.
boost::asio::const_buffer buffer () const noexcept
 Make a boost::asio::buffer from this buffer.

Iterators

const Buffer _buffer
const_iterator cbegin () const noexcept
const_iterator begin () const noexcept
const_iterator cend () const noexcept
const_iterator end () const noexcept

Construction and destruction

 BufferView ()=delete
 BufferView (const BufferView &)=delete
static std::shared_ptr< BufferView > CreateFrom (Buffer &&buffer)
 BufferView (Buffer &&rhs) noexcept

Capacity

bool empty () const noexcept
size_type size () const noexcept
size_type capacity () const noexcept
static constexpr size_type max_size () noexcept

Detailed Description

Creating a constant view from an existing buffer.

Definition at line 32 of file BufferView.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 43 of file BufferView.h.

◆ size_type

using carla::BufferView::size_type = uint32_t

Definition at line 42 of file BufferView.h.

◆ value_type

using carla::BufferView::value_type = unsigned char

Definition at line 41 of file BufferView.h.

Constructor & Destructor Documentation

◆ BufferView() [1/3]

carla::BufferView::BufferView ( )
delete

Referenced by BufferView(), and CreateFrom().

◆ BufferView() [2/3]

carla::BufferView::BufferView ( const BufferView & )
delete

References BufferView().

◆ BufferView() [3/3]

carla::BufferView::BufferView ( Buffer && rhs)
inlineprivatenoexcept

Definition at line 62 of file BufferView.h.

References _buffer.

Member Function Documentation

◆ begin()

const_iterator carla::BufferView::begin ( ) const
inlinenoexcept

Definition at line 134 of file BufferView.h.

References _buffer, and carla::Buffer::cbegin().

◆ buffer()

boost::asio::const_buffer carla::BufferView::buffer ( ) const
inlinenoexcept

Make a boost::asio::buffer from this buffer.

Warning
Boost.Asio buffers do not own the data, it's up to the caller to not delete the memory that this buffer holds until the asio buffer is no longer used.

Definition at line 94 of file BufferView.h.

References cbuffer().

Referenced by CreateFrom().

◆ capacity()

size_type carla::BufferView::capacity ( ) const
inlinenoexcept

Definition at line 118 of file BufferView.h.

References _buffer, and carla::Buffer::capacity().

◆ cbegin()

const_iterator carla::BufferView::cbegin ( ) const
inlinenoexcept

Definition at line 130 of file BufferView.h.

References _buffer, and carla::Buffer::data().

◆ cbuffer()

boost::asio::const_buffer carla::BufferView::cbuffer ( ) const
inlinenoexcept

Make a boost::asio::buffer from this buffer.

Warning
Boost.Asio buffers do not own the data, it's up to the caller to not delete the memory that this buffer holds until the asio buffer is no longer used.

Definition at line 89 of file BufferView.h.

References _buffer, carla::Buffer::data(), and carla::Buffer::size().

Referenced by buffer().

◆ cend()

const_iterator carla::BufferView::cend ( ) const
inlinenoexcept

Definition at line 138 of file BufferView.h.

References _buffer, carla::Buffer::cbegin(), and carla::Buffer::size().

◆ CreateFrom()

◆ data()

const value_type * carla::BufferView::data ( ) const
inlinenoexcept

Direct access to the allocated memory or nullptr if no memory is allocated.

Definition at line 80 of file BufferView.h.

References _buffer, and carla::Buffer::data().

◆ empty()

bool carla::BufferView::empty ( ) const
inlinenoexcept

Definition at line 106 of file BufferView.h.

References _buffer, and carla::Buffer::size().

◆ end()

const_iterator carla::BufferView::end ( ) const
inlinenoexcept

Definition at line 142 of file BufferView.h.

References _buffer, and carla::Buffer::cend().

◆ max_size()

constexpr size_type carla::BufferView::max_size ( )
inlinestaticconstexprnoexcept

Definition at line 114 of file BufferView.h.

◆ operator[]()

const value_type & carla::BufferView::operator[] ( size_t i) const
inline

Access the byte at position i.

Definition at line 74 of file BufferView.h.

References _buffer, and carla::Buffer::data().

◆ size()

size_type carla::BufferView::size ( ) const
inlinenoexcept

Definition at line 110 of file BufferView.h.

References _buffer, and carla::Buffer::size().

Member Data Documentation

◆ _buffer

const Buffer carla::BufferView::_buffer
private

Definition at line 148 of file BufferView.h.

Referenced by begin(), BufferView(), capacity(), cbegin(), cbuffer(), cend(), data(), empty(), end(), operator[](), and size().


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