WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs > Class Template Reference

#include <wpi/util/FunctionExtras.hpp>

Classes

struct  IsSizeLessThanThresholdT
struct  enable_if_t< sizeof(T)<=2 *sizeof(void *)> >
struct  AdjustedParamTBase
struct  AdjustedParamTBase< T & >
struct  AdjustedParamTBase< T && >
struct  TrivialCallback
 A struct to hold a single trivial callback with sufficient alignment for our bitpacking. More...
struct  NonTrivialCallbacks
 A struct we use to aggregate three callbacks when we need full set of operations. More...
union  StorageUnionT
struct  CallbacksHolder
struct  CallbacksHolder< CallableT, CalledAs, EnableIfTrivial< CallableT > >
struct  CalledAs

Public Member Functions

 operator bool () const

Protected Types

template<typename T>
using AdjustedParamT = typename AdjustedParamTBase<T>::type
using CallPtrT
using MovePtrT = void (*)(void *LHSCallableAddr, void *RHSCallableAddr)
using DestroyPtrT = void (*)(void *CallableAddr)
using CallbackPointerUnionT

Protected Member Functions

bool isInlineStorage () const
bool isTrivialCallback () const
CallPtrT getTrivialCallback () const
NonTrivialCallbacksgetNonTrivialCallbacks () const
CallPtrT getCallPtr () const
void * getCalleePtr () const
void * getInlineStorage () const
void * getOutOfLineStorage () const
size_t getOutOfLineStorageSize () const
size_t getOutOfLineStorageAlignment () const
void setOutOfLineStorage (void *Ptr, size_t Size, size_t Alignment)
template<typename CallableT, typename CalledAsT>
 UniqueFunctionBase (CallableT Callable, CalledAs< CalledAsT >)
 ~UniqueFunctionBase ()
 UniqueFunctionBase (UniqueFunctionBase &&RHS) noexcept
UniqueFunctionBaseoperator= (UniqueFunctionBase &&RHS) noexcept
 UniqueFunctionBase ()=default

Static Protected Member Functions

template<typename CalledAsT>
static ReturnT CallImpl (void *CallableAddr, AdjustedParamT< ParamTs >... Params)
template<typename CallableT>
static void MoveImpl (void *LHSCallableAddr, void *RHSCallableAddr) noexcept
template<typename CallableT>
static void DestroyImpl (void *CallableAddr) noexcept

Protected Attributes

union wpi::util::detail::UniqueFunctionBase::StorageUnionT StorageUnion
PointerIntPair< CallbackPointerUnionT, 1, bool > CallbackAndInlineFlag

Static Protected Attributes

static constexpr size_t InlineStorageSize = sizeof(void *) * 4
static constexpr size_t InlineStorageAlign = alignof(void *)

Member Typedef Documentation

◆ AdjustedParamT

template<typename ReturnT, typename... ParamTs>
template<typename T>
using wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::AdjustedParamT = typename AdjustedParamTBase<T>::type
protected

◆ CallbackPointerUnionT

template<typename ReturnT, typename... ParamTs>
using wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallbackPointerUnionT
protected
Initial value:
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition PointerUnion.hpp:163

◆ CallPtrT

template<typename ReturnT, typename... ParamTs>
using wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallPtrT
protected
Initial value:
ReturnT (*)(void *CallableAddr,
typename AdjustedParamTBase< T >::type AdjustedParamT
Definition FunctionExtras.hpp:125

◆ DestroyPtrT

template<typename ReturnT, typename... ParamTs>
using wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::DestroyPtrT = void (*)(void *CallableAddr)
protected

◆ MovePtrT

template<typename ReturnT, typename... ParamTs>
using wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::MovePtrT = void (*)(void *LHSCallableAddr, void *RHSCallableAddr)
protected

Constructor & Destructor Documentation

◆ UniqueFunctionBase() [1/3]

template<typename ReturnT, typename... ParamTs>
template<typename CallableT, typename CalledAsT>
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase ( CallableT Callable,
CalledAs< CalledAsT >  )
inlineprotected

◆ ~UniqueFunctionBase()

template<typename ReturnT, typename... ParamTs>
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::~UniqueFunctionBase ( )
inlineprotected

◆ UniqueFunctionBase() [2/3]

template<typename ReturnT, typename... ParamTs>
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase ( UniqueFunctionBase< ReturnT, ParamTs > && RHS)
inlineprotectednoexcept

◆ UniqueFunctionBase() [3/3]

template<typename ReturnT, typename... ParamTs>
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase ( )
protecteddefault

Member Function Documentation

◆ CallImpl()

template<typename ReturnT, typename... ParamTs>
template<typename CalledAsT>
ReturnT wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallImpl ( void * CallableAddr,
AdjustedParamT< ParamTs >... Params )
inlinestaticprotected

◆ DestroyImpl()

template<typename ReturnT, typename... ParamTs>
template<typename CallableT>
void wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::DestroyImpl ( void * CallableAddr)
inlinestaticprotectednoexcept

◆ getCalleePtr()

template<typename ReturnT, typename... ParamTs>
void * wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getCalleePtr ( ) const
inlineprotected

◆ getCallPtr()

template<typename ReturnT, typename... ParamTs>
CallPtrT wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getCallPtr ( ) const
inlineprotected

◆ getInlineStorage()

template<typename ReturnT, typename... ParamTs>
void * wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getInlineStorage ( ) const
inlineprotected

◆ getNonTrivialCallbacks()

template<typename ReturnT, typename... ParamTs>
NonTrivialCallbacks * wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getNonTrivialCallbacks ( ) const
inlineprotected

◆ getOutOfLineStorage()

template<typename ReturnT, typename... ParamTs>
void * wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorage ( ) const
inlineprotected

◆ getOutOfLineStorageAlignment()

template<typename ReturnT, typename... ParamTs>
size_t wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorageAlignment ( ) const
inlineprotected

◆ getOutOfLineStorageSize()

template<typename ReturnT, typename... ParamTs>
size_t wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getOutOfLineStorageSize ( ) const
inlineprotected

◆ getTrivialCallback()

template<typename ReturnT, typename... ParamTs>
CallPtrT wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::getTrivialCallback ( ) const
inlineprotected

◆ isInlineStorage()

template<typename ReturnT, typename... ParamTs>
bool wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::isInlineStorage ( ) const
inlineprotected

◆ isTrivialCallback()

template<typename ReturnT, typename... ParamTs>
bool wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::isTrivialCallback ( ) const
inlineprotected

◆ MoveImpl()

template<typename ReturnT, typename... ParamTs>
template<typename CallableT>
void wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::MoveImpl ( void * LHSCallableAddr,
void * RHSCallableAddr )
inlinestaticprotectednoexcept

◆ operator bool()

template<typename ReturnT, typename... ParamTs>
wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::operator bool ( ) const
inlineexplicit

◆ operator=()

template<typename ReturnT, typename... ParamTs>
UniqueFunctionBase & wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::operator= ( UniqueFunctionBase< ReturnT, ParamTs > && RHS)
inlineprotectednoexcept

◆ setOutOfLineStorage()

template<typename ReturnT, typename... ParamTs>
void wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::setOutOfLineStorage ( void * Ptr,
size_t Size,
size_t Alignment )
inlineprotected

Member Data Documentation

◆ CallbackAndInlineFlag

template<typename ReturnT, typename... ParamTs>
PointerIntPair<CallbackPointerUnionT, 1, bool> wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallbackAndInlineFlag
protected

◆ InlineStorageAlign

template<typename ReturnT, typename... ParamTs>
size_t wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::InlineStorageAlign = alignof(void *)
staticconstexprprotected

◆ InlineStorageSize

template<typename ReturnT, typename... ParamTs>
size_t wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::InlineStorageSize = sizeof(void *) * 4
staticconstexprprotected

◆ StorageUnion

template<typename ReturnT, typename... ParamTs>
union wpi::util::detail::UniqueFunctionBase::StorageUnionT wpi::util::detail::UniqueFunctionBase< ReturnT, ParamTs >::StorageUnion
protected

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