#include <icy/packetio.h>Inherits:
PacketStreamAdapter,Startable
Threaded stream reader class.
This class can be connected to a [PacketStream](icy-PacketStream.html#packetstream) to read input from any class that derives from std::istream. It's most regularly used for reading input files.
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
PacketSignal emitter| Return | Name | Description |
|---|---|---|
ThreadedStreamReader inline | #### Parameters | |
~ThreadedStreamReader inline | Stops the reader thread and deletes the owned stream. | |
void | start virtual inline | Starts the reader thread; emits one line per iteration as a RawPacket. Emits a FlagPacket with [PacketFlags::Final](api_icy.md#namespaceicy_1a3d1e0d9028d45b9ec824bf4306047f18abeae421a14a34f831c113f61323d1ab3) on EOF. |
void | stop virtual inline | Cancels the reader thread. |
StreamT & | stream inline | Returns the internal stream cast to StreamT. |
std::istream & | stream inline | #### Returns |
inline
inline ThreadedStreamReader(std::istream * is)is Input stream to read from; takes ownership.inline
inline ~ThreadedStreamReader()Stops the reader thread and deletes the owned stream.
virtual inline
virtual inline void start()Starts the reader thread; emits one line per iteration as a RawPacket. Emits a FlagPacket with [PacketFlags::Final](api_icy.md#namespaceicy_1a3d1e0d9028d45b9ec824bf4306047f18abeae421a14a34f831c113f61323d1ab3) on EOF.
virtual inline
virtual inline void stop()Cancels the reader thread.
inline
template<class StreamT> inline StreamT & stream()Returns the internal stream cast to StreamT.
StreamT Target stream type derived from std::istream.Reference to the cast stream.
std::runtime_error if the cast fails.inline
inline std::istream & stream()Reference to the underlying input stream.
Thread _runnerstd::istream * _istream