Public Member Functions | Protected Attributes | List of all members
Behaviour Class Reference

Parent class for all other behaviours. More...

#include <Behaviours.h>

Inheritance diagram for Behaviour:
BreatheLEDs ButtonClicked ButtonHeld ButtonPressed ButtonReleased ButtonTick LightAllLEDs LightSomeLEDs Link PingServer PotentiometerUpdated RotaryEncoderUpdated SendCapabilities ServoGoAndReturn ServoGoTo ServoWiggle

Public Member Functions

virtual char * args ()
 
 Behaviour (String name)
 
virtual boolean is_background ()
 
virtual boolean is_interruptable ()
 
virtual boolean is_priority ()
 
virtual boolean is_running ()
 
virtual boolean is_temp ()
 
virtual String name ()
 
virtual String start (String args)
 
virtual void stop ()
 
virtual void update ()
 
 ~Behaviour ()
 

Protected Attributes

boolean _background = false
 
boolean _interruptable = true
 
String _name = "name"
 
boolean _priority = false
 
boolean _running = false
 
boolean _temp = false
 

Detailed Description

Parent class for all other behaviours.

This class contains is a template for building block behaviours that can do just about anything you could dream up. It has a bunch of virtual methods that you can override in its children.

Constructor & Destructor Documentation

◆ Behaviour()

Behaviour::Behaviour ( String  name)

◆ ~Behaviour()

Behaviour::~Behaviour ( )

Member Function Documentation

◆ args()

virtual char* Behaviour::args ( )
virtual

What arguments does the behaviour take? Override this to document your behaviour.

Reimplemented in ButtonTick, ButtonHeld, ServoGoAndReturn, BreatheLEDs, ButtonClicked, Link, ButtonReleased, LightAllLEDs, ButtonPressed, PotentiometerUpdated, RotaryEncoderUpdated, LightSomeLEDs, and ServoGoTo.

◆ is_background()

virtual boolean Behaviour::is_background ( )
virtual

Can the behaviour run in the background?

◆ is_interruptable()

virtual boolean Behaviour::is_interruptable ( )
virtual

Can this behaviour be interruped?

◆ is_priority()

virtual boolean Behaviour::is_priority ( )
virtual

Should this behaviour override others?

◆ is_running()

virtual boolean Behaviour::is_running ( )
virtual

Is the behaviour running?

◆ is_temp()

virtual boolean Behaviour::is_temp ( )
virtual

Can this behaviour be run quickly without stopping what's going on (e.g. comms, debug)?

◆ name()

virtual String Behaviour::name ( )
virtual

What's the name of this behaviour?

◆ start()

virtual String Behaviour::start ( String  args)
virtual

◆ stop()

virtual void Behaviour::stop ( )
virtual

Stop the behaviour. This can be useful to stop the behaviour after it has updated a set number of times, or after a fixed amount of time.

◆ update()

virtual void Behaviour::update ( )
virtual

Update the behaviour periodically.

Reimplemented in ServoGoAndReturn, BreatheLEDs, PingServer, Link, and ServoWiggle.

Member Data Documentation

◆ _background

boolean Behaviour::_background = false
protected

◆ _interruptable

boolean Behaviour::_interruptable = true
protected

◆ _name

String Behaviour::_name = "name"
protected

◆ _priority

boolean Behaviour::_priority = false
protected

◆ _running

boolean Behaviour::_running = false
protected

◆ _temp

boolean Behaviour::_temp = false
protected

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