YOrch 1.0.0
Loading...
Searching...
No Matches
yorch::detail::slot_view< T > Struct Template Reference

Non-owning typed access view over a slot-like storage object. More...

#include <slot_view.hpp>

Public Member Functions

template<typename Slot >
requires (!std::is_same_v<std::remove_cvref_t<Slot>, slot_view>)
constexpr slot_view (Slot &slot, std::size_t owner_node=no_physical_slot) noexcept
 Creates a typed view over slot.
 
 slot_view ()=default
 
template<typename... Args>
constexpr Templace (Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args &&... >)
 
constexpr Tget () &noexcept
 
constexpr const Tget () const &noexcept
 
constexpr void destroy () noexcept
 
constexpr bool has_value () const noexcept
 

Public Attributes

std::byte * storage = nullptr
 
boolengaged = nullptr
 
std::size_t * slot_owner_node = nullptr
 
std::size_t view_owner_node = no_physical_slot
 
slot_physical_policy policy = slot_physical_policy::maybe_payload
 

Detailed Description

template<typename T>
struct yorch::detail::slot_view< T >

Non-owning typed access view over a slot-like storage object.

slot_view<T> lets higher layers treat either a typed_slot<T, ...> or an erased compact-layout slot as storage for T. It carries the physical policy because maybe slots need an engagement flag while must slots do not. For erased compact slots, it also carries owner-node tracking so a later cleanup pass can know which node's T currently lives inside the shared raw storage.

Definition at line 24 of file slot_view.hpp.

Constructor & Destructor Documentation

◆ slot_view() [1/2]

template<typename T >
template<typename Slot >
requires (!std::is_same_v<std::remove_cvref_t<Slot>, slot_view>)
constexpr yorch::detail::slot_view< T >::slot_view ( Slot slot,
std::size_t  owner_node = no_physical_slot 
)
inlineexplicitconstexprnoexcept

Creates a typed view over slot.

owner_node is written into the underlying owner-node record when the view materializes a value. Typed one-to-one slots return a null owner record, while erased compact slots use it to remember which node owns the currently live object.

Definition at line 46 of file slot_view.hpp.

◆ slot_view() [2/2]

template<typename T >
yorch::detail::slot_view< T >::slot_view ( )
default

Member Function Documentation

◆ destroy()

template<typename T >
constexpr void yorch::detail::slot_view< T >::destroy ( )
inlineconstexprnoexcept

Definition at line 96 of file slot_view.hpp.

◆ emplace()

template<typename T >
template<typename... Args>
constexpr T & yorch::detail::slot_view< T >::emplace ( Args &&...  args)
inlineconstexprnoexcept

Definition at line 56 of file slot_view.hpp.

◆ get() [1/2]

template<typename T >
constexpr T & yorch::detail::slot_view< T >::get ( ) &
inlineconstexprnoexcept

Definition at line 78 of file slot_view.hpp.

◆ get() [2/2]

template<typename T >
constexpr const T & yorch::detail::slot_view< T >::get ( ) const &
inlineconstexprnoexcept

Definition at line 87 of file slot_view.hpp.

◆ has_value()

template<typename T >
constexpr bool yorch::detail::slot_view< T >::has_value ( ) const
inlineconstexprnoexcept

Definition at line 116 of file slot_view.hpp.

Member Data Documentation

◆ engaged

template<typename T >
bool* yorch::detail::slot_view< T >::engaged = nullptr

Definition at line 29 of file slot_view.hpp.

◆ policy

◆ slot_owner_node

template<typename T >
std::size_t* yorch::detail::slot_view< T >::slot_owner_node = nullptr

Definition at line 31 of file slot_view.hpp.

◆ storage

template<typename T >
std::byte* yorch::detail::slot_view< T >::storage = nullptr

Definition at line 28 of file slot_view.hpp.

◆ view_owner_node

template<typename T >
std::size_t yorch::detail::slot_view< T >::view_owner_node = no_physical_slot

Definition at line 33 of file slot_view.hpp.


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