fsh::stk
fantastic spatial holophonic synthesis toolkit
Loading...
Searching...
No Matches
fsh::util::BoundedValue< T, MIN, MAX > Class Template Reference

Represents a value that is bounded by a minimum and maximum. More...

#include <BoundedValue.h>

Public Member Functions

 BoundedValue (T val={})
 Set the initial value.
 
auto get () const -> T
 Get the value stored in this object.
 
void set (T val)
 Set a new value, clamping to min/max if necessary.
 

Static Public Attributes

static constexpr auto min = static_cast<T>(MIN)
 Minimum value.
 
static constexpr auto max = static_cast<T>(MAX)
 Maximum value.
 

Detailed Description

template<typename T, int MIN, int MAX>
class fsh::util::BoundedValue< T, MIN, MAX >

Represents a value that is bounded by a minimum and maximum.

Setting a value outside of the bounds will fail gracefully by clamping it to the nearest bound and logging a warning.


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