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

A two-state integer endpoint with occasional message semantics. More...

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

Additional Inherited Members

- Public Types inherited from sygaldry::occasional< char >
using type = char
 The underlying type.
 
- Public Member Functions inherited from sygaldry::occasional< char >
constexpr occasional () noexcept
 Default constructor; state is default initialized and updated is false.
 
constexpr occasional (occasional< char > &&other)
 Move constructor from another occasional.
 
constexpr occasional (const occasional< char > &other)
 Copy constructor from another occasional.
 
constexpr occasional (char &&t) noexcept
 Move constructor from the underlying type.
 
constexpr occasional (const char &t) noexcept
 Copy constructor from the underlying type.
 
constexpr auto & operator= (occasional< char > &&other)
 Move assignment from another occasional.
 
constexpr auto & operator= (const occasional< char > &other)
 Copy assignment from another occasional.
 
constexpr auto & operator= (char &&t) noexcept
 Move assignment from the underlying type.
 
constexpr auto & operator= (const char &t) noexcept
 Copy assignment from the underlying type.
 
constexpr operator char & () noexcept
 Mutable value access.
 
constexpr operator const char & () const noexcept
 Immutable value access.
 
constexpr char & operator* () noexcept
 Mutable dereference operator; provides access to the underlying state.
 
constexpr const char & operator* () const noexcept
 Constant dereference operator; provides access to the underlying state.
 
constexpr char * operator-> () noexcept
 Mutable member access operator; provides access to the members of the underlying state.
 
constexpr const char * operator-> () const noexcept
 Constant member access operator; provides access to the members of the underlying state.
 
constexpr char & value () noexcept
 Mutable value access.
 
constexpr const char & value () const noexcept
 Immutable value access.
 
constexpr void reset () noexcept
 Clear the updated flag. This can also be achieved by assignment from empty braces, e.g. x = {};
 
- 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::occasional< char >
char state
 The wrapped state.
 
bool updated
 Flag indicating if the state has been changed.
 

Detailed Description

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

A two-state integer endpoint with occasional message semantics.

Example: button<"button state", "current state of the button", 1> 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: