trikRuntime
eventFileInterface.h
Go to the documentation of this file.
1 /* Copyright 2015 Yurii Litvinov and CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QString>
18 #include <QtCore/QObject>
19 
20 namespace trikKernel {
21 class TimeVal;
22 }
23 
24 namespace trikHal {
25 
27 class EventFileInterface : public QObject
28 {
29  Q_OBJECT
30 
31 public:
33  virtual bool open() = 0;
34 
36  virtual bool close() = 0;
37 
39  virtual void cancelWaiting() = 0;
40 
42  virtual QString fileName() const = 0;
43 
45  virtual bool isOpened() const = 0;
46 
47 signals:
52  void newEvent(int eventType, int code, int value, const trikKernel::TimeVal &eventTime);
53 };
54 
55 }
Definition: analogSensor.h:23
Event file abstraction. Can be opened or closed, when opened can emit signal containing event data...
Definition: eventFileInterface.h:27
Structure of a time value in a convenient format.
Definition: timeVal.h:20
Definition: brickFactory.h:21