| 28 | { |
| 29 | template< class TInput, class TOutput> |
| 30 | class RangeBasedMasking |
| 31 | { |
| 32 | public: |
| 33 | RangeBasedMasking() {}; |
| 34 | ~RangeBasedMasking() {}; |
| 35 | bool operator!=(const RangeBasedMasking &) const |
| 36 | { |
| 37 | return false; |
| 38 | } |
| 39 | bool operator==(const RangeBasedMasking & other) const |
| 40 | { |
| 41 | return !(*this != other); |
| 42 | } |
| 43 | inline TOutput operator()(const TInput & A, const TOutput & B) const |
| 44 | { |
| 45 | unsigned short erg = B; |
| 46 | if (lowerLimitOn && (A < lowerLimit)) |
| 47 | { |
| 48 | erg = 0; |
| 49 | } |
| 50 | if (upperLimitOn && (upperLimit < A)) |
| 51 | { |
| 52 | erg = 0; |
| 53 | } |
| 54 | return erg; |
| 55 | } |
| 56 | |
| 57 | bool lowerLimitOn = false; |
| 58 | bool upperLimitOn = false; |
| 59 | double lowerLimit = 0; |
| 60 | double upperLimit = 1; |
| 61 | }; |
| 62 | } |
| 63 | } |
| 64 |
no outgoing calls
no test coverage detected