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

A simple aligned storage for cache-line sized blocks. More...

#include <cache_line.h>

Public Member Functions

 AlignedStorage (size_t bits)
 Construct storage for at least bits bytes, rounded up to 512 bits.
 
void resize (size_t bits)
 Resize storage to hold at least bits bits, rounded up to 512.
 
std::span< CacheLineAsLines ()
 Mutable view as cache lines.
 
std::span< const CacheLineAsConstLines () const
 Const view as cache lines.
 
std::span< uint64_t > As64BitInts ()
 Mutable view as 64-bit words.
 
std::span< const uint64_t > AsConst64BitInts () const
 Const view as 64-bit words.
 
std::span< std::byte > AsBytes ()
 Mutable view as bytes.
 
std::span< const std::byte > AsConstBytes () const
 Const view as bytes.
 
std::span< std::uint16_t > As16BitInts ()
 Mutable view as bytes.
 
std::span< const std::uint16_t > AsConst16BitInts () const
 Const view as bytes.
 

Detailed Description

A simple aligned storage for cache-line sized blocks.

Provides typed views over the same underlying storage as cache lines, 64-bit words, or bytes. All spans are contiguous and sized to the total storage capacity.

Member Function Documentation

◆ As16BitInts()

std::span< std::uint16_t > AlignedStorage::As16BitInts ( )
inline

Mutable view as bytes.

Note
Uses a byte pointer to the underlying storage.

◆ AsBytes()

std::span< std::byte > AlignedStorage::AsBytes ( )
inline

Mutable view as bytes.

Note
Uses a byte pointer to the underlying storage.

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