15#include <boost/asio/buffer.hpp>
22#ifdef LIBCARLA_INCLUDED_FROM_UE4
24#include "Containers/Array.h"
33 class BufferView :
public std::enable_shared_from_this<BufferView> {
91 boost::asio::const_buffer
cbuffer() const noexcept {
96 boost::asio::const_buffer
buffer() const noexcept {
120 return (std::numeric_limits<size_type>::max)();
BufferView(Buffer &&rhs) noexcept
static constexpr size_type max_size() noexcept
const_iterator cend() const noexcept
size_type size() const noexcept
static std::shared_ptr< BufferView > CreateFrom(Buffer &&buffer)
const value_type * const_iterator
BufferView(const BufferView &)=delete
const value_type & operator[](size_t i) const
const_iterator begin() const noexcept
size_type capacity() const noexcept
boost::asio::const_buffer cbuffer() const noexcept
const_iterator cbegin() const noexcept
bool empty() const noexcept
boost::asio::const_buffer buffer() const noexcept
const value_type * data() const noexcept
const_iterator end() const noexcept
一块原始数据。 请注意,如果需要更多容量,则会分配一个新的内存块,并 删除旧的内存块。这意味着默认情况下,缓冲区只能增长。要释放内存,使用 clear 或 pop。
const value_type * data() const noexcept
直接访问分配的内存,如果没有分配内存则返回 nullptr。
size_type size() const noexcept
const_iterator cend() const noexcept
size_type capacity() const noexcept
const_iterator cbegin() const noexcept
std::shared_ptr< BufferView > SharedBufferView