JayBeams  0.1
Another project to have fun coding.
Functions
jb::itch5::detail Namespace Reference

Functions

void raise_invalid_operation_parameters (char const *operation, int qty, price4_t px)
 Raise the right exception when we detect invalid parameters for add_order() or reduce_order() More...
 
void raise_invalid_reduce (std::string const &msg, std::size_t tk_begin_top, std::size_t tk_inside, price4_t px, int book_qty, int qty)
 Raise an exception describing a invalid reduce operation. More...
 
void validate_operation_params (char const *operation, int qty, price4_t px)
 Validate the input parameters for all array_order_book operations. More...
 
template<class socket_t >
void setup_socket_udp_recv (socket_t &socket, udp_receiver_config const &cfg)
 Configure a socket to receive UDP packets. More...
 
template<typename socket_t >
void setup_socket_udp_send (socket_t &s, udp_sender_config const &cfg)
 

Function Documentation

◆ raise_invalid_operation_parameters()

void jb::itch5::detail::raise_invalid_operation_parameters ( char const *  operation,
int  qty,
price4_t  px 
)

Raise the right exception when we detect invalid parameters for add_order() or reduce_order()

Parameters
operationthe name of the operation that is being processed, typically add_order() or reduce_order().
qtythe qty in the operation
pxthe price of the operation
Exceptions
afeed_error with nicely formatted output always

Definition at line 34 of file array_based_order_book.cpp.

Referenced by validate_operation_params().

◆ raise_invalid_reduce()

void jb::itch5::detail::raise_invalid_reduce ( std::string const &  msg,
std::size_t  tk_begin_top,
std::size_t  tk_inside,
price4_t  px,
int  book_qty,
int  qty 
)

Raise an exception describing a invalid reduce operation.

Parameters
msga human readable explanation of the error condition
tk_begin_topthe first price in the "top-levels"
tk_insidethe price at the inside
pxthe price of the reduce operation being attempted
book_qtythe qty that the book has at that price level, 0 if the level does not exist
qtythe qty of the reduce operation being attempted
Exceptions
feederror with a nicely formatted message, always.

Definition at line 44 of file array_based_order_book.cpp.

Referenced by jb::itch5::array_based_book_side< compare_t >::reduce_order(), and validate_operation_params().

◆ setup_socket_udp_recv()

template<class socket_t >
void jb::itch5::detail::setup_socket_udp_recv ( socket_t &  socket,
udp_receiver_config const &  cfg 
)

◆ setup_socket_udp_send()

template<typename socket_t >
void jb::itch5::detail::setup_socket_udp_send ( socket_t &  s,
udp_sender_config const &  cfg 
)

◆ validate_operation_params()

void jb::itch5::detail::validate_operation_params ( char const *  operation,
int  qty,
price4_t  px 
)
inline

Validate the input parameters for all array_order_book operations.

Both add_order() and reduce_order() require basically the same validation, refactor to a common function.

Parameters
operationthe name of the operation that is being processed, typically add_order() or reduce_order().
qtythe qty in the operation
pxthe price of the operation
Exceptions
afeed_error with nicely formatted output if the validation fails.

Definition at line 51 of file array_based_order_book.hpp.

References raise_invalid_operation_parameters(), and raise_invalid_reduce().

Referenced by jb::itch5::array_based_book_side< compare_t >::add_order(), and jb::itch5::array_based_book_side< compare_t >::reduce_order().