OpenMAMA
Wombat::MamdaOrderBook Class Reference

MamdaOrderBook is a class that provides order book functionality, including iterators over price levels and entries within price levels. More...

#include <MamdaOrderBook.h>

Classes

class  askEntryIterator
class  askIterator
class  bidEntryIterator
class  bidIterator

Public Types

typedef const bidIterator constBidIterator
typedef const askIterator constAskIterator
typedef const bidEntryIterator constBidEntryIterator
typedef const askEntryIterator constAskEntryIterator

Public Member Functions

 MamdaOrderBook ()
 ~MamdaOrderBook ()
 MamdaOrderBook (const MamdaOrderBook &)
MamdaOrderBookoperator= (const MamdaOrderBook &)
void clear (bool deleteLevels=true)
 Clear the order book entirely.
void setSymbol (const char *symbol)
 The order book subscription symbol.
const char * getSymbol () const
 The orderbook subscription symbol.
void setPartId (const char *partId)
 The orderbook participant id.
const char * getPartId () const
 The orderbook participant id.
bool hasPartId () const
 The orderbook participant id.
MamdaOrderBookPriceLevelfindOrCreateLevel (double price, MamdaOrderBookPriceLevel::Side side)
 Create a price level in the orderbook for the given price/size.
MamdaOrderBookPriceLevelfindOrCreateLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side)
MamdaOrderBookPriceLevelfindOrCreateLevel (double price, MamdaOrderBookPriceLevel::Side side, MamdaOrderBookPriceLevel::Action &action)
MamdaOrderBookPriceLevelfindOrCreateLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side, MamdaOrderBookPriceLevel::Action &action)
MamdaOrderBookPriceLevelfindLevel (double price, MamdaOrderBookPriceLevel::Side side)
MamdaOrderBookPriceLevelfindLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side)
void addLevel (const MamdaOrderBookPriceLevel &level)
 Add a price level to the orderbook.
void updateLevel (const MamdaOrderBookPriceLevel &level)
 Update an existing level in the orderbook.
void deleteLevel (const MamdaOrderBookPriceLevel &level)
 Delete a price level from the orderbook.
void apply (const MamdaOrderBook &deltaBook)
 Apply a delta to this (presumably) full book.
void apply (const MamdaOrderBookBasicDelta &delta)
 Apply a delta to this book.
void apply (const MamdaOrderBookBasicDeltaList &delta)
 Apply a delta to this book.
void applyMarketOrder (const MamdaOrderBookBasicDelta &delta)
 Apply a market order delta to this book.
void applyMarketOrder (const MamdaOrderBookBasicDeltaList &delta)
 Apply a market order delta to this book.
void copy (const MamdaOrderBook &rhs)
 Copy a book.
void setAsDeltaDeleted (const MamdaOrderBook &bookToDelete)
 Set this order book to be a delta that would, when applied, delete all of the fields in the bookToDelete.
void setAsDeltaDifference (const MamdaOrderBook &lhs, const MamdaOrderBook &rhs)
 Set this order book to be a delta that would, when applied, be the difference between two other books.
size_t getTotalNumLevels () const
 Get the total number of price levels (both sides of order book).
size_t getNumBidLevels () const
 Get the number of bid price levels.
size_t getNumAskLevels () const
 Get the number of ask price levels.
MamdaOrderBookPriceLevelgetBidMarketOrders () const
 Get the bid market orders.
MamdaOrderBookPriceLevelgetAskMarketOrders () const
 Get the ask market orders.
MamdaOrderBookPriceLevelgetMarketOrdersSide (MamdaOrderBookPriceLevel::Side side)
 Get the market orders for the specified side.
MamdaOrderBookPriceLevelgetOrCreateMarketOrdersSide (MamdaOrderBookPriceLevel::Side side)
 Get the market orders for the specified side.
void detach (MamdaOrderBookPriceLevel *level)
 Detach the given level from the book.
void detach (MamdaOrderBookEntry *entry)
 Add the given entry to the detach list to be cleaned up.
void cleanupDetached ()
 Free resources associated with any detached price levels or entries, detached either through explicit calls to detach() or detached as a result or having no remaining entries.
const MamaDateTime & getBookTime () const
 Get the "book time" (or "event time") of the last update.
void setBookTime (const MamaDateTime &bookTime) const
 Set the BookTime for this order book.
void setSourceDerivative (const MamaSourceDerivative *sourceDeriv)
 Set the MamaSourceDerivative for this order book.
const MamaSourceDerivative * getSourceDerivative () const
 Get the MamaSourceDerivative for this order book.
const MamaSource * getSource () const
 Get the MamaSource for this order book.
void setQuality (mamaQuality quality)
 Set the mamaQuality for this order book.
mamaQuality getQuality () const
 Get the mamaQuality for this order book.
void setClosure (void *closure)
 Set the order book closure handle.
void * getClosure () const
 Get the order book closure handle.
bool operator== (const MamdaOrderBook &rhs) const
 Equality operator.
bool operator!= (const MamdaOrderBook &rhs) const
 Non-equality operator.
void addEntry (MamdaOrderBookEntry *entry, double price, MamdaOrderBookPriceLevel::Side side, const MamaDateTime &eventTime, MamdaOrderBookBasicDelta *delta)
 Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.
void addEntry (MamdaOrderBookEntry *entry, MamaPrice &price, MamdaOrderBookPriceLevel::Side side, const MamaDateTime &eventTime, MamdaOrderBookBasicDelta *delta)
 Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.
MamdaOrderBookEntryaddEntry (const char *entryId, mama_quantity_t entrySize, double price, MamdaOrderBookPriceLevel::Side side, const MamaDateTime &eventTime, const MamaSourceDerivative *sourceDeriv, MamdaOrderBookBasicDelta *delta)
 Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.
MamdaOrderBookEntryaddEntry (const char *entryId, mama_quantity_t entrySize, MamaPrice &price, MamdaOrderBookPriceLevel::Side side, const MamaDateTime &eventTime, const MamaSourceDerivative *sourceDeriv, MamdaOrderBookBasicDelta *delta)
 Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.
void updateEntry (MamdaOrderBookEntry *entry, mama_quantity_t size, const MamaDateTime &eventTime, MamdaOrderBookBasicDelta *delta)
 Update an entry in the order book and (if "delta" is not NULL) record information about the delta related to this action.
void deleteEntry (MamdaOrderBookEntry *entry, const MamaDateTime &eventTime, MamdaOrderBookBasicDelta *delta)
 Delete an entry in the order book and (if "delta" is not NULL) record information about the delta related to this action.
void addEntriesFromBook (const MamdaOrderBook *book, MamdaOrderBookEntryFilter *filter, MamdaOrderBookBasicDeltaList *delta)
 Add all entries from another book into this book.
void addPriceLevelsFromBookAsEntries (const MamdaOrderBook *book, const char *source, MamdaOrderBookBasicDeltaList *delta)
 Add all price levels from another book as entries (one per price level) into this book using "source" as the entryId for each entry.
void deleteEntriesFromSource (const MamaSource *source, MamdaOrderBookBasicDeltaList *delta)
 Delete all entries in this book that have "source" as its MamaSource.
bool reevaluate ()
 Re-evaluate the order book.
void setNeedsReevaluation (bool need)
 Set whether this book needs a re-evaluation.
bool getNeedsReevaluation () const
 Get whether this book needs a re-evaluation.
void setCheckSourceState (bool check)
 Set whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.
bool getCheckSourceState () const
 Get whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.
MamdaOrderBookPriceLevelgetLevelAtPrice (double price, MamdaOrderBookPriceLevel::Side side) const
 Return the order book price level at "price" on "side" of the order book.
MamdaOrderBookPriceLevelgetLevelAtPosition (mama_u32_t pos, MamdaOrderBookPriceLevel::Side side) const
 Return the order book price level at position "pos" in the order book.
MamdaOrderBookEntrygetEntryAtPosition (mama_u32_t pos, MamdaOrderBookPriceLevel::Side side) const
 Return the order book entry at position "pos" in the order book.
void assertEqual (const MamdaOrderBook &rhs) const
 Order book equality verification.
bidIterator bidBegin ()
constBidIterator bidBegin () const
bidIterator bidEnd ()
constBidIterator bidEnd () const
askIterator askBegin ()
constAskIterator askBegin () const
askIterator askEnd ()
constAskIterator askEnd () const
bidEntryIterator bidEntryBegin ()
constBidEntryIterator bidEntryBegin () const
bidEntryIterator bidEntryEnd ()
constBidEntryIterator bidEntryEnd () const
askEntryIterator askEntryBegin ()
constAskEntryIterator askEntryBegin () const
askEntryIterator askEntryEnd ()
constAskEntryIterator askEntryEnd () const
void setIsConsistent (bool isConsistent)
 Set whether the order book is in a consistent or an an inconsistent state.
bool getIsConsistent () const
 Get whether the order book is in a consistent or an an inconsistent state.
void dump (ostream &output) const
 Dump the order book to the output stream.
void generateDeltaMsgs (bool generate)
 Enable the generation of book deltas for this book.
bool getGenerateDeltaMsgs ()
 Get whether book delta generation is enabled.
bool populateDelta (MamaMsg &msg)
 Populate a MamaMsg of the changes to this order book.
void populateRecap (MamaMsg &msg)
 Popuklate a MamaMsg with the current state of this order book.
void addDelta (MamdaOrderBookEntry *entry, MamdaOrderBookPriceLevel *level, mama_quantity_t plDeltaSize, MamdaOrderBookPriceLevel::Action plAction, MamdaOrderBookEntry::Action entAction)
 For book delta generation.
void clearDeltaList ()
 clear the delta list using for storing generated deltas
void setBookContributors (const char *bookContributors)
 Set the orderbook contributors.
const char * getBookContributors () const
 Get the orderbook contributors.
bool hasBookContributors () const
 Is the orderbook contributors set.
bool getBookContributorsModified () const
 Get whether the books contributors have been modified.
void setBookContributorsModified (bool modified)
 Set whether the books contributors have been modified.

Static Public Member Functions

static void setStrictChecking (bool strict)
 Enforce strict checking of order book modifications (at the expense of some performance).

Detailed Description

MamdaOrderBook is a class that provides order book functionality, including iterators over price levels and entries within price levels.

Member Typedef Documentation

Constructor & Destructor Documentation

Wombat::MamdaOrderBook::MamdaOrderBook ( )
Wombat::MamdaOrderBook::~MamdaOrderBook ( )
Wombat::MamdaOrderBook::MamdaOrderBook ( const MamdaOrderBook )

Member Function Documentation

MamdaOrderBook& Wombat::MamdaOrderBook::operator= ( const MamdaOrderBook )
void Wombat::MamdaOrderBook::clear ( bool  deleteLevels = true)

Clear the order book entirely.

Parameters
deleteLevelsIf true then the level objects will be deleted
void Wombat::MamdaOrderBook::setSymbol ( const char *  symbol)

The order book subscription symbol.

Parameters
symbolThe subscription symbol.
const char* Wombat::MamdaOrderBook::getSymbol ( ) const

The orderbook subscription symbol.

Returns
The orderbook subscription symbol.
void Wombat::MamdaOrderBook::setPartId ( const char *  partId)

The orderbook participant id.

Parameters
partIdThe participant id
const char* Wombat::MamdaOrderBook::getPartId ( ) const

The orderbook participant id.

Returns
The orderbook participant id
bool Wombat::MamdaOrderBook::hasPartId ( ) const

The orderbook participant id.

Returns
Whether this orderbook has a participant id
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findOrCreateLevel ( double  price,
MamdaOrderBookPriceLevel::Side  side 
)

Create a price level in the orderbook for the given price/size.

The price level is initially empty and marked as "not used". The "not used" status changes automatically when entries are added to the price level.

Parameters
priceThe price of the price level to find/create.
sideThe side of the book of the price level to find/create.
Returns
The found or newly create price level.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findOrCreateLevel ( MamaPrice &  price,
MamdaOrderBookPriceLevel::Side  side 
)
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findOrCreateLevel ( double  price,
MamdaOrderBookPriceLevel::Side  side,
MamdaOrderBookPriceLevel::Action action 
)
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findOrCreateLevel ( MamaPrice &  price,
MamdaOrderBookPriceLevel::Side  side,
MamdaOrderBookPriceLevel::Action action 
)
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findLevel ( double  price,
MamdaOrderBookPriceLevel::Side  side 
)
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::findLevel ( MamaPrice &  price,
MamdaOrderBookPriceLevel::Side  side 
)
void Wombat::MamdaOrderBook::addLevel ( const MamdaOrderBookPriceLevel level)

Add a price level to the orderbook.

Parameters
levelThe price level to add to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::updateLevel ( const MamdaOrderBookPriceLevel level)

Update an existing level in the orderbook.

Parameters
levelThe details of the price level to update.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::deleteLevel ( const MamdaOrderBookPriceLevel level)

Delete a price level from the orderbook.

Parameters
levelThe price level to delete from the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::apply ( const MamdaOrderBook deltaBook)

Apply a delta to this (presumably) full book.

Parameters
deltaBookThe delta to apply to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::apply ( const MamdaOrderBookBasicDelta delta)

Apply a delta to this book.

Parameters
deltaThe simple delta to apply to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::apply ( const MamdaOrderBookBasicDeltaList delta)

Apply a delta to this book.

Parameters
deltaThe complex delta to apply to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::applyMarketOrder ( const MamdaOrderBookBasicDelta delta)

Apply a market order delta to this book.

Parameters
deltaThe simple market order delta to apply to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::applyMarketOrder ( const MamdaOrderBookBasicDeltaList delta)

Apply a market order delta to this book.

Parameters
deltaThe market ordercomplex delta to apply to the orderbook.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::copy ( const MamdaOrderBook rhs)

Copy a book.

Parameters
rhsThe orderbook to copy.
Exceptions
<MamdaOrderBookException>When an error is encountered during book processing.
void Wombat::MamdaOrderBook::setAsDeltaDeleted ( const MamdaOrderBook bookToDelete)

Set this order book to be a delta that would, when applied, delete all of the fields in the bookToDelete.

void Wombat::MamdaOrderBook::setAsDeltaDifference ( const MamdaOrderBook lhs,
const MamdaOrderBook rhs 
)

Set this order book to be a delta that would, when applied, be the difference between two other books.

size_t Wombat::MamdaOrderBook::getTotalNumLevels ( ) const

Get the total number of price levels (both sides of order book).

Returns
The total number of levels in the book.
size_t Wombat::MamdaOrderBook::getNumBidLevels ( ) const

Get the number of bid price levels.

Returns
The total number of bid levels in the book.
size_t Wombat::MamdaOrderBook::getNumAskLevels ( ) const

Get the number of ask price levels.

Returns
The total number of ask levels in the book.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getBidMarketOrders ( ) const

Get the bid market orders.

Returns
The market order bid level.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getAskMarketOrders ( ) const

Get the ask market orders.

Returns
The market order ask level.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getMarketOrdersSide ( MamdaOrderBookPriceLevel::Side  side)

Get the market orders for the specified side.

Will return NULL if no market orders exist in the book.

Parameters
sideThe market order side the price level to get.
Returns
The market order ask level.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getOrCreateMarketOrdersSide ( MamdaOrderBookPriceLevel::Side  side)

Get the market orders for the specified side.

Will create an empty level if none exist.

Parameters
sideThe market order side the price level to get.
Returns
The market order ask level.
void Wombat::MamdaOrderBook::detach ( MamdaOrderBookPriceLevel level)

Detach the given level from the book.

Parameters
levelThe level to detach
void Wombat::MamdaOrderBook::detach ( MamdaOrderBookEntry entry)

Add the given entry to the detach list to be cleaned up.

Parameters
entryThe entry to detach
void Wombat::MamdaOrderBook::cleanupDetached ( )

Free resources associated with any detached price levels or entries, detached either through explicit calls to detach() or detached as a result or having no remaining entries.

const MamaDateTime& Wombat::MamdaOrderBook::getBookTime ( ) const

Get the "book time" (or "event time") of the last update.

The book time is related to market data feeds: the time that the market data feed suggests that the update actually happened.

Returns
The book time of the last update.
void Wombat::MamdaOrderBook::setBookTime ( const MamaDateTime &  bookTime) const

Set the BookTime for this order book.

Parameters
bookTimeThe book time
void Wombat::MamdaOrderBook::setSourceDerivative ( const MamaSourceDerivative *  sourceDeriv)

Set the MamaSourceDerivative for this order book.

Parameters
sourceDerivThe source derivative
const MamaSourceDerivative* Wombat::MamdaOrderBook::getSourceDerivative ( ) const

Get the MamaSourceDerivative for this order book.

Returns
The source derivative.
const MamaSource* Wombat::MamdaOrderBook::getSource ( ) const

Get the MamaSource for this order book.

Returns
The source.
void Wombat::MamdaOrderBook::setQuality ( mamaQuality  quality)

Set the mamaQuality for this order book.

Parameters
qualityThe new quality.
mamaQuality Wombat::MamdaOrderBook::getQuality ( ) const

Get the mamaQuality for this order book.

Returns
The quality.
void Wombat::MamdaOrderBook::setClosure ( void *  closure)

Set the order book closure handle.

Parameters
closureThe closure.
void* Wombat::MamdaOrderBook::getClosure ( ) const

Get the order book closure handle.

Returns
The orderbook closure.
bool Wombat::MamdaOrderBook::operator== ( const MamdaOrderBook rhs) const

Equality operator.

Two books are equal if their symbols, price levels and price level entries are identical.

Parameters
rhsThe book to compare this book to.
Returns
Whether the two books are equal.
bool Wombat::MamdaOrderBook::operator!= ( const MamdaOrderBook rhs) const

Non-equality operator.

Two books are equal if their symbols, price levels and price level entries are identical.

Parameters
rhsThe book to compare this book to.
Returns
Whether the two books are not equal.
{ return ! operator== (rhs); }
void Wombat::MamdaOrderBook::addEntry ( MamdaOrderBookEntry entry,
double  price,
MamdaOrderBookPriceLevel::Side  side,
const MamaDateTime &  eventTime,
MamdaOrderBookBasicDelta delta 
)

Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.

void Wombat::MamdaOrderBook::addEntry ( MamdaOrderBookEntry entry,
MamaPrice &  price,
MamdaOrderBookPriceLevel::Side  side,
const MamaDateTime &  eventTime,
MamdaOrderBookBasicDelta delta 
)

Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.

MamdaOrderBookEntry* Wombat::MamdaOrderBook::addEntry ( const char *  entryId,
mama_quantity_t  entrySize,
double  price,
MamdaOrderBookPriceLevel::Side  side,
const MamaDateTime &  eventTime,
const MamaSourceDerivative *  sourceDeriv,
MamdaOrderBookBasicDelta delta 
)

Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.

The new entry is returned.

MamdaOrderBookEntry* Wombat::MamdaOrderBook::addEntry ( const char *  entryId,
mama_quantity_t  entrySize,
MamaPrice &  price,
MamdaOrderBookPriceLevel::Side  side,
const MamaDateTime &  eventTime,
const MamaSourceDerivative *  sourceDeriv,
MamdaOrderBookBasicDelta delta 
)

Add an entry to the order book and (if "delta" is not NULL) record information about the delta related to this action.

The new entry is returned.

void Wombat::MamdaOrderBook::updateEntry ( MamdaOrderBookEntry entry,
mama_quantity_t  size,
const MamaDateTime &  eventTime,
MamdaOrderBookBasicDelta delta 
)

Update an entry in the order book and (if "delta" is not NULL) record information about the delta related to this action.

If the entry is not internally "wired" to the order book, a MamdaOrderBookInvalidEntry exception is thrown.

void Wombat::MamdaOrderBook::deleteEntry ( MamdaOrderBookEntry entry,
const MamaDateTime &  eventTime,
MamdaOrderBookBasicDelta delta 
)

Delete an entry in the order book and (if "delta" is not NULL) record information about the delta related to this action.

If the entry is not internally "wired" to the order book, a MamdaOrderBookInvalidEntry exception is thrown.

void Wombat::MamdaOrderBook::addEntriesFromBook ( const MamdaOrderBook book,
MamdaOrderBookEntryFilter filter,
MamdaOrderBookBasicDeltaList delta 
)

Add all entries from another book into this book.

Parameters
bookThe source book to add.
filterIf not NULL, a filter to apply to each entry.
deltaAn optional delta to collect the added entries.
void Wombat::MamdaOrderBook::addPriceLevelsFromBookAsEntries ( const MamdaOrderBook book,
const char *  source,
MamdaOrderBookBasicDeltaList delta 
)

Add all price levels from another book as entries (one per price level) into this book using "source" as the entryId for each entry.

Parameters
bookThe source book to add.
sourceThe name to use as the entry ID.
deltaAn optional delta to collect the added entries.
void Wombat::MamdaOrderBook::deleteEntriesFromSource ( const MamaSource *  source,
MamdaOrderBookBasicDeltaList delta 
)

Delete all entries in this book that have "source" as its MamaSource.

Parameters
sourceThe source to match.
deltaAn optional delta to collect the deleted entries.
bool Wombat::MamdaOrderBook::reevaluate ( )

Re-evaluate the order book.

This would be performed after the status of sources and/or subsources of an "aggregated order book" (i.e. a book built from multiple sources) have changed.

Returns
Whether the book info changed based on the re-evaluation.
void Wombat::MamdaOrderBook::setNeedsReevaluation ( bool  need)

Set whether this book needs a re-evaluation.

bool Wombat::MamdaOrderBook::getNeedsReevaluation ( ) const

Get whether this book needs a re-evaluation.

void Wombat::MamdaOrderBook::setCheckSourceState ( bool  check)

Set whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.

bool Wombat::MamdaOrderBook::getCheckSourceState ( ) const

Get whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book.

MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getLevelAtPrice ( double  price,
MamdaOrderBookPriceLevel::Side  side 
) const

Return the order book price level at "price" on "side" of the order book.

Parameters
priceThe price of the order book price level.
sideThe side of the order book to search.
Returns
The order book price level or NULL if not found.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getLevelAtPosition ( mama_u32_t  pos,
MamdaOrderBookPriceLevel::Side  side 
) const

Return the order book price level at position "pos" in the order book.

Parameters
posThe position of the order book price level.
sideThe side of the order book to search.
Returns
The order book price level or NULL if not found.
MamdaOrderBookEntry* Wombat::MamdaOrderBook::getEntryAtPosition ( mama_u32_t  pos,
MamdaOrderBookPriceLevel::Side  side 
) const

Return the order book entry at position "pos" in the order book.

Parameters
posThe position of the order book entry.
sideThe side of the order book to search
Returns
The order book entry or NULL if not found.
void Wombat::MamdaOrderBook::assertEqual ( const MamdaOrderBook rhs) const

Order book equality verification.

A MamdaOrderBookException is thrown if the books are not equal, along with the reason for the inequality.

Parameters
rhsThe book to compare this book to.
Exceptions
MamdaOrderBookExceptionWhen an error is encountered during book processing.
bidIterator Wombat::MamdaOrderBook::bidBegin ( )
constBidIterator Wombat::MamdaOrderBook::bidBegin ( ) const
bidIterator Wombat::MamdaOrderBook::bidEnd ( )
constBidIterator Wombat::MamdaOrderBook::bidEnd ( ) const
askIterator Wombat::MamdaOrderBook::askBegin ( )
constAskIterator Wombat::MamdaOrderBook::askBegin ( ) const
askIterator Wombat::MamdaOrderBook::askEnd ( )
constAskIterator Wombat::MamdaOrderBook::askEnd ( ) const
bidEntryIterator Wombat::MamdaOrderBook::bidEntryBegin ( )
constBidEntryIterator Wombat::MamdaOrderBook::bidEntryBegin ( ) const
bidEntryIterator Wombat::MamdaOrderBook::bidEntryEnd ( )
constBidEntryIterator Wombat::MamdaOrderBook::bidEntryEnd ( ) const
askEntryIterator Wombat::MamdaOrderBook::askEntryBegin ( )
constAskEntryIterator Wombat::MamdaOrderBook::askEntryBegin ( ) const
askEntryIterator Wombat::MamdaOrderBook::askEntryEnd ( )
constAskEntryIterator Wombat::MamdaOrderBook::askEntryEnd ( ) const
void Wombat::MamdaOrderBook::setIsConsistent ( bool  isConsistent)

Set whether the order book is in a consistent or an an inconsistent state.

This method is typically called from within the MamdaOrderBookListener in response to sequence number gap detection and subsequent recovery from a gap event.

Parameters
isConsistentWhether the book is in a consistent state.
bool Wombat::MamdaOrderBook::getIsConsistent ( ) const

Get whether the order book is in a consistent or an an inconsistent state.

A book is marked as being inconsistent by the MamdaOrderBookListener whenever a sequence number gap in the book updates is detected. The order book will be marked as consistent once again once a recap for the book is received by the MamdaOrderBookListener.

Returns
Whether the book is in a consistent state.
void Wombat::MamdaOrderBook::dump ( ostream &  output) const

Dump the order book to the output stream.

Parameters
outputThe ostream to write the orderbook to.
static void Wombat::MamdaOrderBook::setStrictChecking ( bool  strict)
static

Enforce strict checking of order book modifications (at the expense of some performance).

This setting is passed on to the MamdaOrderBookPriceLevel and MamdaOrderBookEntry classes.

void Wombat::MamdaOrderBook::generateDeltaMsgs ( bool  generate)

Enable the generation of book deltas for this book.

When delta generation is enabled changes to the book are saved and can be popultaed to MamaMsgs.

Parameters
publishWhether book delta generation is enabled.
bool Wombat::MamdaOrderBook::getGenerateDeltaMsgs ( )

Get whether book delta generation is enabled.

Returns
Whether book delta generation is enabled.
bool Wombat::MamdaOrderBook::populateDelta ( MamaMsg &  msg)

Populate a MamaMsg of the changes to this order book.

This will include the changes from the last time this function was called or all changes from the initial state.

Parameters
msgA MamaMsg ref containing all changes to the current book.
void Wombat::MamdaOrderBook::populateRecap ( MamaMsg &  msg)

Popuklate a MamaMsg with the current state of this order book.

Parameters
msgA MamaMsg containing all book, price and entry (if applicable) details of the current book.
void Wombat::MamdaOrderBook::addDelta ( MamdaOrderBookEntry entry,
MamdaOrderBookPriceLevel level,
mama_quantity_t  plDeltaSize,
MamdaOrderBookPriceLevel::Action  plAction,
MamdaOrderBookEntry::Action  entAction 
)

For book delta generation.

Add a delta to the order book delta list for the publishing of order book data

Parameters
entryMamdaOrderBookEntry where change occurred.
levelMamdaOrderBookPriceLevel where change occurred.
plDeltaSizePricelevel size change.
plActionPricelevel action.
entActionEntry action.
void Wombat::MamdaOrderBook::clearDeltaList ( )

clear the delta list using for storing generated deltas

void Wombat::MamdaOrderBook::setBookContributors ( const char *  bookContributors)

Set the orderbook contributors.

Parameters
bookContributorsThe orderbook contributors
const char* Wombat::MamdaOrderBook::getBookContributors ( ) const

Get the orderbook contributors.

Returns
The orderbook contributors
bool Wombat::MamdaOrderBook::hasBookContributors ( ) const

Is the orderbook contributors set.

Returns
Whether this orderbook has a list of contributors
bool Wombat::MamdaOrderBook::getBookContributorsModified ( ) const

Get whether the books contributors have been modified.

Returns
Whether the book contributors have been modified.
void Wombat::MamdaOrderBook::setBookContributorsModified ( bool  modified)

Set whether the books contributors have been modified.

Parameters
modifiesWhether the book contributors have been modified.

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


© 2012 Linux Foundation