Iros
 
Loading...
Searching...
No Matches
di::any::SharedStorage< Alloc > Struct Template Reference

#include <di/any/storage/shared_storage.h>

Public Types

using Manage = meta::Type<detail::SharedStorageManage<SharedStorage, Alloc>>
 
using Interface = meta::List<Manage>
 
template<typename>
using CreationResult = meta::AllocatorResult<Alloc>
 

Public Member Functions

 SharedStorage ()=default
 
 SharedStorage (SharedStorage const &)=default
 
auto operator= (SharedStorage const &) -> SharedStorage &=default
 
 ~SharedStorage ()=default
 
template<typename T>
constexpr auto down_cast () -> T *
 
template<typename T>
constexpr auto down_cast () const -> T const *
 

Static Public Member Functions

static constexpr auto storage_category () -> StorageCategory
 
template<typename T>
static constexpr auto creation_is_fallible (InPlaceType< T >) -> bool
 
template<typename Any, typename T, typename... Args>
requires (concepts::ConstructibleFrom<T, Args...> && creation_is_fallible(in_place_type<T>))
static constexpr void create (InPlaceType< Any >, meta::LikeExpected< CreationResult< T >, Any > &self, InPlaceType< T >, Args &&... args)
 
template<typename T, typename... Args>
requires (concepts::ConstructibleFrom<T, Args...> && alignof(T) <= alignof(usize))
static constexpr auto init (SharedStorage *self, InPlaceType< T >, Args &&... args)
 
static constexpr void copy_construct (concepts::VTableFor< Interface > auto const &vtable, SharedStorage *dest, SharedStorage const *source)
 
static constexpr void move_construct (concepts::VTableFor< Interface > auto &vtable, SharedStorage *dest, SharedStorage *source)
 
template<concepts::VTableFor< Interface > VTable>
static constexpr void copy_assign (VTable &dest_vtable, SharedStorage *dest, VTable const &source_vtable, SharedStorage const *source)
 
template<concepts::VTableFor< Interface > VTable>
static constexpr void move_assign (VTable &dest_vtable, SharedStorage *dest, VTable &source_vtable, SharedStorage *source)
 
static constexpr void destroy (concepts::VTableFor< Interface > auto &vtable, SharedStorage *self)
 

Friends

template<typename, concepts::Allocator>
struct detail::SharedStorageManage
 

Member Typedef Documentation

◆ CreationResult

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename>
using di::any::SharedStorage< Alloc >::CreationResult = meta::AllocatorResult<Alloc>

◆ Interface

template<concepts::Allocator Alloc = platform::DefaultAllocator>
using di::any::SharedStorage< Alloc >::Interface = meta::List<Manage>

◆ Manage

template<concepts::Allocator Alloc = platform::DefaultAllocator>
using di::any::SharedStorage< Alloc >::Manage = meta::Type<detail::SharedStorageManage<SharedStorage, Alloc>>

Constructor & Destructor Documentation

◆ SharedStorage() [1/2]

template<concepts::Allocator Alloc = platform::DefaultAllocator>
di::any::SharedStorage< Alloc >::SharedStorage ( )
default

◆ SharedStorage() [2/2]

template<concepts::Allocator Alloc = platform::DefaultAllocator>
di::any::SharedStorage< Alloc >::SharedStorage ( SharedStorage< Alloc > const & )
default

◆ ~SharedStorage()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
di::any::SharedStorage< Alloc >::~SharedStorage ( )
default

Member Function Documentation

◆ copy_assign()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<concepts::VTableFor< Interface > VTable>
static constexpr void di::any::SharedStorage< Alloc >::copy_assign ( VTable & dest_vtable,
SharedStorage< Alloc > * dest,
VTable const & source_vtable,
SharedStorage< Alloc > const * source )
inlinestaticconstexpr

◆ copy_construct()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
static constexpr void di::any::SharedStorage< Alloc >::copy_construct ( concepts::VTableFor< Interface > auto const & vtable,
SharedStorage< Alloc > * dest,
SharedStorage< Alloc > const * source )
inlinestaticconstexpr

◆ create()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename Any, typename T, typename... Args>
requires (concepts::ConstructibleFrom<T, Args...> && creation_is_fallible(in_place_type<T>))
static constexpr void di::any::SharedStorage< Alloc >::create ( InPlaceType< Any > ,
meta::LikeExpected< CreationResult< T >, Any > & self,
InPlaceType< T > ,
Args &&... args )
inlinestaticconstexpr

◆ creation_is_fallible()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename T>
static constexpr auto di::any::SharedStorage< Alloc >::creation_is_fallible ( InPlaceType< T > ) -> bool
inlinestaticconstexpr

◆ destroy()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
static constexpr void di::any::SharedStorage< Alloc >::destroy ( concepts::VTableFor< Interface > auto & vtable,
SharedStorage< Alloc > * self )
inlinestaticconstexpr

◆ down_cast() [1/2]

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename T>
auto di::any::SharedStorage< Alloc >::down_cast ( ) -> T*
inlineconstexpr

◆ down_cast() [2/2]

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename T>
auto di::any::SharedStorage< Alloc >::down_cast ( ) const -> T const*
inlineconstexpr

◆ init()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename T, typename... Args>
requires (concepts::ConstructibleFrom<T, Args...> && alignof(T) <= alignof(usize))
static constexpr auto di::any::SharedStorage< Alloc >::init ( SharedStorage< Alloc > * self,
InPlaceType< T > ,
Args &&... args )
inlinestaticconstexpr

◆ move_assign()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<concepts::VTableFor< Interface > VTable>
static constexpr void di::any::SharedStorage< Alloc >::move_assign ( VTable & dest_vtable,
SharedStorage< Alloc > * dest,
VTable & source_vtable,
SharedStorage< Alloc > * source )
inlinestaticconstexpr

◆ move_construct()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
static constexpr void di::any::SharedStorage< Alloc >::move_construct ( concepts::VTableFor< Interface > auto & vtable,
SharedStorage< Alloc > * dest,
SharedStorage< Alloc > * source )
inlinestaticconstexpr

◆ operator=()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
auto di::any::SharedStorage< Alloc >::operator= ( SharedStorage< Alloc > const & ) -> SharedStorage &=default
default

◆ storage_category()

template<concepts::Allocator Alloc = platform::DefaultAllocator>
static constexpr auto di::any::SharedStorage< Alloc >::storage_category ( ) -> StorageCategory
inlinestaticconstexpr

Friends And Related Symbol Documentation

◆ detail::SharedStorageManage

template<concepts::Allocator Alloc = platform::DefaultAllocator>
template<typename, concepts::Allocator>
friend struct detail::SharedStorageManage
friend

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