Sygaldry
Loading...
Searching...
No Matches
sygaldry::toggle< name_str, desc, init, Tags > Struct Template Reference

A two-state integer endpoint with persistent value semantics. More...

Inheritance diagram for sygaldry::toggle< name_str, desc, init, Tags >:
sygaldry::persistent< char > sygaldry::name_< name_str > sygaldry::description_< str > sygaldry::range_< _min, _max, _init > sygaldry::tagged_< Tags... >

Additional Inherited Members

- Public Types inherited from sygaldry::persistent< char >
using type = char
 The underlying type.
 
- Public Member Functions inherited from sygaldry::persistent< char >
constexpr persistent () noexcept
 Default constuctor defers to T's empty initializer.
 
constexpr persistent (char &&t) noexcept
 Move constructor from T
 
constexpr persistent (const char &t) noexcept
 Copy constructor from T
 
constexpr auto & operator= (char &&t) noexcept
 Move assignment from T
 
constexpr auto & operator= (const char &t) noexcept
 Copy assignment from T
 
constexpr operator char & () noexcept
 Conversion to a mutable reference to the underlying value.
 
constexpr operator const char & () 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< char >
char value
 The wrapped value.
 

Detailed Description

template<string_literal name_str, string_literal desc = "", char init = 0, typename ... Tags>
struct sygaldry::toggle< name_str, desc, init, Tags >

A two-state integer endpoint with persistent value semantics.

Example: toggle<"debounced button state", "current debounced state of the button", 1> debounced_button_state;

Template Parameters
name_strThe name of the endpoint. Required.
descA description of the endpoint. Defaults to an empty string.
initThe initial value of the endpoint (0 or 1). Defaults to 0.
TagsTag helper classes to apply to the endpoint. None by default.

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