Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::FunctionCall< ReturnType(Types...)> Class Template Reference

Specialize for an arbitrary function signature. More...

#include "functioncall.h"

Inheritance diagram for ion::base::FunctionCall< ReturnType(Types...)>:
Collaboration diagram for ion::base::FunctionCall< ReturnType(Types...)>:

Public Member Functions

 FunctionCall (ReturnType(*func)(Types...), Types &&...args)
 Constructor for a free function (general non-member function). More...
 
 FunctionCall (const std::function< ReturnType(Types...)> &func, Types &&...args)
 Constructor for a std::function (returned by std::bind()). More...
 
 ~FunctionCall () override
 
void operator() () const override
 Calls the wrapped function with the stored arguments. More...
 
template<size_t I>
const std::tuple_element< I,
std::tuple< Types...> >::type
GetArg () const
 Returns a const reference to the Ith argument of the function call. More...
 
template<size_t I>
void SetArg (const typename std::tuple_element< I, std::tuple< Types...> >::type &value)
 Sets the Ith argument of the stored arguments to the passed value. More...
 
const AllocatorPtrGetAllocator () const
 Returns the Allocator that was used for the instance. More...
 
const AllocatorPtrGetNonNullAllocator () const
 Return our allocator, or the default allocator if the instance was declared on the stack. More...
 
const AllocatorPtrGetAllocatorForLifetime (AllocationLifetime lifetime) const
 Convenience function that returns the Allocator to use to allocate an object with a specific lifetime. More...
 
void * operator new (size_t size)
 The standard no-parameter new operator uses the default Allocator. More...
 
void * operator new (size_t size, AllocationLifetime lifetime)
 This overloaded version of the new operator uses the AllocationManager's default Allocator for the specified lifetime. More...
 
void * operator new (size_t size, const AllocatorPtr &allocator)
 This overloaded version of the new operator takes the Allocator to use directly as a parameter. More...
 
void * operator new (size_t size, const AllocatorPtr &allocator, void *ptr)
 Special operator new for using placement new with Allocatables. More...
 
void * operator new (size_t size, void *ptr)
 The placement new operator is defined conventionally. More...
 
void operator delete (void *ptr)
 Define the delete operator to use specialized functions dealing with an Allocator. More...
 
void operator delete (void *ptr, AllocationLifetime lifetime)
 Windows requires these (or it issues C4291 warnings). More...
 
void operator delete (void *ptr, const AllocatorPtr &allocator)
 
void operator delete (void *ptr, void *ptr2)
 The placement delete operator does nothing, as usual. More...
 

Detailed Description

template<typename ReturnType, typename... Types>
class ion::base::FunctionCall< ReturnType(Types...)>

Specialize for an arbitrary function signature.

Definition at line 63 of file functioncall.h.

Constructor & Destructor Documentation

template<typename ReturnType , typename... Types>
ion::base::FunctionCall< ReturnType(Types...)>::FunctionCall ( ReturnType(*)(Types...)  func,
Types &&...  args 
)
inline

Constructor for a free function (general non-member function).

Definition at line 66 of file functioncall.h.

template<typename ReturnType , typename... Types>
ion::base::FunctionCall< ReturnType(Types...)>::FunctionCall ( const std::function< ReturnType(Types...)> &  func,
Types &&...  args 
)
inline

Constructor for a std::function (returned by std::bind()).

Definition at line 72 of file functioncall.h.

template<typename ReturnType , typename... Types>
ion::base::FunctionCall< ReturnType(Types...)>::~FunctionCall ( )
inlineoverride

Definition at line 78 of file functioncall.h.

Member Function Documentation

const AllocatorPtr& ion::base::Allocatable::GetAllocator ( ) const
inlineinherited

Returns the Allocator that was used for the instance.

This will be NULL if the instance was declared on the stack or created with normal placement new.

Definition at line 68 of file allocatable.h.

References allocator_.

Referenced by ion::base::DataContainer::CreateAndCopy(), ion::text::DynamicFontImage::FindContainingImageDataIndex(), and ion::text::DynamicFontImage::FindImageDataIndex().

template<typename ReturnType , typename... Types>
template<size_t I>
const std::tuple_element<I, std::tuple<Types...> >::type& ion::base::FunctionCall< ReturnType(Types...)>::GetArg ( ) const
inline

Returns a const reference to the Ith argument of the function call.

Definition at line 93 of file functioncall.h.

const AllocatorPtr& ion::base::Allocatable::GetNonNullAllocator ( ) const
inlineinherited

Return our allocator, or the default allocator if the instance was declared on the stack.

Definition at line 72 of file allocatable.h.

References allocator_, and ion::base::AllocationManager::GetNonNullAllocator().

void ion::base::Allocatable::operator delete ( void *  ptr)
inlineinherited

Define the delete operator to use specialized functions dealing with an Allocator.

Definition at line 109 of file allocatable.h.

void ion::base::Allocatable::operator delete ( void *  ptr,
AllocationLifetime  lifetime 
)
inlineinherited

Windows requires these (or it issues C4291 warnings).

Definition at line 112 of file allocatable.h.

void ion::base::Allocatable::operator delete ( void *  ptr,
const AllocatorPtr allocator 
)
inlineinherited

Definition at line 113 of file allocatable.h.

void ion::base::Allocatable::operator delete ( void *  ptr,
void *  ptr2 
)
inlineinherited

The placement delete operator does nothing, as usual.

Definition at line 118 of file allocatable.h.

void* ion::base::Allocatable::operator new ( size_t  size)
inlineinherited

The standard no-parameter new operator uses the default Allocator.

Definition at line 84 of file allocatable.h.

void* ion::base::Allocatable::operator new ( size_t  size,
AllocationLifetime  lifetime 
)
inlineinherited

This overloaded version of the new operator uses the AllocationManager's default Allocator for the specified lifetime.

Definition at line 88 of file allocatable.h.

void* ion::base::Allocatable::operator new ( size_t  size,
const AllocatorPtr allocator 
)
inlineinherited

This overloaded version of the new operator takes the Allocator to use directly as a parameter.

If the Allocator pointer is NULL, this uses the default Allocator.

Definition at line 95 of file allocatable.h.

void* ion::base::Allocatable::operator new ( size_t  size,
const AllocatorPtr allocator,
void *  ptr 
)
inlineinherited

Special operator new for using placement new with Allocatables.

Definition at line 100 of file allocatable.h.

void* ion::base::Allocatable::operator new ( size_t  size,
void *  ptr 
)
inlineinherited

The placement new operator is defined conventionally.

Definition at line 105 of file allocatable.h.

template<typename ReturnType , typename... Types>
void ion::base::FunctionCall< ReturnType(Types...)>::operator() ( ) const
inlineoverridevirtual

Calls the wrapped function with the stored arguments.

Implements ion::base::FunctionCallBase.

Definition at line 81 of file functioncall.h.

template<typename ReturnType , typename... Types>
template<size_t I>
void ion::base::FunctionCall< ReturnType(Types...)>::SetArg ( const typename std::tuple_element< I, std::tuple< Types...> >::type value)
inline

Sets the Ith argument of the stored arguments to the passed value.

Definition at line 100 of file functioncall.h.


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