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

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15