TDuino
Convenient functionality for Arduino
|
Base class for all classes in TDuino. More...
#include <TBase.h>
Public Member Functions | |
TBase () | |
Constructor for class TBase. More... | |
virtual | ~TBase () |
Destructor for class TBase. More... | |
virtual void | loop () |
The loop method for TBase and all subclasses. More... | |
Protected Member Functions | |
virtual void | defaults () |
Method used to reset all class internal variables. More... | |
Protected Attributes | |
unsigned long | loopMillis |
The value of millis() to be used within loop() | |
Friends | |
class | TList |
Base class for all classes in TDuino.
Used as a base class for all classes in TDuino. If you want to extend TDuino with extra classes you should use TBase as a base class for your new classes.
TBase is only intended as a "common root" and cannot be instantiated.
A minimal, valid subclass of TBase class would look something like this:
TBase::TBase | ( | ) |
Constructor for class TBase.
Initializes private and protected fields.
|
virtual |
Destructor for class TBase.
Does nothing else than implement a virtual destructor.
|
protectedvirtual |
Method used to reset all class internal variables.
Implemented to avoid inheritance issues when overriding constructors who needs to change the default values of their parent classes. Instead of overriding a constructor like this:
You should override defaults() and call it in your constructor like this:
Doing it this way will ensure that all class internal variables are initialized to their default values in the right order. It will also allow any child classes to modify the default values of their parents in the construction phase.
|
virtual |
The loop method for TBase and all subclasses.
Updates loopMillis to the current value of millis()
Reimplemented in TTimeline, TTimer, TPinInput, TPinOutput, TButton, and TTimelineT< DATATYPE >.