Pixie
Loading...
Searching...
No Matches
pixie::AlignedStorage Class Reference

Owning storage rounded up to 64-byte blocks. More...

#include <aligned.h>

Inheritance diagram for pixie::AlignedStorage:
pixie::StorageBase< AlignedStorage >

Public Member Functions

 AlignedStorage (std::size_t size_bits)
 Construct storage for at least size_bits bits.
 
std::size_t size_bytes_impl () const
 Return the padded allocation size in bytes.
 
std::span< const std::byte > as_bytes_impl () const
 Return the padded allocation as read-only bytes.
 
ReadOnlyStorageView view_impl (std::size_t offset_bytes, std::size_t count_bytes) const
 Return a checked read-only byte subrange.
 
void resize_impl (std::size_t size_bits)
 Resize to hold at least size_bits bits.
 
std::span< std::byte > writable_bytes_impl ()
 Return writable allocation bytes.
 
std::span< std::uint16_t > writable_words16_impl ()
 Return writable allocation as 16-bit words.
 
std::span< std::uint64_t > writable_words64_impl ()
 Return writable allocation as 64-bit words.
 
std::size_t allocated_bytes_impl () const
 Return bytes reserved by the underlying vector.
 
void shrink_to_fit_impl ()
 Request release of unused vector capacity.
 
std::span< CacheLineas_lines ()
 Return mutable cache-line blocks.
 
std::span< const CacheLineas_lines () const
 Return read-only cache-line blocks.
 
- Public Member Functions inherited from pixie::StorageBase< AlignedStorage >
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.
 

Detailed Description

Owning storage rounded up to 64-byte blocks.

Construction and resize accept a logical bit count. All exposed views cover the padded allocation. Resizing or destroying this object invalidates its read-only views.


The documentation for this class was generated from the following file: