Image Component Library (ICL)
|
The General Function Template. More...
#include <Function.h>
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) | |
R | operator() (A a, B b, C c) const |
function operator (always const) | |
operator bool () const | |
checks wheter the implemnetation is not null | |
operator Function< R, A, B, C > () const | |
Public Attributes | |
icl::utils::SmartPtr < FunctionImpl< R, A, B, C > > | impl |
Implementation. |
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.
icl::utils::Function< R, A, B, C >::Function | ( | ) | [inline] |
Empty constructor (implementation will become null)
icl::utils::Function< R, A, B, C >::Function | ( | FunctionImpl< R, A, B, C > * | impl | ) | [inline] |
Constructor with given Impl.
icl::utils::Function< R, A, B, C >::Function | ( | icl::utils::SmartPtr< FunctionImpl< R, A, B, C > > | impl | ) | [inline] |
Constructor with given SmartPtr<Impl>
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)
icl::utils::Function< R, A, B, C >::operator bool | ( | ) | const [inline] |
checks wheter the implemnetation is not null
icl::utils::Function< R, A, B, C >::operator Function< R, A, B, C > | ( | ) | const [inline] |
R icl::utils::Function< R, A, B, C >::operator() | ( | A | a, |
B | b, | ||
C | c | ||
) | const [inline] |
function operator (always const)
This is const, since the creator template icl::utils::function will automatically create the correct implementation
icl::utils::SmartPtr<FunctionImpl<R,A,B,C> > icl::utils::Function< R, A, B, C >::impl |
Implementation.