blip  0.1
SensorEvent.hpp
Go to the documentation of this file.
1 #ifndef __blip_SensorEvent_hpp
2 #define __blip_SensorEvent_hpp
3 
4 #include <blip/Blip.hpp>
5 #include <blip/Event.hpp>
6 #include <blip/Sensor.hpp>
7 
8 namespace blip {
9 
10 class SensorEventQueue;
11 
15 
20 class SensorEvent : public Event
21 {
22  friend class SensorEventQueue;
23 
24  public:
25 
27  virtual ~SensorEvent();
28 
30  inline Accuracy getAccuracy() const
31  { return(_accuracy); }
32 
40  float getValue(int index) const throw();
41 
42  inline virtual time_ms_t getEventTime() const
43  { return(_eventTime); }
44 
46  inline Sensor::Type getSensorType() const
47  { return(_sensorType); }
48 
49  protected:
50 
52  SensorEvent(Sensor::Type sensorType, time_ms_t eventTime,
53  const float values[16], Accuracy accuracy = Accuracy_Unknown);
54 
55  float _values[16];
58  private:
59 
60  Sensor::Type _sensorType;
61  time_ms_t _eventTime;
62  Accuracy _accuracy;
63 
64  CCXX_COPY_DECLS(SensorEvent);
65 };
66 
67 } // namespace blip
68 
69 #endif // __blip_SensorEvent_hpp
Type
Sensor types.
Definition: Sensor.hpp:25
friend class SensorEventQueue
Definition: SensorEvent.hpp:22
float getValue(int index) const
Get a sensor value.
An abstract base class for all application events.
Definition: Event.hpp:12
Definition: SensorEvent.hpp:14
virtual ~SensorEvent()
Destructor.
Definition: SensorEvent.cpp:24
An abstract base class for sensor events.
Definition: SensorEvent.hpp:20
Definition: SensorEvent.hpp:13
Sensor::Type getSensorType() const
Get the sensor type.
Definition: SensorEvent.hpp:46
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
virtual time_ms_t getEventTime() const
Get the time at which this event occurred.
Definition: SensorEvent.hpp:42
Accuracy getAccuracy() const
Get the accuracy of the sensor event values.
Definition: SensorEvent.hpp:30
Definition: SensorEvent.hpp:14
Definition: SensorEvent.hpp:13
Accuracy
Sensor accuracy ratings.
Definition: SensorEvent.hpp:13
Definition: SensorEvent.hpp:13