28 #ifndef __Controller_H__
29 #define __Controller_H__
103 template <
typename T>
134 template <
typename T>
virtual ~ControllerFunction()
void setEnabled(bool enabled)
Sets whether this controller is enabled.
virtual T calculate(T sourceValue)=0
SharedPtr< ControllerValue< T > > mSource
Source value.
SharedPtr< ControllerFunction< T > > mFunc
Function.
bool mDeltaInput
If true, function will add input values together and wrap at 1.0 before evaluating.
virtual ~Controller()
Default d-tor.
Controller(const SharedPtr< ControllerValue< T > > &src, const SharedPtr< ControllerValue< T > > &dest, const SharedPtr< ControllerFunction< T > > &func)
Usual constructor.
bool mEnabled
Controller is enabled or not.
const SharedPtr< ControllerFunction< T > > & getFunction(void) const
Returns a pointer to the function object used by this controller.
ControllerFunction(bool deltaInput)
Constructor.
void setFunction(const SharedPtr< ControllerFunction< T > > &func)
Sets the function object to be used by this controller.
void setDestination(const SharedPtr< ControllerValue< T > > &dest)
Sets the output controller value.
Can either be used as an input or output value.
void update(void)
Tells this controller to map it's input controller value to it's output controller value...
Instances of this class 'control' the value of another object in the system.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void setValue(T value)=0
void setSource(const SharedPtr< ControllerValue< T > > &src)
Sets the input controller value.
T getAdjustedInput(T input)
Gets the input value as adjusted by any delta.
bool getEnabled(void) const
Returns true if this controller is currently enabled.
virtual T getValue(void) const =0
const SharedPtr< ControllerValue< T > > & getDestination(void) const
Gets the output controller value.
Subclasses of this class are responsible for performing a function on an input value for a Controller...
virtual ~ControllerValue()
Reference-counted shared pointer, used for objects where implicit destruction is required.
const SharedPtr< ControllerValue< T > > & getSource(void) const
Gets the input controller value.
SharedPtr< ControllerValue< T > > mDest
Destination value.