WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
wpi::detail::UniqueFunctionBase< ReturnT, ParamTs > Class Template Reference

#include <wpi/FunctionExtras.h>

Classes

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

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::detail::UniqueFunctionBase::StorageUnionT StorageUnion
 
PointerIntPair< CallbackPointerUnionT, 1, bool > CallbackAndInlineFlag
 

Static Protected Attributes

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

Member Typedef Documentation

◆ AdjustedParamT

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

◆ CallbackPointerUnionT

template<typename ReturnT , typename... ParamTs>
using wpi::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallbackPointerUnionT
protected
Initial value:
PointerUnion<TrivialCallback *, NonTrivialCallbacks *>

◆ CallPtrT

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

◆ DestroyPtrT

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

◆ MovePtrT

template<typename ReturnT , typename... ParamTs>
using wpi::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::detail::UniqueFunctionBase< ReturnT, ParamTs >::UniqueFunctionBase ( CallableT Callable,
CalledAs< CalledAsT >  )
inlineprotected

◆ ~UniqueFunctionBase()

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

◆ UniqueFunctionBase() [2/3]

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

◆ UniqueFunctionBase() [3/3]

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

Member Function Documentation

◆ CallImpl()

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

◆ DestroyImpl()

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

◆ getCalleePtr()

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

◆ getCallPtr()

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

◆ getInlineStorage()

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

◆ getNonTrivialCallbacks()

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

◆ getOutOfLineStorage()

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

◆ getOutOfLineStorageAlignment()

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

◆ getOutOfLineStorageSize()

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

◆ getTrivialCallback()

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

◆ isInlineStorage()

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

◆ isTrivialCallback()

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

◆ MoveImpl()

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

◆ operator bool()

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

◆ operator=()

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

◆ setOutOfLineStorage()

template<typename ReturnT , typename... ParamTs>
void wpi::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::detail::UniqueFunctionBase< ReturnT, ParamTs >::CallbackAndInlineFlag
protected

◆ InlineStorageSize

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

◆ StorageUnion

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

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