|
ITCHCPP 1.6.1
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
|
Writes parsed ITCH messages to a CSV stream as a flat, normalized table. More...
#include <csv_sink.hpp>
Inheritance diagram for itch::io::CsvSink:Public Member Functions | |
| CsvSink (std::ostream &out, bool write_header=true) | |
Constructs a sink writing to out, emitting the header row unless write_header is false (useful when appending to an existing file). | |
| auto | write (const Message &message) -> void override |
| Writes one message as a CSV row. | |
| auto | flush () -> void override |
| Flushes the underlying stream. | |
| auto | rows_written () const noexcept -> std::uint64_t |
| The number of rows written so far. | |
Public Member Functions inherited from itch::io::MessageSink | |
| MessageSink ()=default | |
| Default-constructs an empty sink. | |
| MessageSink (const MessageSink &)=default | |
| Copy-constructs a sink. | |
| MessageSink (MessageSink &&) noexcept=default | |
| Move-constructs a sink. | |
| auto | operator= (const MessageSink &) -> MessageSink &=default |
| Copy-assigns a sink. | |
| auto | operator= (MessageSink &&) noexcept -> MessageSink &=default |
| Move-assigns a sink. | |
| virtual | ~MessageSink ()=default |
| Virtual destructor for safe polymorphic destruction. | |
Writes parsed ITCH messages to a CSV stream as a flat, normalized table.
ITCH messages are heterogeneous, so the sink flattens them into one wide row schema sharing the common header plus the most frequently used per-type fields. Fields a given message does not carry are left blank. This is the universal, dependency-free output for quick inspection and legacy tooling; for columnar analytics use the Arrow/Parquet exporter instead.
Columns: message_type,timestamp,stock_locate,tracking_number,symbol, reference_number,side,shares,price,match_number,printable,extra.
Definition at line 30 of file csv_sink.hpp.
|
explicit |
Constructs a sink writing to out, emitting the header row unless write_header is false (useful when appending to an existing file).
| out | Output stream the CSV rows are written to. |
| write_header | Whether to emit the CSV header row on construction. |
Definition at line 115 of file csv_sink.cpp.
|
overridevirtual |
Writes one message as a CSV row.
| message | The parsed message to write. |
Implements itch::io::MessageSink.
Definition at line 122 of file csv_sink.cpp.
|
overridevirtual |
Flushes the underlying stream.
Reimplemented from itch::io::MessageSink.
Definition at line 142 of file csv_sink.cpp.
|
inlinenoexcept |
The number of rows written so far.
Definition at line 50 of file csv_sink.hpp.