Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Animated< T > Class Template Reference

Wraps an animated property so that the initial value is preserved. More...

#include <Animated.hpp>

Public Member Functions

 Animated (const T &value)
 
const T & initial () const
 
void reset (const T &value)
 
T & operator= (const T &value)
 
const T & get () const
 
 operator T& ()
 
 operator const T & () const
 

Private Attributes

_initial = T()
 Initial value.
 
_current = T()
 Current value.
 

Detailed Description

template<typename T>
class Animated< T >

Wraps an animated property so that the initial value is preserved.

Constructor & Destructor Documentation

◆ Animated()

template<typename T >
Animated< T >::Animated ( const T &  value)
inlineexplicit

Constructor.

Parameters
valuethe initial value

Member Function Documentation

◆ get()

template<typename T >
const T & Animated< T >::get ( ) const
inline

Get the current value.

Returns
the current value

◆ initial()

template<typename T >
const T & Animated< T >::initial ( ) const
inline

Get the initial value.

Returns
the saved initial value

◆ operator const T &()

template<typename T >
Animated< T >::operator const T & ( ) const
inline

Conversion operator for the current value.

Returns
a reference the current value

◆ operator T&()

template<typename T >
Animated< T >::operator T& ( )
inline

Conversion operator for the current value.

Returns
a reference to the current value
Note
This will not update the initial value.

◆ operator=()

template<typename T >
T & Animated< T >::operator= ( const T &  value)
inline

Copy assignment operator for the current value.

Parameters
valuethe new current value
Returns
a reference to the current value
Note
This will not update the initial value.

◆ reset()

template<typename T >
void Animated< T >::reset ( const T &  value)
inline

Set the initial value.

Parameters
valuethe initial value

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