00001 // Limiter.h 00002 // 00003 // Setter class that limits its input to between specified min and max values 00004 /// \author Mike McCauley (mikem@open.com.au) 00005 /// 00006 // Copyright (C) 2010 Mike McCauley 00007 // $Id: Limiter.h,v 1.2 2010/06/28 00:56:10 mikem Exp $ 00008 00009 #ifndef Limiter_h 00010 #define Limiter_h 00011 00012 #include "Setter.h" 00013 00014 ///////////////////////////////////////////////////////////////////// 00015 /// \class Limiter Limiter.h <Limiter.h> 00016 /// \brief Setter class that limits its output to between specified min and max values 00017 /// 00018 /// Limiter limits its output to between specified min and max values 00019 /// The resulting output value is sent to the next Setter (the target) in the chain. 00020 /// 00021 class Limiter : public Setter 00022 { 00023 public: 00024 /// Constructor. 00025 /// All output values will be constrained to be within min to max (inclusive) 00026 Limiter(int min, int max); 00027 00028 /// Input the value to be inverted 00029 /// \param[in] value The input value 00030 virtual void input(int value); 00031 00032 protected: 00033 00034 private: 00035 00036 /// The minimum permitted value 00037 int _min; 00038 00039 /// The maximum permitted value 00040 int _max; 00041 }; 00042 00043 #endif