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