Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes
icl::utils::Function< R, A, B, C > Struct Template Reference

The General Function Template. More...

#include <Function.h>

List of all members.

Public Member Functions

 Function ()
 Empty constructor (implementation will become null)
 Function (FunctionImpl< R, A, B, C > *impl)
 Constructor with given Impl.
 Function (icl::utils::SmartPtr< FunctionImpl< R, A, B, C > >impl)
 Constructor with given SmartPtr<Impl>
 Function (R(*global_function)(A, B, C))
 Constructor from given global function (for implicit conversion)
operator() (A a, B b, C c) const
 function operator (always const)
 operator bool () const
 checks wheter the implemnetation is not null
 operator Function< void, A, B, C > () const

Public Attributes

icl::utils::SmartPtr
< FunctionImpl< R, A, B, C > > 
impl
 Implementation.

Detailed Description

template<class R = void, class A = void, class B = void, class C = void>
struct icl::utils::Function< R, A, B, C >

The General Function Template.

The Function class can be used as a generic functor that can have one of these backends:

This class should not be used directly! Use the overloaded icl::utils::function - template instead. Functions can be copied as objects. Internally, a SmartPointer is used to manage the actual function implementation.

The Function class template is specialized for functions with less than two parameters. In this case the Function's function-operator() also has less parameters.

See also:
Function Class Creation

Constructor & Destructor Documentation

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::Function ( ) [inline]

Empty constructor (implementation will become null)

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::Function ( FunctionImpl< R, A, B, C > *  impl) [inline]

Constructor with given Impl.

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::Function ( icl::utils::SmartPtr< FunctionImpl< R, A, B, C > >  impl) [inline]

Constructor with given SmartPtr<Impl>

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::Function ( R(*)(A, B, C)  global_function) [inline]

Constructor from given global function (for implicit conversion)

This constructor can be used for implicit conversion. Where a Function<R,A,B> is expected, you can simply pass a global function of type R(*function)(A,B)


Member Function Documentation

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::operator bool ( ) const [inline]

checks wheter the implemnetation is not null

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::Function< R, A, B, C >::operator Function< void, A, B, C > ( ) const [inline]
template<class R = void, class A = void, class B = void, class C = void>
R icl::utils::Function< R, A, B, C >::operator() ( a,
b,
c 
) const [inline]

function operator (always const)

This is const, since the creator template icl::utils::function will automatically create the correct implementation


Member Data Documentation

template<class R = void, class A = void, class B = void, class C = void>
icl::utils::SmartPtr<FunctionImpl<R,A,B,C> > icl::utils::Function< R, A, B, C >::impl

Implementation.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines