RCKit
SetterDebug.h
1 // SetterDebug.h
2 //
3 // Class for testing and debugging Setter and subclasses
4 /// \author Mike McCauley (mikem@airspayce.com)
5 ///
6 // Copyright (C) 2010 Mike McCauley
7 // $Id: SetterDebug.h,v 1.5 2018/09/17 23:09:57 mikem Exp mikem $
8 
9 #ifndef SetterDebug_h
10 #define SetterDebug_h
11 
12 #include "Setter.h"
13 #if ARDUINO >= 100
14 #include <Arduino.h>
15 #else
16 #include <wiring.h>
17 #endif
18 
19 /////////////////////////////////////////////////////////////////////
20 /// \class SetterDebug SetterDebug.h <SetterDebug.h>
21 /// \brief Class for testing Setters.
22 /// Used by the sample TestSuite sketch.
23 ///
24 class SetterDebug : public Setter
25 {
26 public:
27  /// Input the value to be inverted
28  /// \param[in] value The input value
29  virtual void input(int value);
30 
31  /// Return the last value that
32  /// was set here
33  int lastValue();
34 
35  /// Called when the source of input data is lost,
36  /// and the Setter is required to fail in a safe way
37  virtual void failsafe();
38 
39  /// Returns whether there has been a
40  /// failsafe event
41  boolean failed();
42 
43 protected:
44 
45 private:
46  int _lastValue;
47  boolean _failed;
48 };
49 
50 #endif
Setter::failsafeValue
int failsafeValue()
Definition: Setter.cpp:52
SetterDebug::input
virtual void input(int value)
Definition: SetterDebug.cpp:13
SetterDebug::lastValue
int lastValue()
Definition: SetterDebug.cpp:22
SetterDebug
Class for testing Setters. Used by the sample TestSuite sketch.
Definition: SetterDebug.h:24
SetterDebug::failed
boolean failed()
Definition: SetterDebug.cpp:28
SetterDebug::failsafe
virtual void failsafe()
Definition: SetterDebug.cpp:34
Setter
Virtual base class for classes that receive a value, maybe transform it and then do something with it...
Definition: Setter.h:25