JayBeams  0.1
Another project to have fun coding.
Public Member Functions | List of all members
jb::itch5::message_handler_concept Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ handle_message()

template<typename message_type_t >
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.

Template Parameters
message_type_tthe type of the message, each ITCH-5.0 message type is represented by a different C++ message in jb::itch5
Parameters
recv_tsthe timestamp when the message was received. The message processor timestamps each message after it is fully received, but before it is parsed.
msgcntthe number of messages received before this message
msgoffsetthe number of bytes received before this message
mthe message itself

◆ handle_unknown()

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.

Parameters
recv_tsthe timestamp when the message was received by the processor.
msgthe unknown message details and contents

◆ now()

time_point jb::itch5::message_handler_concept::now ( ) const

Get the current time.

Member Data Documentation

◆ time_point

typedef jb::itch5::message_handler_concept::time_point

Timestamps.

Definition at line 24 of file message_handler_concept.dox.


The documentation for this class was generated from the following file: