sensorfw: sensors/tapsensor/tapsensor.h Source File

sensorfw

tapsensor.h
Go to the documentation of this file.
1
26#ifndef TAP_SENSOR_CHANNEL_H
27#define TAP_SENSOR_CHANNEL_H
28
29#include <QObject>
30
31#include "abstractsensor.h"
32#include "tapsensor_a.h"
33#include "dataemitter.h"
34#include "datatypes/tapdata.h"
35#include "deviceadaptor.h"
36
37class Bin;
38template <class TYPE> class BufferReader;
39class FilterBase;
40
51 class TapSensorChannel :
52 public AbstractSensorChannel,
53 public DataEmitter<TapData>
54{
55 Q_OBJECT;
56
57public:
62 static AbstractSensorChannel* factoryMethod(const QString& id)
63 {
64 TapSensorChannel* sc = new TapSensorChannel(id);
65 new TapSensorChannelAdaptor(sc);
66
67 return sc;
68 }
69
70public Q_SLOTS:
71 bool start();
72 bool stop();
73
74signals:
79 void dataAvailable(const Tap& tap);
80
81protected:
82 TapSensorChannel(const QString& id);
83 virtual ~TapSensorChannel();
84
85private:
86 Bin* filterBin_;
87 Bin* marshallingBin_;
88 DeviceAdaptor* tapAdaptor_;
89 BufferReader<TapData>* tapReader_;
90 RingBuffer<TapData>* outputBuffer_;
91
92 void emitData(const TapData& tapData);
93};
94
95#endif // TAP_SENSOR_CHANNEL_H
BufferReader
Definition: accelerometersensor.h:38
TapData
Datatype for device tap events.
Definition: tapdata.h:36
TapSensorChannelAdaptor
Definition: tapsensor_a.h:37
TapSensorChannel
Sensor for accessing device tap events.
Definition: tapsensor.h:54
TapSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for TapSensorChannel.
Definition: tapsensor.h:62
TapSensorChannel::dataAvailable
void dataAvailable(const Tap &tap)
Sent when a tap event has occurred.
TapSensorChannel::TapSensorChannel
TapSensorChannel(const QString &id)
TapSensorChannel::stop
bool stop()
TapSensorChannel::start
bool start()
TapSensorChannel::~TapSensorChannel
virtual ~TapSensorChannel()
Tap
QObject facade for TapData.
Definition: tap.h:37
tapdata.h
Datatype for device tap events.
tapsensor_a.h
D-Bus adaptor for TapSensor.