Kallisto Linux API
Library for interacting with Kallisto devices
sensor_event_listener.hpp
Go to the documentation of this file.
1 
42 #ifndef SENSOR_EVENT_LISTENER_HPP
43 #define SENSOR_EVENT_LISTENER_HPP
44 
45 #include <memory>
46 #include <vector>
47 #include <chrono>
48 
49 namespace kallisto {
50 namespace hardware {
51 
52 class Sensor; //Forward declaration to prevent circular dependencies.
53 
57 class SensorEvent {
58 public:
68  std::chrono::nanoseconds timestamp;
69 
108  std::vector<float> values;
109 
113  SensorEvent(std::chrono::nanoseconds _timestamp, std::vector<float> _values);
114 
118  ~SensorEvent();
119 };
120 
124 class SensorEventListener {
125 protected:
129  virtual ~SensorEventListener();
130 
131 public:
135  SensorEventListener();
136 
142  virtual void onSensorChanged(Sensor& sensor, SensorEvent event) = 0;
143 };
144 
145 } /* namespace hardware */
146 } /* namespace kallisto */
147 
148 #endif // SENSOR_EVENT_LISTENER_HPP
Definition: bluetooth_adapter.hpp:52
SensorEvent(std::chrono::nanoseconds _timestamp, std::vector< float > _values)
std::chrono::nanoseconds timestamp
Definition: sensor_event_listener.hpp:67
std::vector< float > values
Definition: sensor_event_listener.hpp:107