trikRuntime
inputDeviceFileInterface.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/QTextStream>
18 
19 namespace trikHal {
20 
23 {
24  Q_DISABLE_COPY(InputDeviceFileInterface)
25 public:
26  InputDeviceFileInterface() = default;
27  virtual ~InputDeviceFileInterface() = default;
28 
30  virtual bool open() = 0;
31 
33  virtual void close() = 0;
34 
36  virtual QTextStream &stream() = 0;
37 
39  virtual void reset() = 0;
40 };
41 
42 }
virtual ~InputDeviceFileInterface()=default
virtual void reset()=0
Resets input file, moving file cursor to the beginning of the file.
virtual QTextStream & stream()=0
Returns temporary reference to a stream which can be used to read from a file.
Input device file abstraction. Can read from a device file, thus communicating with a device driver...
Definition: inputDeviceFileInterface.h:22
virtual void close()=0
Close a file.
virtual bool open()=0
Open a file. File name must be set previously.
Definition: brickFactory.h:21