RCKit
Limiter.h
1 // Limiter.h
2 //
3 // Setter class that limits its input to between specified min and max values
4 /// \author Mike McCauley (mikem@airspayce.com)
5 ///
6 // Copyright (C) 2010 Mike McCauley
7 // $Id: Limiter.h,v 1.4 2018/09/17 23:09:57 mikem Exp mikem $
8 
9 #ifndef Limiter_h
10 #define Limiter_h
11 
12 #include "Setter.h"
13 
14 /////////////////////////////////////////////////////////////////////
15 /// \class Limiter Limiter.h <Limiter.h>
16 /// \brief Setter class that limits its output to between specified min and max values
17 ///
18 /// Limiter limits its output to between specified min and max values
19 /// The resulting output value is sent to the next Setter (the target) in the chain.
20 ///
21 class Limiter : public Setter
22 {
23 public:
24  /// Constructor.
25  /// All output values will be constrained to be within min to max (inclusive)
26  Limiter(int min, int max);
27 
28  /// Input the value to be inverted
29  /// \param[in] value The input value
30  virtual void input(int value);
31 
32 protected:
33 
34 private:
35 
36  /// The minimum permitted value
37  int _min;
38 
39  /// The maximum permitted value
40  int _max;
41 };
42 
43 #endif
Limiter
Setter class that limits its output to between specified min and max values.
Definition: Limiter.h:21
Setter::input
virtual void input(int value)
This is where incoming values are set.
Definition: Setter.cpp:26
Limiter::Limiter
Limiter(int min, int max)
Definition: Limiter.cpp:12
Limiter::input
virtual void input(int value)
Definition: Limiter.cpp:20
Setter
Virtual base class for classes that receive a value, maybe transform it and then do something with it...
Definition: Setter.h:25