#include <icy/packetio.h>Inherits:
PacketProcessor
Packet stream writer class.
This class can be connected to a [PacketStream](icy-PacketStream.html#packetstream) to write output to any class that derives from std::ostream. It's most regularly used for writing output files.
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
PacketSignal emitter| Return | Name | Description |
|---|---|---|
StreamWriter inline | #### Parameters | |
~StreamWriter virtual inline | Closes any open std::ofstream and deletes the owned stream. | |
void | process virtual inline | Serializes the packet via write(), flushes it to the output stream, then forwards the packet to the next processor. |
StreamT & | stream inline | Returns the internal output stream cast to StreamT. |
void | onStreamStateChange virtual inline | Closes the output file on Closed or [Error](icy-Error.html#error) stream state transitions. |
std::ostream & | stream inline | #### Returns |
inline
inline StreamWriter(std::ostream * stream)stream Output stream to write to; takes ownership.virtual inline
virtual inline ~StreamWriter()Closes any open std::ofstream and deletes the owned stream.
virtual inline
virtual inline void process(IPacket & packet)Serializes the packet via write(), flushes it to the output stream, then forwards the packet to the next processor.
packet Incoming packet to process.inline
template<class StreamT> inline StreamT & stream()Returns the internal output stream cast to StreamT.
StreamT Target stream type derived from std::ostream.Reference to the cast stream.
std::runtime_error if the cast fails.virtual inline
virtual inline void onStreamStateChange(const PacketStreamState & state)Closes the output file on Closed or [Error](icy-Error.html#error) stream state transitions.
state New stream state.inline
inline std::ostream & stream()Reference to the underlying output stream.
std::runtime_error if the stream pointer is null.| Return | Name | Description |
|---|---|---|
std::ostream * | _ostream |
std::ostream * _ostream