00001 // SetterDebug.h 00002 // 00003 // Class for testing and debugging Setter and subclasses 00004 /// \author Mike McCauley (mikem@open.com.au) 00005 /// 00006 // Copyright (C) 2010 Mike McCauley 00007 // $Id: SetterDebug.h,v 1.3 2010/06/28 00:56:10 mikem Exp $ 00008 00009 #ifndef SetterDebug_h 00010 #define SetterDebug_h 00011 00012 #include "Setter.h" 00013 #include <wiring.h> 00014 00015 ///////////////////////////////////////////////////////////////////// 00016 /// \class SetterDebug SetterDebug.h <SetterDebug.h> 00017 /// \brief Class for testing Setters. 00018 /// Used by the sample TestSuite sketch. 00019 /// 00020 class SetterDebug : public Setter 00021 { 00022 public: 00023 /// Input the value to be inverted 00024 /// \param[in] value The input value 00025 virtual void input(int value); 00026 00027 /// Return the last value that 00028 /// was set here 00029 int lastValue(); 00030 00031 /// Called when the source of input data is lost, 00032 /// and the Setter is required to fail in a safe way 00033 virtual void failsafe(); 00034 00035 /// Returns whether there has been a 00036 /// failsafe event 00037 boolean failed(); 00038 00039 protected: 00040 00041 private: 00042 int _lastValue; 00043 boolean _failed; 00044 }; 00045 00046 #endif