Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Bidirectional stream interface. More...
#include <IStream.h>
Public Member Functions | |
IStream ()=default | |
manipulators | |
virtual void | close ()=0 |
Close the stream. | |
virtual uint32_t | read (void *buffer, uint32_t n)=0 |
Read from stream. | |
virtual void | write (const void *buffer, uint32_t n)=0 |
Write to stream. | |
virtual void | flush ()=0 |
Flush the stream. | |
virtual void | shutdownInput ()=0 |
Shutdown input. | |
virtual void | shutdownOutput ()=0 |
Shutdown output. | |
accessors | |
virtual void * | getEventTarget () const =0 |
Get event target. | |
virtual bool | isReady () const =0 |
Test if read() will succeed. | |
virtual uint32_t | getSize () const =0 |
Get bytes available to read. | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. |
Bidirectional stream interface.
Defines the interface for all streams.
|
default |
|
pure virtual |
Close the stream.
Closes the stream. Pending input data and buffered output data are discarded. Use flush()
before close()
to send buffered output data. Attempts to read()
after a close return 0, attempts to write()
generate output error events, and attempts to flush()
return immediately.
Implemented in IDataSocket, PacketStreamFilter, SecureSocket, StreamFilter, and TCPSocket.
|
pure virtual |
Flush the stream.
Waits until all buffered data has been written to the stream.
Implemented in IDataSocket, StreamFilter, and TCPSocket.
|
pure virtual |
Get event target.
Returns the event target for events generated by this stream. It should be the source stream in a chain of stream filters.
Implemented in IDataSocket, StreamFilter, and TCPSocket.
|
pure virtual |
Get bytes available to read.
Returns a conservative estimate of the available bytes to read (i.e. a number not greater than the actual number of bytes). Some streams may not be able to determine this and will always return zero.
Implemented in IDataSocket, PacketStreamFilter, StreamFilter, and TCPSocket.
|
pure virtual |
Test if read()
will succeed.
Returns true iff an immediate read()
will return data. This may or may not be the same as getSize()
> 0, depending on the stream type.
Implemented in IDataSocket, PacketStreamFilter, StreamFilter, and TCPSocket.
|
pure virtual |
Read from stream.
Read up to n
bytes into buffer
, returning the number read (zero if no data is available or input is shutdown). buffer
may be nullptr in which case the data is discarded.
Implemented in IDataSocket, PacketStreamFilter, StreamFilter, and TCPSocket.
|
pure virtual |
Shutdown input.
Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0.
Implemented in IDataSocket, PacketStreamFilter, StreamFilter, and TCPSocket.
|
pure virtual |
Shutdown output.
Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use flush()
before shutdownOutput()
to send buffered output data.
Implemented in IDataSocket, StreamFilter, and TCPSocket.
|
pure virtual |
Write to stream.
Write n
bytes from buffer
to the stream. If this can't complete immediately it will block. Data may be buffered in order to return more quickly. A output error event is generated when writing fails.
Implemented in IDataSocket, PacketStreamFilter, StreamFilter, and TCPSocket.