Simple buffer around a vector that allows for easy reading and writing of values.
More...
#include <vector_buffer.hpp>
|
| | VectorBuffer ()=default |
| | VectorBuffer (size_t size) |
| | VectorBuffer (std::initializer_list< T > values) |
| | VectorBuffer (const VectorBuffer &other)=default |
| | VectorBuffer (VectorBuffer &&other) noexcept=default |
| VectorBuffer & | operator= (const VectorBuffer &other)=default |
| VectorBuffer & | operator= (VectorBuffer &&other) noexcept=default |
| bool | operator== (const std::vector< T > &other) const |
| void | push_back (T value) |
| | Writes the given value to the buffer in native byte order.
|
| void | push_back (std::initializer_list< T > values) |
| | Writes the given values to the buffer in native byte order.
|
| void | push_back_be (T value) |
| | Writes the given value to the buffer in big endian byte order.
|
| void | push_back_be (std::initializer_list< T > values) |
| | Writes the given value to the buffer in big endian byte order.
|
| void | push_back_le (T value) |
| | Writes the given value to the buffer in little endian byte order.
|
| void | push_back_le (std::initializer_list< T > values) |
| | Writes the given value to the buffer in little endian byte order.
|
| T | read () |
| | Reads a value from the buffer in native byte order.
|
| T | read_be () |
| | Reads a value from the buffer in big endian byte order.
|
| T | read_le () |
| | Reads a value from the buffer in little endian byte order.
|
| const T * | data () const |
| T * | data () |
| size_t | size () const |
| bool | empty () const |
| void | resize (size_t size) |
| | Resizes the stream to the given size.
|
| void | reset () |
| | Resets the stream to its initial state.
|
template<class T>
class rav::VectorBuffer< T >
Simple buffer around a vector that allows for easy reading and writing of values.
Definition at line 40 of file vector_buffer.hpp.
◆ VectorBuffer() [1/5]
◆ VectorBuffer() [2/5]
◆ VectorBuffer() [3/5]
◆ VectorBuffer() [4/5]
◆ VectorBuffer() [5/5]
◆ data() [1/2]
- Returns
- Returns a pointer to the data in the buffer.
Definition at line 156 of file vector_buffer.hpp.
◆ data() [2/2]
- Returns
- Returns a pointer to the data in the buffer.
Definition at line 149 of file vector_buffer.hpp.
◆ empty()
- Returns
- True if the stream is empty, false otherwise.
Definition at line 171 of file vector_buffer.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
◆ push_back() [1/2]
Writes the given values to the buffer in native byte order.
- Parameters
-
| values | The values to write. |
Definition at line 69 of file vector_buffer.hpp.
◆ push_back() [2/2]
Writes the given value to the buffer in native byte order.
- Parameters
-
Definition at line 61 of file vector_buffer.hpp.
◆ push_back_be() [1/2]
Writes the given value to the buffer in big endian byte order.
- Template Parameters
-
| T | The type of the value to write. |
- Parameters
-
| values | The values to write. |
Definition at line 89 of file vector_buffer.hpp.
◆ push_back_be() [2/2]
Writes the given value to the buffer in big endian byte order.
- Template Parameters
-
| T | The type of the value to write. |
- Parameters
-
Definition at line 80 of file vector_buffer.hpp.
◆ push_back_le() [1/2]
Writes the given value to the buffer in little endian byte order.
- Template Parameters
-
| T | The type of the value to write. |
- Parameters
-
| values | The values to write. |
Definition at line 110 of file vector_buffer.hpp.
◆ push_back_le() [2/2]
Writes the given value to the buffer in little endian byte order.
- Template Parameters
-
| T | The type of the value to write. |
- Parameters
-
- Returns
- True if the value was written successfully, false otherwise.
Definition at line 101 of file vector_buffer.hpp.
◆ read()
Reads a value from the buffer in native byte order.
- Template Parameters
-
| T | The type of the value to read. |
- Returns
- The value read from the stream, or a default-constructed value if the read failed.
Definition at line 121 of file vector_buffer.hpp.
◆ read_be()
Reads a value from the buffer in big endian byte order.
- Template Parameters
-
| T | The type of the value to read. |
- Returns
- The value read from the stream, or a default-constructed value if the read failed.
Definition at line 133 of file vector_buffer.hpp.
◆ read_le()
Reads a value from the buffer in little endian byte order.
- Template Parameters
-
| T | The type of the value to read. |
- Returns
- The value read from the stream, or a default-constructed value if the read failed.
Definition at line 142 of file vector_buffer.hpp.
◆ reset()
◆ resize()
Resizes the stream to the given size.
- Parameters
-
| size | The new size of the stream. |
Definition at line 179 of file vector_buffer.hpp.
◆ size()
- Returns
- Returns the size of the data in the buffer.
Definition at line 163 of file vector_buffer.hpp.
The documentation for this class was generated from the following file: