Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::PropertyConstraint< PropertyType > Class Template Reference

A class for connecting properties to a constraint function. More...

#include <property-constraint.h>

Collaboration diagram for Dali::Internal::PropertyConstraint< PropertyType >:
Collaboration graph
[legend]

Public Types

typedef std::vector
< PropertyInputAccessor
InputContainer
 
typedef InputContainer::iterator InputContainerIter
 
typedef
InputContainer::const_iterator 
InputContainerConstIter
 
typedef std::vector
< PropertyInputIndexer
< PropertyInputAccessor > > 
InputIndexerContainer
 
typedef
Dali::Constraint::Function
< PropertyType > 
ConstraintFunction
 

Public Member Functions

 PropertyConstraint (Dali::Constraint::Function< PropertyType > *func)
 Create a property constraint. More...
 
 PropertyConstraint (Dali::Constraint::Function< PropertyType > *func, const InputContainer &inputs)
 Constructor. More...
 
 ~PropertyConstraint ()
 Non virtual destructor. More...
 
PropertyConstraint
< PropertyType > * 
Clone ()
 Clone a property constraint. More...
 
void SetInput (unsigned int index, int componentIndex, const PropertyInputImpl &input)
 Set the input for one of the property constraint parameters. More...
 
const PropertyInputImplGetInput (unsigned int index) const
 Retrieve the input for one of the property constraint parameters. More...
 
bool InputsInitialized ()
 Query whether all of the inputs have been initialized. More...
 
bool InputsChanged ()
 Query whether any of the inputs have changed. More...
 
void Apply (BufferIndex bufferIndex, PropertyType &current)
 Apply the constraint. More...
 

Private Member Functions

 PropertyConstraint (const PropertyConstraint &)
 
PropertyConstraintoperator= (const PropertyConstraint &rhs)
 

Private Attributes

bool mInputsInitialized
 
ConstraintFunctionmFunction
 
InputContainer mInputs
 

Detailed Description

template<typename PropertyType>
class Dali::Internal::PropertyConstraint< PropertyType >

A class for connecting properties to a constraint function.

Definition at line 39 of file property-constraint.h.

Member Typedef Documentation

template<typename PropertyType>
typedef Dali::Constraint::Function< PropertyType > Dali::Internal::PropertyConstraint< PropertyType >::ConstraintFunction

Definition at line 49 of file property-constraint.h.

template<typename PropertyType>
typedef std::vector< PropertyInputAccessor > Dali::Internal::PropertyConstraint< PropertyType >::InputContainer

Definition at line 43 of file property-constraint.h.

template<typename PropertyType>
typedef InputContainer::const_iterator Dali::Internal::PropertyConstraint< PropertyType >::InputContainerConstIter

Definition at line 45 of file property-constraint.h.

template<typename PropertyType>
typedef InputContainer::iterator Dali::Internal::PropertyConstraint< PropertyType >::InputContainerIter

Definition at line 44 of file property-constraint.h.

template<typename PropertyType>
typedef std::vector< PropertyInputIndexer< PropertyInputAccessor > > Dali::Internal::PropertyConstraint< PropertyType >::InputIndexerContainer

Definition at line 47 of file property-constraint.h.

Constructor & Destructor Documentation

template<typename PropertyType>
Dali::Internal::PropertyConstraint< PropertyType >::PropertyConstraint ( Dali::Constraint::Function< PropertyType > *  func)
inline

Create a property constraint.

Parameters
[in]funcA constraint function. Ownership of this callback-function is passed to this object.

Definition at line 56 of file property-constraint.h.

template<typename PropertyType>
Dali::Internal::PropertyConstraint< PropertyType >::PropertyConstraint ( Dali::Constraint::Function< PropertyType > *  func,
const InputContainer inputs 
)
inline

Constructor.

Parameters
[in]funcA constraint function. Ownership of this callback-function is passed to this object.
[in]inputsProperty inputs.

Definition at line 68 of file property-constraint.h.

template<typename PropertyType>
Dali::Internal::PropertyConstraint< PropertyType >::~PropertyConstraint ( )
inline

Non virtual destructor.

Definition at line 79 of file property-constraint.h.

References Dali::Internal::PropertyConstraint< PropertyType >::mFunction.

template<typename PropertyType>
Dali::Internal::PropertyConstraint< PropertyType >::PropertyConstraint ( const PropertyConstraint< PropertyType > &  )
private

Member Function Documentation

template<typename PropertyType>
void Dali::Internal::PropertyConstraint< PropertyType >::Apply ( BufferIndex  bufferIndex,
PropertyType &  current 
)
inline

Apply the constraint.

Parameters
[in]bufferIndexThe current update buffer index.
[in,out]currentThe current property value, will be set to the constrained value upon return.

Definition at line 179 of file property-constraint.h.

References DALI_ASSERT_DEBUG, Dali::Internal::PropertyConstraint< PropertyType >::mFunction, Dali::Internal::PropertyConstraint< PropertyType >::mInputs, Dali::Vector< T, IsTrivialType >::PushBack(), and Dali::Vector< T, IsTrivialType >::Reserve().

Here is the call graph for this function:

template<typename PropertyType>
PropertyConstraint< PropertyType >* Dali::Internal::PropertyConstraint< PropertyType >::Clone ( )
inline

Clone a property constraint.

Returns
The clone of the property-constraint.
Note
This function will create a copy of the stored constraint function for the clone.

Definition at line 91 of file property-constraint.h.

References Dali::Constraint::Function< P >::Clone(), Dali::Internal::PropertyConstraint< PropertyType >::mFunction, and Dali::Internal::PropertyConstraint< PropertyType >::mInputs.

Here is the call graph for this function:

template<typename PropertyType>
const PropertyInputImpl* Dali::Internal::PropertyConstraint< PropertyType >::GetInput ( unsigned int  index) const
inline

Retrieve the input for one of the property constraint parameters.

Parameters
[in]indexThe parameter index.
Returns
The property input, or NULL if no input exists with this index.

Definition at line 116 of file property-constraint.h.

References Dali::Internal::PropertyConstraint< PropertyType >::mInputs.

Referenced by Dali::Internal::PropertyConstraint< PropertyType >::InputsChanged(), and Dali::Internal::PropertyConstraint< PropertyType >::InputsInitialized().

Here is the caller graph for this function:

template<typename PropertyType>
bool Dali::Internal::PropertyConstraint< PropertyType >::InputsChanged ( )
inline

Query whether any of the inputs have changed.

Returns
True if any of the inputs have changed.

Definition at line 157 of file property-constraint.h.

References Dali::Internal::PropertyConstraint< PropertyType >::GetInput().

Here is the call graph for this function:

template<typename PropertyType>
bool Dali::Internal::PropertyConstraint< PropertyType >::InputsInitialized ( )
inline

Query whether all of the inputs have been initialized.

Returns
True if all of the inputs have been initialized.

Definition at line 130 of file property-constraint.h.

References Dali::Internal::PropertyConstraint< PropertyType >::GetInput(), and Dali::Internal::PropertyConstraint< PropertyType >::mInputsInitialized.

Here is the call graph for this function:

template<typename PropertyType>
PropertyConstraint& Dali::Internal::PropertyConstraint< PropertyType >::operator= ( const PropertyConstraint< PropertyType > &  rhs)
private
template<typename PropertyType>
void Dali::Internal::PropertyConstraint< PropertyType >::SetInput ( unsigned int  index,
int  componentIndex,
const PropertyInputImpl input 
)
inline

Set the input for one of the property constraint parameters.

Parameters
[in]indexThe parameter index.
[in]inputThe interface for receiving a property value.

Definition at line 101 of file property-constraint.h.

References Dali::Internal::PropertyConstraint< PropertyType >::mInputs.

Referenced by Dali::Internal::Constraint< PropertyType >::ConnectConstraintFunction(), and Dali::Internal::Constraint< float >::ConnectConstraintFunction().

Here is the caller graph for this function:

Member Data Documentation

template<typename PropertyType>
ConstraintFunction* Dali::Internal::PropertyConstraint< PropertyType >::mFunction
private
template<typename PropertyType>
InputContainer Dali::Internal::PropertyConstraint< PropertyType >::mInputs
private
template<typename PropertyType>
bool Dali::Internal::PropertyConstraint< PropertyType >::mInputsInitialized
private

The documentation for this class was generated from the following file:
Dali Docs Home
Read more about Dali