Sygaldry
Loading...
Searching...
No Matches
sygaldry::slider< name_str, desc, T, min, max, init, Tags > Struct Template Reference

A numeric endpoint with user customizeable range and persistent value semantics. More...

Inheritance diagram for sygaldry::slider< name_str, desc, T, min, max, init, Tags >:
sygaldry::persistent< T > sygaldry::name_< name_str > sygaldry::description_< str > sygaldry::range_< _min, _max, _init > sygaldry::tagged_< Tags... >

Additional Inherited Members

- Public Types inherited from sygaldry::persistent< T >
using type = T
 The underlying type.
 
- Public Member Functions inherited from sygaldry::persistent< T >
constexpr persistent () noexcept
 Default constuctor defers to T's empty initializer.
 
constexpr persistent (T &&t) noexcept
 Move constructor from T
 
constexpr persistent (const T &t) noexcept
 Copy constructor from T
 
constexpr auto & operator= (T &&t) noexcept
 Move assignment from T
 
constexpr auto & operator= (const T &t) noexcept
 Copy assignment from T
 
constexpr operator T& () noexcept
 Conversion to a mutable reference to the underlying value.
 
constexpr operator const T & () const noexcept
 Conversion to a constant reference to the underlying value.
 
- Static Public Member Functions inherited from sygaldry::name_< name_str >
static _consteval auto name ()
 
- Static Public Member Functions inherited from sygaldry::description_< str >
static _consteval auto description ()
 
- Static Public Member Functions inherited from sygaldry::range_< _min, _max, _init >
static _consteval auto range ()
 Returns a struct with min, max, and init members containing the range.
 
static _consteval auto min ()
 Returns the minimum value of the range.
 
static _consteval auto max ()
 Returns the maximum value of the range.
 
static _consteval auto init ()
 Returns the initial value of the range.
 
- Public Attributes inherited from sygaldry::persistent< T >
value
 The wrapped value.
 

Detailed Description

template<string_literal name_str, string_literal desc = "", typename T = float, num_literal< T > min = 0.0f, num_literal< T > max = 1.0f, num_literal< T > init = min, typename ... Tags>
struct sygaldry::slider< name_str, desc, T, min, max, init, Tags >

A numeric endpoint with user customizeable range and persistent value semantics.

Example: slider<"pressure", "Current reading from the pressure sensor"> pressure;

Template Parameters
name_strThe name of the endpoint. Required.
descA description of the endpoint. Defaults to an empty string.
TUnderlying value type of the endpoint. Defaults to float.
minExpected minimum value of the endpoint. Defaults to 0.0f.
maxExpected maximum value of the endpoint. Defaults to 1.0f.
initThe initial value of the endpoint. Defaults to min.
TagsTag helper classes to apply to the endpoint. None by default.

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