trikRuntime
stubEventFile.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 "eventFileInterface.h"
18 
19 namespace trikHal {
20 namespace stub {
21 
24 {
25  Q_OBJECT
26 
27 public:
30  StubEventFile(const QString &fileName);
31 
32  bool open() override;
33  bool close() override;
34  void cancelWaiting() override;
35  QString fileName() const override;
36  bool isOpened() const override;
37 
38 private:
39  QString mFileName;
40 };
41 
42 }
43 }
Event file abstraction. Can be opened or closed, when opened can emit signal containing event data...
Definition: eventFileInterface.h:27
bool isOpened() const override
Returns true if a file is opened.
Definition: stubEventFile.cpp:47
StubEventFile(const QString &fileName)
Constructor.
Definition: stubEventFile.cpp:21
void cancelWaiting() override
Abort all pending synchronous event loops.
Definition: stubEventFile.cpp:38
QString fileName() const override
Returns name of an event file.
Definition: stubEventFile.cpp:42
bool close() override
Closes event file and stops listening for events.
Definition: stubEventFile.cpp:32
Definition: brickFactory.h:21
Empty implementation of event file, it only logs calls to its methods and doen't emit any signals...
Definition: stubEventFile.h:23
bool open() override
Opens event file and starts listening for events.
Definition: stubEventFile.cpp:26