OpenWareLaboratory
TakeoverValue< T, Value > Class Template Reference

TakeoverValue allows parameters to implement Takeover logic. More...

Inheritance diagram for TakeoverValue< T, Value >:
Collaboration diagram for TakeoverValue< T, Value >:

Public Member Functions

const float DEFAULT_DELTA
 
const int DEFAULT_DELTA
 
const float DEFAULT_DELTA
 
const int DEFAULT_DELTA
 
const float DEFAULT_EXP_C
 
const int DEFAULT_EXP_C
 
const float DEFAULT_EXP_C
 
const int DEFAULT_EXP_C
 
const float DEFAULT_EXP_K
 
const int DEFAULT_EXP_K
 
const float DEFAULT_EXP_K
 
const int DEFAULT_EXP_K
 
const float DEFAULT_LAMBDA
 
const int DEFAULT_LAMBDA
 
const float DEFAULT_LAMBDA
 
const int DEFAULT_LAMBDA
 
const float DEFAULT_LOG_C
 
const int DEFAULT_LOG_C
 
const float DEFAULT_LOG_C
 
const int DEFAULT_LOG_C
 
const float DEFAULT_LOG_K
 
const int DEFAULT_LOG_K
 
const float DEFAULT_LOG_K
 
const int DEFAULT_LOG_K
 
get ()
 
bool isLocked ()
 
 operator T ()
 
TakeoverValue< T, Value > & operator*= (const T &other)
 
TakeoverValue< T, Value > & operator+= (const T &other)
 
TakeoverValue< T, Value > & operator-= (const T &other)
 
TakeoverValue< T, Value > & operator/= (const T &other)
 
TakeoverValue< T, Value > & operator= (const T &x)
 
void reset (T x)
 
void setLocked (bool value)
 
 TakeoverValue ()
 
 TakeoverValue (const TakeoverValue< T > &other)
 
 TakeoverValue (T threshold, T init)
 
 TakeoverValue (T value)
 
void update (T x)
 

Static Public Attributes

static const T DEFAULT_DELTA
 
static const T DEFAULT_EXP_C
 
static const T DEFAULT_EXP_K
 
static const T DEFAULT_LAMBDA
 
static const T DEFAULT_LOG_C
 
static const T DEFAULT_LOG_K
 

Protected Attributes

bool locked = false
 
threshold = Value::DEFAULT_DELTA
 
value
 

Detailed Description

template<typename T, typename Value = SimpleValue<T>>
class TakeoverValue< T, Value >

TakeoverValue allows parameters to implement Takeover logic.

Takeover logic, also known as 'Match' or 'Soft Takeover', allows for controls to be multiplexed while avoiding sudden jumps in settings. Other common control modes are 'Relative' and 'Jump-to' or 'Skip'.

A TakeoverValue can be locked by calling setLocked(true). Further updates are then prevented, until either the TakeoverValue is manually unlocked (i.e. with setLocked(false)), or the new value falls within a given threshold of the previously set value.

Definition at line 19 of file TakeoverValue.h.

Constructor & Destructor Documentation

◆ TakeoverValue() [1/4]

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue< T, Value >::TakeoverValue ( )
inline

Definition at line 24 of file TakeoverValue.h.

◆ TakeoverValue() [2/4]

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue< T, Value >::TakeoverValue ( value)
inline

Definition at line 25 of file TakeoverValue.h.

◆ TakeoverValue() [3/4]

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue< T, Value >::TakeoverValue ( const TakeoverValue< T > &  other)
inline

Definition at line 26 of file TakeoverValue.h.

◆ TakeoverValue() [4/4]

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue< T, Value >::TakeoverValue ( threshold,
init 
)
inline

Definition at line 27 of file TakeoverValue.h.

Member Function Documentation

◆ DEFAULT_DELTA() [1/4]

const float SimpleValue< float >::DEFAULT_DELTA
inherited

Definition at line 11 of file SimpleValue.cpp.

◆ DEFAULT_DELTA() [2/4]

const int SimpleValue< int >::DEFAULT_DELTA
inherited

Definition at line 17 of file SimpleValue.cpp.

◆ DEFAULT_DELTA() [3/4]

const float SimpleValue< float >::DEFAULT_DELTA
inherited

Definition at line 61 of file SimpleValue.h.

◆ DEFAULT_DELTA() [4/4]

const int SimpleValue< int >::DEFAULT_DELTA
inherited

Definition at line 67 of file SimpleValue.h.

◆ DEFAULT_EXP_C() [1/4]

const float SimpleValue< float >::DEFAULT_EXP_C
inherited

Definition at line 12 of file SimpleValue.cpp.

◆ DEFAULT_EXP_C() [2/4]

const int SimpleValue< int >::DEFAULT_EXP_C
inherited

Definition at line 18 of file SimpleValue.cpp.

◆ DEFAULT_EXP_C() [3/4]

const float SimpleValue< float >::DEFAULT_EXP_C
inherited

Definition at line 62 of file SimpleValue.h.

◆ DEFAULT_EXP_C() [4/4]

const int SimpleValue< int >::DEFAULT_EXP_C
inherited

Definition at line 68 of file SimpleValue.h.

◆ DEFAULT_EXP_K() [1/4]

const float SimpleValue< float >::DEFAULT_EXP_K
inherited

Definition at line 13 of file SimpleValue.cpp.

◆ DEFAULT_EXP_K() [2/4]

const int SimpleValue< int >::DEFAULT_EXP_K
inherited

Definition at line 19 of file SimpleValue.cpp.

◆ DEFAULT_EXP_K() [3/4]

const float SimpleValue< float >::DEFAULT_EXP_K
inherited

Definition at line 63 of file SimpleValue.h.

◆ DEFAULT_EXP_K() [4/4]

const int SimpleValue< int >::DEFAULT_EXP_K
inherited

Definition at line 69 of file SimpleValue.h.

◆ DEFAULT_LAMBDA() [1/4]

const float SimpleValue< float >::DEFAULT_LAMBDA
inherited

Definition at line 10 of file SimpleValue.cpp.

◆ DEFAULT_LAMBDA() [2/4]

const int SimpleValue< int >::DEFAULT_LAMBDA
inherited

Definition at line 16 of file SimpleValue.cpp.

◆ DEFAULT_LAMBDA() [3/4]

const float SimpleValue< float >::DEFAULT_LAMBDA
inherited

Definition at line 60 of file SimpleValue.h.

◆ DEFAULT_LAMBDA() [4/4]

const int SimpleValue< int >::DEFAULT_LAMBDA
inherited

Definition at line 66 of file SimpleValue.h.

◆ DEFAULT_LOG_C() [1/4]

const float SimpleValue< float >::DEFAULT_LOG_C
inherited

Definition at line 14 of file SimpleValue.cpp.

◆ DEFAULT_LOG_C() [2/4]

const int SimpleValue< int >::DEFAULT_LOG_C
inherited

Definition at line 20 of file SimpleValue.cpp.

◆ DEFAULT_LOG_C() [3/4]

const float SimpleValue< float >::DEFAULT_LOG_C
inherited

Definition at line 64 of file SimpleValue.h.

◆ DEFAULT_LOG_C() [4/4]

const int SimpleValue< int >::DEFAULT_LOG_C
inherited

Definition at line 70 of file SimpleValue.h.

◆ DEFAULT_LOG_K() [1/4]

const float SimpleValue< float >::DEFAULT_LOG_K
inherited

Definition at line 15 of file SimpleValue.cpp.

◆ DEFAULT_LOG_K() [2/4]

const int SimpleValue< int >::DEFAULT_LOG_K
inherited

Definition at line 21 of file SimpleValue.cpp.

◆ DEFAULT_LOG_K() [3/4]

const float SimpleValue< float >::DEFAULT_LOG_K
inherited

Definition at line 65 of file SimpleValue.h.

◆ DEFAULT_LOG_K() [4/4]

const int SimpleValue< int >::DEFAULT_LOG_K
inherited

Definition at line 71 of file SimpleValue.h.

◆ get()

template<typename T >
T SimpleValue< T >::get ( )
inlineinherited

Definition at line 19 of file SimpleValue.h.

References SimpleValue< T >::value.

Referenced by SimpleValue< T >::operator T().

◆ isLocked()

template<typename T , typename Value = SimpleValue<T>>
bool TakeoverValue< T, Value >::isLocked ( )
inline

Definition at line 31 of file TakeoverValue.h.

References TakeoverValue< T, Value >::locked.

◆ operator T()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue< T, Value >::operator T ( )
inline

Definition at line 40 of file TakeoverValue.h.

◆ operator*=()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue<T, Value>& TakeoverValue< T, Value >::operator*= ( const T &  other)
inline

Definition at line 55 of file TakeoverValue.h.

References TakeoverValue< T, Value >::update().

◆ operator+=()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue<T, Value>& TakeoverValue< T, Value >::operator+= ( const T &  other)
inline

Definition at line 47 of file TakeoverValue.h.

References TakeoverValue< T, Value >::update().

◆ operator-=()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue<T, Value>& TakeoverValue< T, Value >::operator-= ( const T &  other)
inline

Definition at line 51 of file TakeoverValue.h.

References TakeoverValue< T, Value >::update().

◆ operator/=()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue<T, Value>& TakeoverValue< T, Value >::operator/= ( const T &  other)
inline

Definition at line 59 of file TakeoverValue.h.

References TakeoverValue< T, Value >::update().

◆ operator=()

template<typename T , typename Value = SimpleValue<T>>
TakeoverValue<T, Value>& TakeoverValue< T, Value >::operator= ( const T &  x)
inline

Definition at line 43 of file TakeoverValue.h.

References TakeoverValue< T, Value >::update().

◆ reset()

template<typename T >
void SimpleValue< T >::reset ( x)
inlineinherited

Definition at line 22 of file SimpleValue.h.

References SimpleValue< T >::value.

◆ setLocked()

template<typename T , typename Value = SimpleValue<T>>
void TakeoverValue< T, Value >::setLocked ( bool  value)
inline

Definition at line 28 of file TakeoverValue.h.

References TakeoverValue< T, Value >::locked, and SimpleValue< T >::value.

◆ update()

Field Documentation

◆ DEFAULT_DELTA

template<typename T >
const T SimpleValue< T >::DEFAULT_DELTA
staticinherited

Definition at line 52 of file SimpleValue.h.

◆ DEFAULT_EXP_C

template<typename T >
const T SimpleValue< T >::DEFAULT_EXP_C
staticinherited

Definition at line 53 of file SimpleValue.h.

◆ DEFAULT_EXP_K

template<typename T >
const T SimpleValue< T >::DEFAULT_EXP_K
staticinherited

Definition at line 54 of file SimpleValue.h.

◆ DEFAULT_LAMBDA

template<typename T >
const T SimpleValue< T >::DEFAULT_LAMBDA
staticinherited

Definition at line 51 of file SimpleValue.h.

◆ DEFAULT_LOG_C

template<typename T >
const T SimpleValue< T >::DEFAULT_LOG_C
staticinherited

Definition at line 55 of file SimpleValue.h.

◆ DEFAULT_LOG_K

template<typename T >
const T SimpleValue< T >::DEFAULT_LOG_K
staticinherited

Definition at line 56 of file SimpleValue.h.

◆ locked

template<typename T , typename Value = SimpleValue<T>>
bool TakeoverValue< T, Value >::locked = false
protected

◆ threshold

template<typename T , typename Value = SimpleValue<T>>
T TakeoverValue< T, Value >::threshold = Value::DEFAULT_DELTA
protected

Definition at line 22 of file TakeoverValue.h.

Referenced by TakeoverValue< T, Value >::update().

◆ value


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