CARLA
List of all members
carla::BufferView Class Reference

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

#include <BufferView.h>

+ Inheritance diagram for carla::BufferView:
+ Collaboration 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_typeoperator[] (size_t i) const
 Access the byte at position i. More...
 
const value_typedata () const noexcept
 Direct access to the allocated memory or nullptr if no memory is allocated. More...
 
boost::asio::const_buffer cbuffer () const noexcept
 Make a boost::asio::buffer from this buffer. More...
 
boost::asio::const_buffer buffer () const noexcept
 Make a boost::asio::buffer from this buffer. More...
 

Construction and destruction

 BufferView ()=delete
 
 BufferView (const BufferView &)=delete
 
static std::shared_ptr< BufferViewCreateFrom (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
 

Iterators

const Buffer _buffer
 
const_iterator cbegin () const noexcept
 
const_iterator begin () const noexcept
 
const_iterator cend () const noexcept
 
const_iterator end () const 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 CreateFrom().

+ Here is the caller graph for this function:

◆ BufferView() [2/3]

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

◆ BufferView() [3/3]

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

Definition at line 62 of file BufferView.h.

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().

+ Here is the call graph for this function:

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ capacity()

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

Definition at line 118 of file BufferView.h.

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

+ Here is the call graph for this function:

◆ cbegin()

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

Definition at line 130 of file BufferView.h.

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

+ Here is the call graph for this function:

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

◆ CreateFrom()

static std::shared_ptr<BufferView> carla::BufferView::CreateFrom ( Buffer &&  buffer)
inlinestatic

Definition at line 56 of file BufferView.h.

References buffer(), and BufferView().

Referenced by Benchmark::AddStream(), make_special_message(), ADVSCamera::PostPhysTick(), FAsyncDataStreamTmpl< T >::Send(), FPixelReader::SendPixelsInRenderThread(), FAsyncDataStreamTmpl< T >::SerializeAndSend(), TEST(), carla::multigpu::Router::Write(), carla::multigpu::Secondary::Write(), carla::multigpu::Router::WriteToNext(), and carla::multigpu::Router::WriteToOne().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

◆ empty()

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

Definition at line 106 of file BufferView.h.

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

+ Here is the call graph for this function:

◆ end()

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

Definition at line 142 of file BufferView.h.

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

+ Here is the call graph for this function:

◆ max_size()

static constexpr size_type carla::BufferView::max_size ( )
inlinestaticnoexcept

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().

+ Here is the call graph for this function:

◆ size()

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

Definition at line 110 of file BufferView.h.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ _buffer

const Buffer carla::BufferView::_buffer
private

Definition at line 148 of file BufferView.h.

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


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