blip  0.1
Sensor.hpp
Go to the documentation of this file.
1 #ifndef __blip_Sensor_hpp
2 #define __blip_Sensor_hpp
3 
4 #include <blip/Blip.hpp>
5 
6 struct ASensor;
7 
8 namespace blip {
9 
10 class SensorEventQueue;
11 class SensorManager;
12 
17 class Sensor
18 {
19  friend class SensorEventQueue;
20  friend class SensorManager;
21 
22  public:
23 
30 
32  ~Sensor() throw();
33 
35  Type getType() const throw();
36 
38  float getResolution() const throw();
39 
44  timespan_us_t getMinimumDelay() const throw();
45 
47  const char* getVendor() const throw();
48 
50  const char* getName() const throw();
51 
53  static const float STANDARD_GRAVITY;
54 
56  static const float MAGNETIC_FIELD_EARTH_MIN;
57 
59  static const float MAGNETIC_FIELD_EARTH_MAX;
60 
61  private:
62 
63  Sensor(const ASensor* sensor);
64 
65  inline const ASensor* getHandle() const
66  { return(_sensor); }
67 
68  const ASensor* _sensor;
69 
70  CCXX_COPY_DECLS(Sensor);
71 };
72 
73 } // namespace blip
74 
75 #endif // __blip_Sensor_hpp
Definition: Sensor.hpp:26
Type
Sensor types.
Definition: Sensor.hpp:25
Definition: Sensor.hpp:29
timespan_us_t getMinimumDelay() const
Get the minimum delay between two events for the sensor, in microseconds.
Definition: Sensor.cpp:88
Definition: Sensor.hpp:27
static const float MAGNETIC_FIELD_EARTH_MIN
The minimum magnetic field on the Earth&#39;s surface in uT.
Definition: Sensor.hpp:56
const char * getVendor() const
Get the sensor&#39;s vendor.
Definition: Sensor.cpp:96
Definition: Sensor.hpp:28
Definition: Sensor.hpp:29
float getResolution() const
Get the sensor&#39;s resolution, in the sensor&#39;s unit.
Definition: Sensor.cpp:80
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
Definition: Sensor.hpp:27
A class representing a sensor.
Definition: Sensor.hpp:17
static const float MAGNETIC_FIELD_EARTH_MAX
The maximum magnetic field on the Earth&#39;s surface in uT.
Definition: Sensor.hpp:59
Type getType() const
Get the sensor type.
Definition: Sensor.cpp:36
const char * getName() const
Get the sensor&#39;s name.
Definition: Sensor.cpp:104
A class that provides access to the hardware sensors.
Definition: SensorManager.hpp:23
Definition: Sensor.hpp:26
Definition: Sensor.hpp:28
~Sensor()
Destructor.
Definition: Sensor.cpp:29
Definition: Sensor.hpp:25
Definition: Sensor.hpp:26
Definition: Sensor.hpp:25
friend class SensorEventQueue
Definition: Sensor.hpp:19
Definition: Sensor.hpp:28
uint64_t timespan_us_t
A time interval, measured in microseconds.
Definition: Blip.hpp:30
static const float STANDARD_GRAVITY
The Earth&#39;s gravity in m/s2.
Definition: Sensor.hpp:53