OpenMAMA
Wombat::MamdaOrderBookChecker Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
realTimeBookThe 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.
realTimeSubscThe 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.
realTimeListenerThe MamdaOrderBookListener associated with the realTimeBook.
handlerThe user-provided callback handler.
intervalSecondsThe 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.

Member Function Documentation

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
Returns
The number of successful checks.
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.

Returns
The number of inconclusive checks.
mama_u32_t Wombat::MamdaOrderBookChecker::getFailureCount ( ) const

Return the number of failed checks.

This should be zero, of course.

Returns
The number of failed checks.

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


© 2012 Linux Foundation