Embedded Multicore Building Blocks V1.0.0
Classes | Functions
Function

Function wrapper and binding of parameters. More...

Classes

class  embb::base::Placeholder
 Provides placeholders for Function arguments used in Bind() More...
 
class  embb::base::Function< ReturnType,... >
 Wraps function pointers, member function pointers, and functors with up to five arguments. More...
 

Functions

template<class ClassType , typename ReturnType , ... >
Function< ReturnType,[Arg1,..., Arg5]> embb::base::MakeFunction (ClassType &obj, ReturnType(ClassType::*func)([Arg1,..., Arg5]))
 Wraps an object and a member function pointer into a Function. More...
 
template<typename ReturnType , ... >
Function< ReturnType,[Arg1,..., Arg5]> embb::base::MakeFunction (ReturnType(*func)([Arg1,..., Arg5]))
 Wraps a function pointer into a Function. More...
 
template<typename ReturnType , UnboundArgument , Arg1 , ... >
Function< ReturnType[, UnboundArgument]> embb::base::Bind (Function< ReturnType, Arg1[,..., Arg5]> func, Arg1 value1,...)
 Binds given values as arguments of func into a new Function. More...
 

Detailed Description

Function wrapper and binding of parameters.

Function Documentation

template<class ClassType , typename ReturnType , ... >
Function<ReturnType, [Arg1, ..., Arg5]> embb::base::MakeFunction ( ClassType &  obj,
ReturnType(ClassType::*)([Arg1,..., Arg5])  func 
)

Wraps an object and a member function pointer into a Function.

Returns
Function with same return value and argument syntax as func
See also
Function
Template Parameters
ClassTypeClass that contains the member function pointed to by func.
ReturnTypeReturn type of member function pointed to by func
[Arg1,...,Arg5](Optional) Types of up to five arguments of the member function
Parameters
[in]objReference to the object with corresponding member function
[in]funcMember function pointer with up to five optional arguments
template<typename ReturnType , ... >
Function<ReturnType, [Arg1, ..., Arg5]> embb::base::MakeFunction ( ReturnType(*)([Arg1,..., Arg5])  func)

Wraps a function pointer into a Function.

Returns
Function with same return value and argument syntax as func
See also
Function
Template Parameters
ReturnTypeReturn type of member function pointed to by func.
[Arg1,...,Arg5](Optional) Types of up to five arguments of the member function
Parameters
[in]funcFunction pointer with up to five optional arguments
template<typename ReturnType , UnboundArgument , Arg1 , ... >
Function<ReturnType[, UnboundArgument]> embb::base::Bind ( Function< ReturnType, Arg1[,..., Arg5]>  func,
Arg1  value1,
  ... 
)

Binds given values as arguments of func into a new Function.

The new Function has no arguments or one, if Placeholder::_1 is given as one of the values. The position of Placeholder::_1 determines which argument of func is not bound.

Dynamic memory allocation
Allocates dynamic memory to hold the parameters.
Returns
Function that uses given values as parameters
See also
Placeholder, Function
Template Parameters
ReturnTypeReturn type of func and parameterless function returned
[UnboundArgument]Type of not bound argument of func, only present when a placeholder is used as value in the bind.
Arg1[,...,Arg5]Types of up to five arguments of the values to bind
Parameters
[in]funcThe Function to bind the values (value1, ...) to
[in]value1At least one and up to five values to bind as arguments of func. Placeholder::_1 can be used instead of one of the values to keep the corresponding argument of func unbound.