LLVM  14.0.0git
Public Member Functions | List of all members
llvm::unique_function< R(P...) const > Class Template Reference

#include "llvm/ADT/FunctionExtras.h"

Inheritance diagram for llvm::unique_function< R(P...) const >:
Inheritance graph
[legend]
Collaboration diagram for llvm::unique_function< R(P...) const >:
Collaboration graph
[legend]

Public Member Functions

 unique_function ()=default
 
 unique_function (std::nullptr_t)
 
 unique_function (unique_function &&)=default
 
 unique_function (const unique_function &)=delete
 
unique_functionoperator= (unique_function &&)=default
 
unique_functionoperator= (const unique_function &)=delete
 
template<typename CallableT >
 unique_function (CallableT Callable, detail::EnableUnlessSameType< CallableT, unique_function > *=nullptr, detail::EnableIfCallable< const CallableT, R, P... > *=nullptr)
 
operator() (P... Params) const
 
- Public Member Functions inherited from llvm::detail::UniqueFunctionBase< R, P... >
 operator bool () const
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::detail::UniqueFunctionBase< R, P... >
NonTrivialCallbacks * getNonTrivialCallbacks () 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)
 
 UniqueFunctionBase (CallableT Callable, CalledAs< CalledAsT >)
 
 UniqueFunctionBase (UniqueFunctionBase &&RHS) noexcept
 
 UniqueFunctionBase ()=default
 
 ~UniqueFunctionBase ()
 
UniqueFunctionBaseoperator= (UniqueFunctionBase &&RHS) noexcept
 
- Static Protected Member Functions inherited from llvm::detail::UniqueFunctionBase< R, P... >
static R CallImpl (void *CallableAddr, AdjustedParamT< ParamTs >... Params)
 
static void MoveImpl (void *LHSCallableAddr, void *RHSCallableAddr) noexcept
 
static void DestroyImpl (void *CallableAddr) noexcept
 
- Protected Attributes inherited from llvm::detail::UniqueFunctionBase< R, P... >
struct IsSizeLessThanThresholdT< T, std::enable_if_t< sizeof(T)<=2 *sizeof(void *)> > :std::true_type {};template< typename T > struct AdjustedParamTBase { static_assert(!std::is_reference< T >::value, "references should be handled by template specialization");using type=typename std::conditional< llvm::is_trivially_copy_constructible< T >::value &&llvm::is_trivially_move_constructible< T >::value &&IsSizeLessThanThresholdT< T >::value, T, T & >::type;};template< typename T > struct AdjustedParamTBase< T & > { using type=T &;};template< typename T > struct AdjustedParamTBase< T && > { using type=T &;};template< typename T > using AdjustedParamT=typename AdjustedParamTBase< T >::type;using CallPtrT=R(*)(void *CallableAddr, AdjustedParamT< ParamTs >... Params);using MovePtrT=void(*)(void *LHSCallableAddr, void *RHSCallableAddr);using DestroyPtrT=void(*)(void *CallableAddr);struct alignas(8) TrivialCallback { CallPtrT CallPtr;};struct alignas(8) NonTrivialCallbacks { CallPtrT CallPtr;MovePtrT MovePtr;DestroyPtrT DestroyPtr;};using CallbackPointerUnionT=PointerUnion< TrivialCallback *, NonTrivialCallbacks * >;union StorageUnionT { struct OutOfLineStorageT { void *StoragePtr;size_t Size;size_t Alignment;} OutOfLineStorage;static_assert(sizeof(OutOfLineStorageT)<=InlineStorageSize, "Should always use all of the out-of-line storage for inline storage!");mutable typename std::aligned_storage< InlineStorageSize, alignof(void *)>::type InlineStorage;} StorageUnion;PointerIntPair< CallbackPointerUnionT, 1, bool > CallbackAndInlineFlag;bool isInlineStorage() const { return CallbackAndInlineFlag.getInt();} bool isTrivialCallback() const { return CallbackAndInlineFlag.getPointer().template is< TrivialCallback * >();} CallPtrT getTrivialCallback() const { return CallbackAndInlineFlag.getPointer().template get< TrivialCallback * >() -> CallPtr
 
- Static Protected Attributes inherited from llvm::detail::UniqueFunctionBase< R, P... >
static constexpr size_t InlineStorageSize
 

Detailed Description

template<typename R, typename... P>
class llvm::unique_function< R(P...) const >

Definition at line 389 of file FunctionExtras.h.

Constructor & Destructor Documentation

◆ unique_function() [1/5]

template<typename R , typename... P>
llvm::unique_function< R(P...) const >::unique_function ( )
default

◆ unique_function() [2/5]

template<typename R , typename... P>
llvm::unique_function< R(P...) const >::unique_function ( std::nullptr_t  )
inline

Definition at line 395 of file FunctionExtras.h.

◆ unique_function() [3/5]

template<typename R , typename... P>
llvm::unique_function< R(P...) const >::unique_function ( unique_function< R(P...) const > &&  )
default

◆ unique_function() [4/5]

template<typename R , typename... P>
llvm::unique_function< R(P...) const >::unique_function ( const unique_function< R(P...) const > &  )
delete

◆ unique_function() [5/5]

template<typename R , typename... P>
template<typename CallableT >
llvm::unique_function< R(P...) const >::unique_function ( CallableT  Callable,
detail::EnableUnlessSameType< CallableT, unique_function< R(P...) const > > *  = nullptr,
detail::EnableIfCallable< const CallableT, R, P... > *  = nullptr 
)
inline

Definition at line 402 of file FunctionExtras.h.

Member Function Documentation

◆ operator()()

template<typename R , typename... P>
R llvm::unique_function< R(P...) const >::operator() ( P...  Params) const
inline

Definition at line 409 of file FunctionExtras.h.

◆ operator=() [1/2]

template<typename R , typename... P>
unique_function& llvm::unique_function< R(P...) const >::operator= ( const unique_function< R(P...) const > &  )
delete

◆ operator=() [2/2]

template<typename R , typename... P>
unique_function& llvm::unique_function< R(P...) const >::operator= ( unique_function< R(P...) const > &&  )
default

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