JayBeams
0.1
Another project to have fun coding.
|
The interface for message_handlers in jb::itch5::process_iostream. More...
Public Member Functions | |
template<typename message_type_t > | |
void | handle_message (time_point const &recv_ts, std::uint64_t msgcnt, std::size_t msgoffset, message_type_t const &m) |
Handle a message. More... | |
void | handle_unknown (time_point const &recv_ts, unknown_message const &msg) |
Handle completely unknown or unexpected messages. More... | |
Time measurement | |
The handler must provide a clock to measure parsing and processing delays in the jb::itch5::process_iostream() function. Typically this is a simple typedef around std::chrono::steady_clock and a wrapper around std::chrono::steady_clock::now(). | |
typedef | time_point |
Timestamps. More... | |
time_point | now () const |
Get the current time. More... | |
The interface for message_handlers in jb::itch5::process_iostream.
The jb::itch5::process_iostream() function reads an ITCH-5.0 file and calls a handler to process each message. This class documents the interface that must be implemented by such a class.
Definition at line 9 of file message_handler_concept.dox.
void jb::itch5::message_handler_concept::handle_message | ( | time_point const & | recv_ts, |
std::uint64_t | msgcnt, | ||
std::size_t | msgoffset, | ||
message_type_t const & | m | ||
) |
Handle a message.
The handler can define this as a single template member function, or as a template member function with some specializations, or as a list of overloaded member functions.
message_type_t | the type of the message, each ITCH-5.0 message type is represented by a different C++ message in jb::itch5 |
recv_ts | the timestamp when the message was received. The message processor timestamps each message after it is fully received, but before it is parsed. |
msgcnt | the number of messages received before this message |
msgoffset | the number of bytes received before this message |
m | the message itself |
void jb::itch5::message_handler_concept::handle_unknown | ( | time_point const & | recv_ts, |
unknown_message const & | msg | ||
) |
Handle completely unknown or unexpected messages.
If the message processor receives an unknown or unexpected message type this member function is called.
recv_ts | the timestamp when the message was received by the processor. |
msg | the unknown message details and contents |
time_point jb::itch5::message_handler_concept::now | ( | ) | const |
Get the current time.
typedef jb::itch5::message_handler_concept::time_point |
Timestamps.
Definition at line 24 of file message_handler_concept.dox.