CRTP facade for byte-addressable storage.
More...
#include <storage.h>
|
|
std::size_t | size_bytes () const |
| | Return the exposed storage size in bytes.
|
| |
|
std::size_t | size_bits () const |
| | Return the exposed storage size in bits.
|
| |
|
bool | empty () const |
| | Check whether the storage is empty.
|
| |
|
std::span< const std::byte > | as_bytes () const |
| | Return a read-only view of all exposed bytes.
|
| |
| std::span< const std::uint16_t > | as_words16 () const |
| | Return a read-only view as 16-bit words.
|
| |
| std::span< const std::uint64_t > | as_words64 () const |
| | Return a read-only view as 64-bit words.
|
| |
|
auto | view () const |
| | Return a non-owning read-only view of all exposed bytes.
|
| |
| auto | view (std::size_t offset_bytes, std::size_t count_bytes) const |
| | Return a non-owning read-only byte subrange.
|
| |
|
void | serialize (OutputBitStream &stream) const |
| | Serialize the exposed byte sequence with a size prefix.
|
| |
|
void | resize (std::size_t size_bits) |
| | Resize mutable storage to hold at least size_bits bits.
|
| |
|
auto | writable_bytes () |
| | Return writable storage bytes.
|
| |
|
auto | writable_words16 () |
| | Return writable storage as 16-bit words.
|
| |
|
auto | writable_words64 () |
| | Return writable storage as 64-bit words.
|
| |
|
std::size_t | allocated_bytes () const |
| | Return bytes reserved by an owning storage implementation.
|
| |
|
void | shrink_to_fit () |
| | Request release of unused reserved storage.
|
| |
template<class Impl>
class pixie::StorageBase< Impl >
CRTP facade for byte-addressable storage.
- Template Parameters
-
| Impl | Concrete storage implementation. |
◆ as_words16()
Return a read-only view as 16-bit words.
- Exceptions
-
| std::invalid_argument | if the data is misaligned or its size is not divisible by the word size. |
◆ as_words64()
Return a read-only view as 64-bit words.
- Exceptions
-
| std::invalid_argument | if the data is misaligned or its size is not divisible by the word size. |
◆ view()
template<class Impl>
| auto pixie::StorageBase< Impl >::view |
( |
std::size_t | offset_bytes, |
|
|
std::size_t | count_bytes ) const |
|
inline |
Return a non-owning read-only byte subrange.
- Parameters
-
| offset_bytes | First byte in the view. |
| count_bytes | Number of bytes in the view. |
- Exceptions
-
| std::out_of_range | if the subrange is outside this storage. |
The documentation for this class was generated from the following file: