Plaquette
 
Loading...
Searching...
No Matches
pq::ParameterSlot< Obj > Class Template Reference
Inheritance diagram for pq::ParameterSlot< Obj >:
Collaboration diagram for pq::ParameterSlot< Obj >:

Public Types

using Setter = void(Obj::*)(float)
 
using Getter = float(Obj::*)() const
 

Public Member Functions

 ParameterSlot (Obj *obj, Setter set, Getter get)
 
float get () override
 Returns value (typically between 0 and 1, may vary depending on class).
 
float put (float v) override
 Pushes value into the unit.
 
 operator float ()
 Object can be used directly to access its value.
 
virtual float mapTo (float toLow, float toHigh)
 Maps value to new range.
 
 operator bool ()
 Operator that allows usage in conditional expressions.
 

Static Public Member Functions

static bool analogToDigital (float f)
 Converts analog (float) value to digital (bool) value.
 
static float digitalToAnalog (bool b)
 Converts digital (bool) value to analog (float) value.
 

Member Function Documentation

◆ get()

template<class Obj >
float pq::ParameterSlot< Obj >::get ( )
inlineoverridevirtual

Returns value (typically between 0 and 1, may vary depending on class).

Reimplemented from pq::Flowable.

◆ mapTo()

virtual float pq::Flowable::mapTo ( float  toLow,
float  toHigh 
)
inlinevirtualinherited

Maps value to new range.

This function guarantees that the value is within [toLow, toHigh]. If the unit's values are unbounded, returns get() constrained to [toLow, toHigh].

Reimplemented in pq::Normalizer, pq::DigitalUnit, pq::AnalogSource, pq::AnalogIn, pq::Ramp, pq::StreamIn, and pq::StreamOut.

◆ put()

template<class Obj >
float pq::ParameterSlot< Obj >::put ( float  value)
inlineoverridevirtual

Pushes value into the unit.

Parameters
valuethe value sent to the unit
Returns
the new value of the unit

Reimplemented from pq::Flowable.


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