Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
IStream.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
4 * SPDX-FileCopyrightText: (C) 2004 Chris Schoeneman
5 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6 */
7
8#pragma once
9
10#include "base/Event.h"
11#include "base/EventTypes.h"
12#include "base/IEventQueue.h"
13#include "common/IInterface.h"
14
15class IEventQueue;
16
17namespace deskflow {
18
20
23class IStream : public IInterface
24{
25public:
26 IStream() = default;
27
29
30
32
39 virtual void close() = 0;
40
42
47 virtual uint32_t read(void *buffer, uint32_t n) = 0;
48
50
56 virtual void write(const void *buffer, uint32_t n) = 0;
57
59
62 virtual void flush() = 0;
63
65
69 virtual void shutdownInput() = 0;
70
72
77 virtual void shutdownOutput() = 0;
78
80
82
84
88 virtual void *getEventTarget() const = 0;
89
91
96 virtual bool isReady() const = 0;
97
99
105 virtual uint32_t getSize() const = 0;
106
108};
109
110} // namespace deskflow
Event queue interface.
Definition IEventQueue.h:32
Base class of interfaces.
Definition IInterface.h:18
virtual uint32_t getSize() const =0
Get bytes available to read.
virtual void * getEventTarget() const =0
Get event target.
virtual void write(const void *buffer, uint32_t n)=0
Write to stream.
virtual uint32_t read(void *buffer, uint32_t n)=0
Read from stream.
virtual bool isReady() const =0
Test if read() will succeed.
virtual void flush()=0
Flush the stream.
virtual void close()=0
Close the stream.
virtual void shutdownOutput()=0
Shutdown output.
virtual void shutdownInput()=0
Shutdown input.
Definition EventTypes.h:11