|
| | BufferView ()=default |
| | BufferView (const BufferView &other)=default |
| BufferView & | operator= (const BufferView &other)=default |
| | BufferView (BufferView &&other) noexcept=default |
| BufferView & | operator= (BufferView &&other) noexcept=default |
| | BufferView (Type *data, const size_t size) |
| | Construct a view pointing to given data.
|
| template<size_t S> |
| | BufferView (const std::array< Type, S > &array) |
| | Construct a view from a std::array.
|
| template<typename T = Type, std::enable_if_t<!std::is_const_v< T >, int > = 0> |
| | BufferView (const std::vector< Type > &vector) |
| | Construct a view from a std::vector.
|
| template<typename T = Type, std::enable_if_t<!std::is_const_v< T >, int > = 0> |
| | BufferView (std::vector< Type > &vector) |
| | Construct a view from a std::vector.
|
| Type & | operator[] (size_t index) const |
| const Type * | data () const |
| Type * | data () |
| size_t | size () const |
| size_t | size_bytes () const |
| bool | empty () const |
| template<typename ValueType, std::enable_if_t< std::is_trivially_copyable_v< ValueType >, bool > = true> |
| ValueType | read_ne (const size_t offset) const |
| | Reads a value from the data in native byte order (not to be confused with network-endian).
|
| template<typename ValueType, std::enable_if_t< std::is_trivially_copyable_v< ValueType >, bool > = true> |
| ValueType | read_be (const size_t offset) const |
| | Reads a big-endian value from the given data.
|
| template<typename ValueType, std::enable_if_t< std::is_trivially_copyable_v< ValueType >, bool > = true> |
| ValueType | read_le (const size_t offset) const |
| | Reads a little-endian value from the given data.
|
| BufferView | subview (size_t offset) const |
| BufferView | subview (size_t offset, const size_t size) const |
| BufferView< std::add_const_t< Type > > | const_view () const |
| template<class NewType> |
| BufferView< NewType > | reinterpret () const |
| | Returns a new buffer_view pointing to the same data, but reinterpreted as a different type.
|
template<class Type>
class rav::BufferView< Type >
A class similar to std::string_view but for raw data buffers.
- Template Parameters
-
Definition at line 41 of file buffer_view.hpp.
template<class Type>
template<typename ValueType, std::enable_if_t< std::is_trivially_copyable_v< ValueType >, bool > = true>
Reads a value from the data in native byte order (not to be confused with network-endian).
Bounds are asserted, and behaviour depends on the RAV_ASSERT configuration.
- Template Parameters
-
| ValueType | The type of the value to read. |
- Parameters
-
| offset | The offset to read from. |
- Returns
- The decoded value.
Definition at line 135 of file buffer_view.hpp.