soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
TypeEvaluator< T > Class Template Reference

Template class for evaluating interpolated values between a start and end value. More...

#include <TypeEvaluator.h>

Inheritance diagram for TypeEvaluator< T >:
TObjRefImpl< IObjRef > IObjRef

Public Member Functions

 TypeEvaluator ()
 Default constructor.
 
 TypeEvaluator (T start, T end)
 Constructor initializing the start and end values.
 
void setRange (T start, T end)
 Sets the range for the interpolation.
 
void copy (const TypeEvaluator< T > *src)
 Copies the properties of another TypeEvaluator.
 
evaluate (float fraction) const
 Evaluates the interpolated value between the start and end values.
 
- Public Member Functions inherited from TObjRefImpl< IObjRef >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- Public Member Functions inherited from IObjRef
long AddRef () PURE
 Increases the reference count.
 
long Release () PURE
 Decreases the reference count.
 
void OnFinalRelease () PURE
 Called when the reference count reaches zero and the object is about to be released.
 

Public Attributes

mStart
 Starting value for the interpolation.
 
mEnd
 Ending value for the interpolation.
 

Additional Inherited Members

- Protected Attributes inherited from TObjRefImpl< IObjRef >
LONG m_cRef
 Reference count.
 

Detailed Description

template<typename T>
class TypeEvaluator< T >

Template class for evaluating interpolated values between a start and end value.

Template Parameters
TThe type of the values to evaluate.

Definition at line 40 of file TypeEvaluator.h.

Constructor & Destructor Documentation

◆ TypeEvaluator() [1/2]

template<typename T>
TypeEvaluator< T >::TypeEvaluator ( )
inline

Default constructor.

Definition at line 56 of file TypeEvaluator.h.

◆ TypeEvaluator() [2/2]

template<typename T>
TypeEvaluator< T >::TypeEvaluator ( T start,
T end )
inline

Constructor initializing the start and end values.

Parameters
startThe starting value.
endThe ending value.

Definition at line 65 of file TypeEvaluator.h.

Member Function Documentation

◆ copy()

template<typename T>
void TypeEvaluator< T >::copy ( const TypeEvaluator< T > * src)
inline

Copies the properties of another TypeEvaluator.

Parameters
srcThe source TypeEvaluator to copy from.

Definition at line 86 of file TypeEvaluator.h.

◆ evaluate()

template<typename T>
T TypeEvaluator< T >::evaluate ( float fraction) const
inline

Evaluates the interpolated value between the start and end values.

Parameters
fractionThe fraction from the starting to the ending values.
Returns
The linearly interpolated value.

Definition at line 97 of file TypeEvaluator.h.

◆ setRange()

template<typename T>
void TypeEvaluator< T >::setRange ( T start,
T end )
inline

Sets the range for the interpolation.

Parameters
startThe starting value.
endThe ending value.

Definition at line 76 of file TypeEvaluator.h.

Member Data Documentation

◆ mEnd

template<typename T>
T TypeEvaluator< T >::mEnd

Ending value for the interpolation.

Definition at line 50 of file TypeEvaluator.h.

◆ mStart

template<typename T>
T TypeEvaluator< T >::mStart

Starting value for the interpolation.

Definition at line 45 of file TypeEvaluator.h.


The documentation for this class was generated from the following file: