TrueReality  v0.1.1912
trUtil::Functor< R, TList, size > Class Template Reference

A functor. More...

#include <Functor.h>

Inheritance diagram for trUtil::Functor< R, TList, size >:
Collaboration diagram for trUtil::Functor< R, TList, size >:

Classes

struct  ByValue
 
struct  FunctorImpl
 
struct  FunImplBase
 
struct  FunStorageImpl
 
struct  MemberFnImpl
 
struct  NewAlloc
 
struct  SelectStored
 
struct  Stored
 
struct  Typeless
 

Public Types

using ResultType = R
 
using TypeListType = TList
 
using ParmsListType = typename CallParms< TList >::ParmsListType
 
using Parm1 = typename trUtil::TypeAtNonStrict< TList, 0, trUtil::NullType >::Result
 
using Parm2 = typename trUtil::TypeAtNonStrict< TList, 1, trUtil::NullType >::Result
 
using Parm3 = typename trUtil::TypeAtNonStrict< TList, 2, trUtil::NullType >::Result
 
using Parm4 = typename trUtil::TypeAtNonStrict< TList, 3, trUtil::NullType >::Result
 
using Parm5 = typename trUtil::TypeAtNonStrict< TList, 4, trUtil::NullType >::Result
 
using Parm6 = typename trUtil::TypeAtNonStrict< TList, 5, trUtil::NullType >::Result
 
using Parm7 = typename trUtil::TypeAtNonStrict< TList, 6, trUtil::NullType >::Result
 

Public Member Functions

 Functor ()
 default construction, assignment and destruction. More...
 
 ~Functor ()
 Destructor. More...
 
 Functor (Functor const &src)
 Copy constructor. More...
 
Functoroperator= (Functor const &src)
 Assignment operator. More...
 
bool operator! () const
 is-empty selector. More...
 
bool valid () const
 Valids this object. More...
 
template<typename F >
 Functor (F const &fun)
 ctor for static fns and arbitrary functors. More...
 
template<class P , typename MF >
 Functor (P const &pobj, MF memfun)
 ctor for member fns (note: raw ptrs and smart ptrs are equally welcome in pobj) More...
 
operator() (ParmsListType const &parms) const
 
operator() () const
 
operator() (Parm1 p1) const
 
operator() (Parm1 p1, Parm2 p2) const
 
operator() (Parm1 p1, Parm2 p2, Parm3 p3) const
 
operator() (Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4) const
 
operator() (Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5) const
 
operator() (Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6) const
 
operator() (Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7) const
 

Private Member Functions

template<class T , class V >
FunImplBase::VTable_init (V const &v)
 

Private Attributes

Stored val_
 
FunImplBase::VTablevptr_
 

Detailed Description

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
class trUtil::Functor< R, TList, size >

A functor.

Definition at line 53 of file Functor.h.

Member Typedef Documentation

◆ Parm1

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm1 = typename trUtil::TypeAtNonStrict<TList, 0, trUtil::NullType>::Result

Definition at line 155 of file Functor.h.

◆ Parm2

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm2 = typename trUtil::TypeAtNonStrict<TList, 1, trUtil::NullType>::Result

Definition at line 156 of file Functor.h.

◆ Parm3

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm3 = typename trUtil::TypeAtNonStrict<TList, 2, trUtil::NullType>::Result

Definition at line 157 of file Functor.h.

◆ Parm4

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm4 = typename trUtil::TypeAtNonStrict<TList, 3, trUtil::NullType>::Result

Definition at line 158 of file Functor.h.

◆ Parm5

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm5 = typename trUtil::TypeAtNonStrict<TList, 4, trUtil::NullType>::Result

Definition at line 159 of file Functor.h.

◆ Parm6

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm6 = typename trUtil::TypeAtNonStrict<TList, 5, trUtil::NullType>::Result

Definition at line 160 of file Functor.h.

◆ Parm7

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::Parm7 = typename trUtil::TypeAtNonStrict<TList, 6, trUtil::NullType>::Result

Definition at line 161 of file Functor.h.

◆ ParmsListType

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::ParmsListType = typename CallParms<TList>::ParmsListType

Definition at line 58 of file Functor.h.

◆ ResultType

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::ResultType = R

Definition at line 56 of file Functor.h.

◆ TypeListType

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
using trUtil::Functor< R, TList, size >::TypeListType = TList

Definition at line 57 of file Functor.h.

Constructor & Destructor Documentation

◆ Functor() [1/4]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
trUtil::Functor< R, TList, size >::Functor ( )
inline

default construction, assignment and destruction.

Definition at line 65 of file Functor.h.

◆ ~Functor()

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
trUtil::Functor< R, TList, size >::~Functor ( )
inline

Destructor.

Definition at line 72 of file Functor.h.

◆ Functor() [2/4]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
trUtil::Functor< R, TList, size >::Functor ( Functor< R, TList, size > const &  src)
inline

Copy constructor.

Parameters
srcSource for the.

Definition at line 84 of file Functor.h.

◆ Functor() [3/4]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
template<typename F >
template< typename F > explicit trUtil::Functor< R, TList, size >::Functor ( F const &  fun)
inlineexplicit

ctor for static fns and arbitrary functors.

Template Parameters
FType of the f.
Parameters
funThe fun.

Definition at line 133 of file Functor.h.

◆ Functor() [4/4]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
template<class P , typename MF >
template< class P, typename MF > explicit trUtil::Functor< R, TList, size >::Functor ( P const &  pobj,
MF  memfun 
)
inlineexplicit

ctor for member fns (note: raw ptrs and smart ptrs are equally welcome in pobj)

Template Parameters
PType of the p.
MFType of the mf.
Parameters
pobjThe pobj.
memfunThe memfun.

Definition at line 149 of file Functor.h.

Member Function Documentation

◆ _init()

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
template<class T , class V >
FunImplBase::VTable* trUtil::Functor< R, TList, size >::_init ( V const &  v)
inlineprivate

Definition at line 219 of file Functor.h.

Referenced by trUtil::Functor< R, TList, size >::FunStorageImpl< T, FunctorImpl< T > >::Clone().

Here is the caller graph for this function:

◆ operator!()

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
bool trUtil::Functor< R, TList, size >::operator! ( ) const
inline

is-empty selector.

Returns
The logical inverse of this value.

Definition at line 114 of file Functor.h.

◆ operator()() [1/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( ParmsListType const &  parms) const
inline

Definition at line 163 of file Functor.h.

◆ operator()() [2/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( ) const
inline

Definition at line 164 of file Functor.h.

◆ operator()() [3/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1) const
inline

Definition at line 165 of file Functor.h.

◆ operator()() [4/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2 
) const
inline

Definition at line 166 of file Functor.h.

◆ operator()() [5/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2,
Parm3  p3 
) const
inline

Definition at line 167 of file Functor.h.

◆ operator()() [6/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4 
) const
inline

Definition at line 168 of file Functor.h.

◆ operator()() [7/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4,
Parm5  p5 
) const
inline

Definition at line 169 of file Functor.h.

◆ operator()() [8/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4,
Parm5  p5,
Parm6  p6 
) const
inline

Definition at line 170 of file Functor.h.

◆ operator()() [9/9]

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
R trUtil::Functor< R, TList, size >::operator() ( Parm1  p1,
Parm2  p2,
Parm3  p3,
Parm4  p4,
Parm5  p5,
Parm6  p6,
Parm7  p7 
) const
inline

Definition at line 171 of file Functor.h.

◆ operator=()

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
Functor & trUtil::Functor< R, TList, size >::operator= ( Functor< R, TList, size > const &  src)
inline

Assignment operator.

Parameters
srcSource for the.
Returns
A shallow copy of this object.

Definition at line 98 of file Functor.h.

◆ valid()

template<typename R, class TList, unsigned int size = 4 * sizeof(void*)>
bool trUtil::Functor< R, TList, size >::valid ( ) const
inline

Valids this object.

Returns
True if it succeeds, false if it fails.

Definition at line 123 of file Functor.h.

Member Data Documentation

◆ val_

◆ vptr_


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