Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch > Class Template Reference

Implements pimpl idiom without dynamic memory allocation. More...

#include <fast_pimpl.hpp>

Public Member Functions

template<typename... Args>
 explicit (sizeof...(Args)==1) FastPimpl(Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args... >)
 FastPimpl (const FastPimpl &other) noexcept(noexcept(FastPimpl(std::declval< const T & >())))
 FastPimpl (FastPimpl &&other) noexcept(noexcept(FastPimpl(std::declval< T && >())))
 ~FastPimpl () noexcept(noexcept(std::destroy_at(std::declval< T * >())))
FastPimploperator= (const FastPimpl &rhs) noexcept(noexcept(std::declval< T & >()=std::declval< const T & >()))
FastPimploperator= (FastPimpl &&rhs) noexcept(noexcept(std::declval< T & >()=std::declval< T && >()))
FastPimploperator= (const T &value) noexcept(noexcept(std::declval< T & >()=std::declval< const T & >()))
 Copy-assigns from a T instance.
FastPimploperator= (T &&value) noexcept(noexcept(std::declval< T & >()=std::declval< T && >()))
 Move-assigns from a T instance.
T * operator-> () noexcept
const T * operator-> () const noexcept
T & operator* () noexcept
const T & operator* () const noexcept

Detailed Description

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
class helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >

Implements pimpl idiom without dynamic memory allocation.

FastPimpl doesn't require memory allocation or indirect memory access. You must manually set object size and alignment when instantiating FastPimpl.

Template Parameters
TThe implementation type
SizeThe size in bytes to allocate for T
AlignmentThe alignment requirement for T
RequireStrictMatchIf true, requires exact size/alignment match

Definition at line 23 of file fast_pimpl.hpp.

Constructor & Destructor Documentation

◆ FastPimpl() [1/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::FastPimpl ( const FastPimpl< T, Size, Alignment, RequireStrictMatch > & other)
inlinenoexcept

Definition at line 31 of file fast_pimpl.hpp.

◆ FastPimpl() [2/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::FastPimpl ( FastPimpl< T, Size, Alignment, RequireStrictMatch > && other)
inlinenoexcept

Definition at line 35 of file fast_pimpl.hpp.

◆ ~FastPimpl()

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch>
helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::~FastPimpl ( )
inlinenoexcept

Definition at line 83 of file fast_pimpl.hpp.

Member Function Documentation

◆ explicit()

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
template<typename... Args>
helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::explicit ( sizeof... Args = = 1) &&
inlinenoexcept

Definition at line 26 of file fast_pimpl.hpp.

◆ operator*() [1/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
const T & helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator* ( ) const
inlinenoexcept

Definition at line 66 of file fast_pimpl.hpp.

◆ operator*() [2/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
T & helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator* ( )
inlinenoexcept

Definition at line 65 of file fast_pimpl.hpp.

◆ operator->() [1/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
const T * helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator-> ( ) const
inlinenoexcept

Definition at line 64 of file fast_pimpl.hpp.

◆ operator->() [2/2]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch = false>
T * helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator-> ( )
inlinenoexcept

Definition at line 63 of file fast_pimpl.hpp.

◆ operator=() [1/4]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch>
auto helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator= ( const FastPimpl< T, Size, Alignment, RequireStrictMatch > & rhs)
inlinenoexcept

Definition at line 90 of file fast_pimpl.hpp.

◆ operator=() [2/4]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch>
auto helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator= ( const T & value)
inlinenoexcept

Copy-assigns from a T instance.

Parameters
valueSource value
Returns
Reference to this instance

Definition at line 111 of file fast_pimpl.hpp.

◆ operator=() [3/4]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch>
auto helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator= ( FastPimpl< T, Size, Alignment, RequireStrictMatch > && rhs)
inlinenoexcept

Definition at line 101 of file fast_pimpl.hpp.

◆ operator=() [4/4]

template<class T, size_t Size, size_t Alignment, bool RequireStrictMatch>
auto helios::utils::FastPimpl< T, Size, Alignment, RequireStrictMatch >::operator= ( T && value)
inlinenoexcept

Move-assigns from a T instance.

Parameters
valueSource value
Returns
Reference to this instance

Definition at line 122 of file fast_pimpl.hpp.