ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
csv_sink.hpp
Go to the documentation of this file.
1#pragma once
2
11
12#include <cstdint>
13#include <ostream>
14
15#include "itch/io/sink.hpp"
16#include "itch/messages.hpp"
17
18namespace itch::io {
19
30class CsvSink : public MessageSink {
31 public:
37 explicit CsvSink(std::ostream& out, bool write_header = true);
38
42 auto write(const Message& message) -> void override;
43
45 auto flush() -> void override;
46
50 [[nodiscard]] auto rows_written() const noexcept -> std::uint64_t { return m_rows_written; }
51
52 private:
53 std::ostream& m_out;
54 std::uint64_t m_rows_written {0};
55};
56
57} // namespace itch::io
Writes parsed ITCH messages to a CSV stream as a flat, normalized table.
Definition csv_sink.hpp:30
auto write(const Message &message) -> void override
Writes one message as a CSV row.
Definition csv_sink.cpp:122
auto rows_written() const noexcept -> std::uint64_t
The number of rows written so far.
Definition csv_sink.hpp:50
auto flush() -> void override
Flushes the underlying stream.
Definition csv_sink.cpp:142
A generic streaming sink for parsed ITCH messages.
Definition sink.hpp:21
Defines every ITCH 5.0 message struct, the Message variant, and the stream-printing helpers used to f...
std::variant< SystemEventMessage, StockDirectoryMessage, StockTradingActionMessage, RegSHOMessage, MarketParticipantPositionMessage, MWCBDeclineLevelMessage, MWCBStatusMessage, IPOQuotingPeriodUpdateMessage, LULDAuctionCollarMessage, OperationalHaltMessage, AddOrderMessage, AddOrderMPIDAttributionMessage, OrderExecutedMessage, OrderExecutedWithPriceMessage, OrderCancelMessage, OrderDeleteMessage, OrderReplaceMessage, NonCrossTradeMessage, CrossTradeMessage, BrokenTradeMessage, NOIIMessage, RetailPriceImprovementIndicatorMessage, DLCRMessage > Message
A variant able to hold any one of the ITCH 5.0 message structs.
Definition messages.hpp:483
Abstract streaming sink interface for parsed ITCH messages.