sensorfw: sensors/lidsensor/lidsensor.h Source File

sensorfw

lidsensor.h
Go to the documentation of this file.
1
26#ifndef LID_SENSOR_CHANNEL_H
27#define LID_SENSOR_CHANNEL_H
28
29#include <QObject>
30
31#include "deviceadaptor.h"
32#include "abstractsensor.h"
33#include "lidsensor_a.h"
34#include "dataemitter.h"
35#include "datatypes/liddata.h"
36#include "datatypes/lid.h"
37class Bin;
38template <class TYPE> class BufferReader;
39class FilterBase;
40
41
48 class LidSensorChannel :
49 public AbstractSensorChannel,
50 public DataEmitter<LidData>
51{
52 Q_OBJECT
53 Q_PROPERTY(LidData closed READ closed)
54
55public:
60 static AbstractSensorChannel* factoryMethod(const QString& id)
61 {
62 LidSensorChannel* sc = new LidSensorChannel(id);
63 new LidSensorChannelAdaptor(sc);
64
65 return sc;
66 }
67
72 LidData closed() const { return previousValue_; }
73
74public Q_SLOTS:
75 bool start();
76 bool stop();
77
78signals:
83 void lidChanged(const Lid& value);
84
85protected:
86 LidSensorChannel(const QString& id);
87 virtual ~LidSensorChannel();
88
89private:
90 LidData previousValue_;
91 Bin* filterBin_;
92 Bin* marshallingBin_;
93 DeviceAdaptor* lidAdaptor_;
94 BufferReader<LidData>* lidReader_;
95 RingBuffer<LidData>* outputBuffer_;
96
97 void emitData(const LidData& value);
98
99};
100
101#endif // LID_SENSOR_CHANNEL_H
BufferReader
Definition: accelerometersensor.h:38
LidData
Datatype for device lid events.
Definition: liddata.h:36
LidSensorChannelAdaptor
Definition: lidsensor_a.h:36
LidSensorChannel
Sensor for accessing the internal ambient light sensor measurements.
Definition: lidsensor.h:51
LidSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for LidSensorChannel.
Definition: lidsensor.h:60
LidSensorChannel::LidSensorChannel
LidSensorChannel(const QString &id)
LidSensorChannel::closed
LidData closed() const
Property for accessing the measured value.
Definition: lidsensor.h:72
LidSensorChannel::start
bool start()
LidSensorChannel::~LidSensorChannel
virtual ~LidSensorChannel()
LidSensorChannel::lidChanged
void lidChanged(const Lid &value)
Sent when a change in measured data is observed.
LidSensorChannel::stop
bool stop()
LidSensorChannel::closed
LidData closed
Definition: lidsensor.h:53
Lid
QObject facade for LidData.
Definition: lid.h:37
lid.h
QObject based datatype for LidData.
liddata.h
Datatype for device tap events.
lidsensor_a.h
D-Bus adaptor for LidSensor.