Generic class to maintain common API guarantees across buffer types.
More...
#include <generic.hxx>
|
|
| Generic () noexcept=default |
| | Construct Generic.
|
| |
| | Generic (const DataType &data) noexcept |
| | Construct Generic.
|
| |
| | Generic (DataType &&data) noexcept |
| | Construct Generic with initial data using move semantics.
|
| |
|
| Generic (const Generic &) noexcept=default |
| | Copy construct deleted.
|
| |
|
| Generic (Generic &&) noexcept=default |
| | Move construct deleted.
|
| |
|
virtual | ~Generic () noexcept=0 |
| | Virtual destructor.
|
| |
|
Generic & | operator= (const Generic &other)=default |
| | Copy assign deleted.
|
| |
|
Generic & | operator= (Generic &&) noexcept=default |
| | Move assign deleted.
|
| |
|
template<std::ranges::input_range Src>
requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Src>>>) && requires(std::ranges::range_value_t<Src> v) { static_cast<std::byte>(v); } |
| static DataType | DataConvert (const Src &src) noexcept |
| | Convert various source types into the library DataType.
|
| |
template<std::ranges::input_range Src>
requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Src>>>) && requires(std::ranges::range_value_t<Src> v) { static_cast<std::byte>(v); } |
| static DataType | DataConvert (Src &&src) noexcept |
| |
|
static DataType | DataConvert (std::string_view sv) noexcept |
| | Convert a std::string_view to DataType.
|
| |
|
static DataType | DataConvert (const char *s) noexcept |
| | Convert a null-terminated C string to DataType.
|
| |
|
|
DataType | m_buffer |
| | Internal buffer storage.
|
| |
Generic class to maintain common API guarantees across buffer types.
- Overview
- Generic provides a common base class for buffer types, ensuring consistent API behavior and guarantees. It defines standard operations like reading, writing, seeking, and clearing buffers.
◆ Generic() [1/2]
| StormByte::Buffer::Generic::Generic |
( |
const DataType & |
data | ) |
|
|
inlinenoexcept |
Construct Generic.
- Parameters
-
| data | Initial byte vector to populate the Generic. |
◆ Generic() [2/2]
| StormByte::Buffer::Generic::Generic |
( |
DataType && |
data | ) |
|
|
inlinenoexcept |
Construct Generic with initial data using move semantics.
- Parameters
-
| data | Initial byte vector to move into the Generic. |
◆ DataConvert()
template<std::ranges::input_range Src>
requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Src>>>) && requires(std::ranges::range_value_t<Src> v) { static_cast<std::byte>(v); }
| static DataType StormByte::Buffer::Generic::DataConvert |
( |
const Src & |
src | ) |
|
|
inlinestaticprotectednoexcept |
Convert various source types into the library DataType.
Overload forms:
DataType DataConvert(const Src&) for copying/converting from lvalue ranges
DataType DataConvert(Src&&) for consuming rvalue ranges and moving when the source type is already DataType.
The documentation for this class was generated from the following file:
- /home/runner/work/StormByte-Buffer/StormByte-Buffer/lib/public/StormByte/buffer/generic.hxx