MamdaOrderBookChecker is a class that provides order book sanity checking by periodically requesting snapshots of the order book from the publisher and comparing that with an order book being maintained in real time. More...
#include <MamdaOrderBookChecker.h>
Public Member Functions | |
MamdaOrderBookChecker (const MamdaOrderBook &realTimeBook, const MamdaSubscription &realTimeSubsc, MamdaOrderBookListener &realTimeListener, MamdaOrderBookCheckerHandler *handler, mama_f64_t intervalSeconds) | |
Constructor for the order book checker. | |
MamdaOrderBookChecker (MamaQueue *queue, MamdaOrderBookCheckerHandler *handler, MamaSource *source, const char *symbol, mama_f64_t intervalSeconds) | |
~MamdaOrderBookChecker () | |
Destructor. | |
void | checkSnapShotNow () |
Perform an ad hoc snapshot check now. | |
mama_u32_t | getSuccessCount () const |
mama_u32_t | getInconclusiveCount () const |
Return the number of inconclusive counts. | |
mama_u32_t | getFailureCount () const |
Return the number of failed checks. |
MamdaOrderBookChecker is a class that provides order book sanity checking by periodically requesting snapshots of the order book from the publisher and comparing that with an order book being maintained in real time.
This class is purely for testing purposes, to test for possible configuration or programming errors in the order book publisher and in MAMDA order book management code.
The developer registers a handler that contains callbacks for successful, inconclusive and failure events. The developer also provides an interval representing the frequency of the snapshot checks. The first check will take place at some random point in time between zero and the interval.
Wombat::MamdaOrderBookChecker::MamdaOrderBookChecker | ( | const MamdaOrderBook & | realTimeBook, |
const MamdaSubscription & | realTimeSubsc, | ||
MamdaOrderBookListener & | realTimeListener, | ||
MamdaOrderBookCheckerHandler * | handler, | ||
mama_f64_t | intervalSeconds | ||
) |
Constructor for the order book checker.
The caller registers a callback for events related to the checker.
realTimeBook | The real time order book to compare against. This param is "const" because we are not supposed to change it, even though it will change underneath us. |
realTimeSubsc | The MamdaSubscription associated with the realTimeBook. We need it to access the message-level sequence number. This param is "const" because we are not supposed to change it, even though it will change underneath us. |
realTimeListener | The MamdaOrderBookListener associated with the realTimeBook. |
handler | The user-provided callback handler. |
intervalSeconds | The number of seconds between checks. |
Wombat::MamdaOrderBookChecker::MamdaOrderBookChecker | ( | MamaQueue * | queue, |
MamdaOrderBookCheckerHandler * | handler, | ||
MamaSource * | source, | ||
const char * | symbol, | ||
mama_f64_t | intervalSeconds | ||
) |
Wombat::MamdaOrderBookChecker::~MamdaOrderBookChecker | ( | ) |
Destructor.
void Wombat::MamdaOrderBookChecker::checkSnapShotNow | ( | ) |
Perform an ad hoc snapshot check now.
This may be useful if the checking is to be performed by some external trigger event.
mama_u32_t Wombat::MamdaOrderBookChecker::getSuccessCount | ( | ) | const |
mama_u32_t Wombat::MamdaOrderBookChecker::getInconclusiveCount | ( | ) | const |
Return the number of inconclusive counts.
An attempt to check the order book may be inconclusive if the order book sequence numbers do not match up.
mama_u32_t Wombat::MamdaOrderBookChecker::getFailureCount | ( | ) | const |
Return the number of failed checks.
This should be zero, of course.