libkovan  1
The kovan standard library
AbstractButton Class Referenceabstract

The base class for all buttons. More...

#include <button.hpp>

Inheritance diagram for AbstractButton:
Sensor< bool > AbstractTextButton IdButton

Public Member Functions

virtual ~AbstractButton ()
 
virtual void setPressed (bool pressed)=0
 
bool isPressed () const
 
bool isNotPressed () const
 
bool isClicked () const
 
virtual void waitUntilReleased () const
 
virtual void waitUntilPressed () const
 
virtual void waitUntilClicked () const
 
- Public Member Functions inherited from Sensor< bool >
virtual ~Sensor ()
 
virtual bool value () const =0
 

Detailed Description

The base class for all buttons.

Provides several convenience methods for working with buttons

Constructor & Destructor Documentation

virtual AbstractButton::~AbstractButton ( )
virtual

Member Function Documentation

bool AbstractButton::isClicked ( ) const
inline

Gets the current state of the butten (pressed or not pressed.)

Returns
true if the button is pressed, false if it is not
Note
This function blocks until the button is no longer pressed.
See also
isPressed
waitUntilReleased
This function is blocking.
bool AbstractButton::isNotPressed ( ) const
inline
Returns
true if the button is not pressed, false if it is pressed.
See also
isPressed
bool AbstractButton::isPressed ( ) const
inline
Returns
true if the button is pressed, false if it is not pressed.
See also
isNotPressed
isClicked

References Sensor< T >::value().

virtual void AbstractButton::setPressed ( bool  pressed)
pure virtual

Implemented in IdButton.

virtual void AbstractButton::waitUntilClicked ( ) const
virtual

Blocks until the button is clicked.

This function is blocking.
virtual void AbstractButton::waitUntilPressed ( ) const
virtual

Blocks until the button is pressed. Returns immeadiately if the button is pressed.

This function is blocking.
virtual void AbstractButton::waitUntilReleased ( ) const
virtual

Blocks until the button is released. Returns immeadiately if the button is not pressed.

This function is blocking.

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