Tizen Native API  3.0
Dali::Constraint::Function< P > Class Template Reference

Template for the Function that is called by the Constraint system. More...

Inheritance diagram for Dali::Constraint::Function< P >:
Dali::CallbackBase

Public Member Functions

 Function (void(*function)(P &, const PropertyInputContainer &))
 Constructor which connects to the provided C function (or a static member function).
template<class T >
 Function (const T &object)
 Constructor which copies a function object and connects to the functor of that object.
template<class T >
 Function (const T &object, void(T::*memberFunction)(P &, const PropertyInputContainer &))
 Constructor which copies a function object and allows a connection to a member method.
CallbackBaseClone ()
 Clones the Function object.

Detailed Description

template<typename P>
class Dali::Constraint::Function< P >

Template for the Function that is called by the Constraint system.

Supports:

  • C style functions
  • Static member methods of an object
  • Member functions of a particular class
  • Functors of a particular class
  • If a functor or method is provided, then a copy of the object is made.

The expected signature of the callback should be:

   void Function( P&, const PropertyInputContainer& );

The P& parameter is an in,out parameter which stores the current value of the property. The callback should change this value to the desired one. The PropertyInputContainer is a const reference to the property inputs added to the Constraint in the order they were added via AddSource().

Since:
3.0, DALi version 1.0.0
Template Parameters:
PThe property type to constrain

Constructor & Destructor Documentation

template<typename P >
Dali::Constraint::Function< P >::Function ( void(*)(P &, const PropertyInputContainer &)  function)

Constructor which connects to the provided C function (or a static member function).

The expected signature of the function is:

   void MyFunction( P&, const PropertyInputContainer& );
Since:
3.0, DALi version 1.0.0
Parameters:
[in]functionThe function to call
template<typename P >
template<class T >
Dali::Constraint::Function< P >::Function ( const T &  object)

Constructor which copies a function object and connects to the functor of that object.

The function object should have a functor with the following signature:

   void operator()( P&, const PropertyInputContainer& );
Since:
3.0, DALi version 1.0.0
Parameters:
[in]objectThe object to copy
Template Parameters:
TThe type of the object
template<typename P >
template<class T >
Dali::Constraint::Function< P >::Function ( const T &  object,
void(T::*)(P &, const PropertyInputContainer &)  memberFunction 
)

Constructor which copies a function object and allows a connection to a member method.

The object should have a method with the signature:

   void MyObject::MyMethod( P&, const PropertyInputContainer& );
Since:
3.0, DALi version 1.0.0
Parameters:
[in]objectThe object to copy
[in]memberFunctionThe member function to call. This has to be a member of the same class
Template Parameters:
TThe type of the object

Member Function Documentation

template<typename P >
CallbackBase* Dali::Constraint::Function< P >::Clone ( )

Clones the Function object.

The object, if held by this object, is also copied.

Since:
3.0, DALi version 1.0.0
Returns:
A pointer to a newly-allocated Function