RoboidControl
Loading...
Searching...
No Matches
Range.h
Go to the documentation of this file.
1#ifndef RANGE_H
2#define RANGE_H
3
4namespace Passer {
5namespace LinearAlgebra {
6
7/*
9class Range16 {
10public:
11 Range16();
12 Range16(float range); // range -1..1
13 Range16(short range); // range -32768..32767
14
15 inline Range16 operator-(Range16 a);
16 inline Range16 operator+(Range16 a);
17 inline virtual Range16 &operator-();
18
19 inline bool operator==(Range16 a);
20 inline bool operator!=(Range16 a);
21
22 inline bool operator<(Range16 a);
23 inline bool operator>(Range16 a);
24 inline bool operator<=(Range16 a);
25 inline bool operator>=(Range16 a);
26
27protected:
28 // How do we make sure we have 16 bit range on every platform?
29 // uint16_t range; // 16-bit range
30 unsigned short range; // 16-bit range
31};
32*/
33
34template <typename T> class RangeUsing {
35public:
36 RangeUsing<T>(float range); // range -1..1
37
40 inline RangeUsing<T> operator-() { this->value = -this.value; }
41 inline T GetValue() { return value; }
42
44};
45
46} // namespace LinearAlgebra
47} // namespace Passer
48using namespace Passer::LinearAlgebra;
49
50#endif
RangeUsing< T > operator-()
Definition Range.h:40
RangeUsing< T > operator+(RangeUsing< T > a)
Definition Range.h:39
T value
Definition Range.h:43
T GetValue()
Definition Range.h:41
RangeUsing< T > operator-(RangeUsing< T > a)
Definition Range.h:38
Definition Angle.h:9
Definition AbsoluteEncoder.h:5