Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
df7975b3cThis file is pinned to the selected release. Download the original to open it in your design tool.
/*****************************************************************************
Button.h
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
#pragma once
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "erb/detail/Debounce.h"
namespace erb
{
class Button
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
public:
static constexpr float ValueMin = 0.f;
static constexpr float ValueMax = 1.f;
inline Button (const uint8_t & data);
virtual ~Button () = default;
inline bool idle () const;
inline bool pressed () const;
inline bool held () const;
inline bool released () const;
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
const uint8_t &
impl_data;
void impl_preprocess ();
inline void impl_postprocess () {}
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
protected:
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
private:
Debounce _debounce;
/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
private:
Button () = delete;
Button (const Button & rhs) = delete;
Button (Button && rhs) = delete;
Button & operator = (const Button & rhs) = delete;
Button & operator = (Button && rhs) = delete;
bool operator == (const Button & rhs) const = delete;
bool operator != (const Button & rhs) const = delete;
}; // class Button
} // namespace erb
#include "erb/Button.hpp"
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/