62template <
typename T,
class Allocator>
83 m_data = Allocator::template allocate<T>(
size);
84 Allocator::copy(m_data, other.m_data,
size);
86 Buffer(
Buffer&& other) noexcept : m_data(other.m_data), m_size(other.m_size) {
87 other.m_data =
nullptr;
92 Allocator::deallocate(m_data);
100 m_data = Allocator::template allocate<T>(
size);
102 m_data = Allocator::template reallocate<T>(m_data,
size);
104 Allocator::copy(m_data, other.m_data,
size);
111 if (
this != &other) {
113 Allocator::deallocate(m_data);
115 m_data = other.m_data;
116 m_size = other.m_size;
117 other.m_data =
nullptr;
118 other.m_size.
clear();
125 Allocator::deallocate(m_data);
133 m_data = Allocator::template reallocate<T>(m_data,
size);
139 const T*
data()
const {
return m_data; }
142 const T&
operator[](
size_t index)
const {
return m_data[index]; }
145 const T*
begin()
const {
return m_data; }
A class that manages a buffer of data.
Definition buffer.hh:63
Buffer(const Buffer &other)
Definition buffer.hh:79
const T & operator[](size_t index) const
Definition buffer.hh:142
Buffer(Buffer &&other) noexcept
Definition buffer.hh:86
T * data()
Definition buffer.hh:138
T * end()
Definition buffer.hh:144
T * begin()
Definition buffer.hh:143
void resize(size_t size)
Definition buffer.hh:131
bool empty() const
Definition buffer.hh:147
T & operator[](size_t index)
Definition buffer.hh:141
const T * data() const
Definition buffer.hh:139
Buffer & operator=(const Buffer &other)
Definition buffer.hh:96
~Buffer()
Definition buffer.hh:90
Buffer(size_t size)
Definition buffer.hh:70
Buffer & operator=(Buffer &&other) noexcept
Definition buffer.hh:110
const T * end() const
Definition buffer.hh:146
Buffer(T *data, size_t size)
Definition buffer.hh:74
const T * begin() const
Definition buffer.hh:145
void clear()
Definition buffer.hh:123
size_t size() const
Definition buffer.hh:140
Buffer()
Definition buffer.hh:69
Definition bitfield.hh:36
A bit field that can hold multiple bit field elements of different types.
Definition bitfield.hh:155
constexpr void set(Field::Type v_)
Definition bitfield.hh:164
constexpr Field::Type get() const
Definition bitfield.hh:157
void clear()
Definition bitfield.hh:170
A bit field element to be used in a BitField.
Definition bitfield.hh:130
void uint32_t(classId, spec)