21 #ifndef GF_BUFFER_REF_H 22 #define GF_BUFFER_REF_H 29 #ifndef DOXYGEN_SHOULD_SKIP_THIS 89 : m_data(values.data())
90 , m_size(values.size())
100 template<std::
size_t N>
102 : m_data(values.data())
103 , m_size(values.size())
115 template<std::
size_t N>
137 constexpr std::size_t
getSize() const noexcept {
157 assert(index <= m_size);
180 return m_data + m_size;
192 return m_data[index];
216 #ifndef DOXYGEN_SHOULD_SKIP_THIS 221 #endif // GF_BUFFER_REF_H T & operator[](std::size_t index)
Get an element at a given index.
Definition: BufferRef.h:191
BufferRef(std::array< T, N > &values)
Constructor from a std::array
Definition: BufferRef.h:101
T * end() noexcept
Get an iterator past the last element.
Definition: BufferRef.h:179
constexpr BufferRef< T > sub(std::size_t index)
Create a buffer starting at a specified index.
Definition: BufferRef.h:156
constexpr BufferRef(T(&data)[N])
Constructor from a static array.
Definition: BufferRef.h:116
constexpr std::size_t getSize() const noexcept
Get the number of elements.
Definition: BufferRef.h:137
constexpr BufferRef< T > buffer(T *data, std::size_t size)
Create a reference to a buffer.
Definition: BufferRef.h:211
T * begin() noexcept
Get an iterator to the first element.
Definition: BufferRef.h:168
A reference to a modifiable buffer and its size.
Definition: BufferRef.h:44
constexpr bool isEmpty() const noexcept
Check if the buffer is empty.
Definition: BufferRef.h:146
constexpr BufferRef(std::nullptr_t)
Null constructor.
Definition: BufferRef.h:63
The namespace for gf classes.
Definition: Action.h:35
constexpr BufferRef(T *data, std::size_t size)
Constructor from a pointer and a size.
Definition: BufferRef.h:76
constexpr BufferRef()
Default constructor.
Definition: BufferRef.h:51
T * getData() noexcept
Get a pointer to the elements.
Definition: BufferRef.h:128
BufferRef(std::vector< T > &values)
Constructor from a std::vector
Definition: BufferRef.h:88