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 &) | |
MamdaOrderBook & | operator= (const MamdaOrderBook &) |
void | clear (bool deleteLevels=true) |
Clear the order book entirely. More... | |
void | setSymbol (const char *symbol) |
The order book subscription symbol. More... | |
const char * | getSymbol () const |
The orderbook subscription symbol. More... | |
void | setPartId (const char *partId) |
The orderbook participant id. More... | |
const char * | getPartId () const |
The orderbook participant id. More... | |
bool | hasPartId () const |
The orderbook participant id. More... | |
MamdaOrderBookPriceLevel * | findOrCreateLevel (double price, MamdaOrderBookPriceLevel::Side side) |
Create a price level in the orderbook for the given price/size. More... | |
MamdaOrderBookPriceLevel * | findOrCreateLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side) |
MamdaOrderBookPriceLevel * | findOrCreateLevel (double price, MamdaOrderBookPriceLevel::Side side, MamdaOrderBookPriceLevel::Action &action) |
MamdaOrderBookPriceLevel * | findOrCreateLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side, MamdaOrderBookPriceLevel::Action &action) |
MamdaOrderBookPriceLevel * | findLevel (double price, MamdaOrderBookPriceLevel::Side side) |
MamdaOrderBookPriceLevel * | findLevel (MamaPrice &price, MamdaOrderBookPriceLevel::Side side) |
void | addLevel (const MamdaOrderBookPriceLevel &level) |
Add a price level to the orderbook. More... | |
void | updateLevel (const MamdaOrderBookPriceLevel &level) |
Update an existing level in the orderbook. More... | |
void | deleteLevel (const MamdaOrderBookPriceLevel &level) |
Delete a price level from the orderbook. More... | |
void | apply (const MamdaOrderBook &deltaBook) |
Apply a delta to this (presumably) full book. More... | |
void | apply (const MamdaOrderBookBasicDelta &delta) |
Apply a delta to this book. More... | |
void | apply (const MamdaOrderBookBasicDeltaList &delta) |
Apply a delta to this book. More... | |
void | applyMarketOrder (const MamdaOrderBookBasicDelta &delta) |
Apply a market order delta to this book. More... | |
void | applyMarketOrder (const MamdaOrderBookBasicDeltaList &delta) |
Apply a market order delta to this book. More... | |
void | copy (const MamdaOrderBook &rhs) |
Copy a book. More... | |
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. More... | |
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. More... | |
size_t | getTotalNumLevels () const |
Get the total number of price levels (both sides of order book). More... | |
size_t | getNumBidLevels () const |
Get the number of bid price levels. More... | |
size_t | getNumAskLevels () const |
Get the number of ask price levels. More... | |
MamdaOrderBookPriceLevel * | getBidMarketOrders () const |
Get the bid market orders. More... | |
MamdaOrderBookPriceLevel * | getAskMarketOrders () const |
Get the ask market orders. More... | |
MamdaOrderBookPriceLevel * | getMarketOrdersSide (MamdaOrderBookPriceLevel::Side side) |
Get the market orders for the specified side. More... | |
MamdaOrderBookPriceLevel * | getOrCreateMarketOrdersSide (MamdaOrderBookPriceLevel::Side side) |
Get the market orders for the specified side. More... | |
void | detach (MamdaOrderBookPriceLevel *level) |
Detach the given level from the book. More... | |
void | detach (MamdaOrderBookEntry *entry) |
Add the given entry to the detach list to be cleaned up. More... | |
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. More... | |
const MamaDateTime & | getBookTime () const |
Get the "book time" (or "event time") of the last update. More... | |
void | setBookTime (const MamaDateTime &bookTime) const |
Set the BookTime for this order book. More... | |
void | setSourceDerivative (const MamaSourceDerivative *sourceDeriv) |
Set the MamaSourceDerivative for this order book. More... | |
const MamaSourceDerivative * | getSourceDerivative () const |
Get the MamaSourceDerivative for this order book. More... | |
const MamaSource * | getSource () const |
Get the MamaSource for this order book. More... | |
void | setQuality (mamaQuality quality) |
Set the mamaQuality for this order book. More... | |
mamaQuality | getQuality () const |
Get the mamaQuality for this order book. More... | |
void | setClosure (void *closure) |
Set the order book closure handle. More... | |
void * | getClosure () const |
Get the order book closure handle. More... | |
bool | operator== (const MamdaOrderBook &rhs) const |
Equality operator. More... | |
bool | operator!= (const MamdaOrderBook &rhs) const |
Non-equality operator. More... | |
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. More... | |
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. More... | |
MamdaOrderBookEntry * | 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. More... | |
MamdaOrderBookEntry * | 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. More... | |
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. More... | |
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. More... | |
void | addEntriesFromBook (const MamdaOrderBook *book, MamdaOrderBookEntryFilter *filter, MamdaOrderBookBasicDeltaList *delta) |
Add all entries from another book into this book. More... | |
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. More... | |
void | deleteEntriesFromSource (const MamaSource *source, MamdaOrderBookBasicDeltaList *delta) |
Delete all entries in this book that have "source" as its MamaSource. More... | |
bool | reevaluate () |
Re-evaluate the order book. More... | |
void | setNeedsReevaluation (bool need) |
Set whether this book needs a re-evaluation. More... | |
bool | getNeedsReevaluation () const |
Get whether this book needs a re-evaluation. More... | |
void | setCheckSourceState (bool check) |
Set whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book. More... | |
bool | getCheckSourceState () const |
Get whether to check the MamaSourceState when adding/deleting/re-evaluating entries in the book. More... | |
MamdaOrderBookPriceLevel * | getLevelAtPrice (double price, MamdaOrderBookPriceLevel::Side side) const |
Return the order book price level at "price" on "side" of the order book. More... | |
MamdaOrderBookPriceLevel * | getLevelAtPosition (mama_u32_t pos, MamdaOrderBookPriceLevel::Side side) const |
Return the order book price level at position "pos" in the order book. More... | |
MamdaOrderBookEntry * | getEntryAtPosition (mama_u32_t pos, MamdaOrderBookPriceLevel::Side side) const |
Return the order book entry at position "pos" in the order book. More... | |
void | assertEqual (const MamdaOrderBook &rhs) const |
Order book equality verification. More... | |
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. More... | |
bool | getIsConsistent () const |
Get whether the order book is in a consistent or an an inconsistent state. More... | |
void | dump (ostream &output) const |
Dump the order book to the output stream. More... | |
void | generateDeltaMsgs (bool generate) |
Enable the generation of book deltas for this book. More... | |
bool | getGenerateDeltaMsgs () |
Get whether book delta generation is enabled. More... | |
bool | populateDelta (MamaMsg &msg) |
Populate a MamaMsg of the changes to this order book. More... | |
void | populateRecap (MamaMsg &msg) |
Popuklate a MamaMsg with the current state of this order book. More... | |
void | addDelta (MamdaOrderBookEntry *entry, MamdaOrderBookPriceLevel *level, mama_quantity_t plDeltaSize, MamdaOrderBookPriceLevel::Action plAction, MamdaOrderBookEntry::Action entAction) |
For book delta generation. More... | |
void | clearDeltaList () |
clear the delta list using for storing generated deltas More... | |
void | setBookContributors (const char *bookContributors) |
Set the orderbook contributors. More... | |
const char * | getBookContributors () const |
Get the orderbook contributors. More... | |
bool | hasBookContributors () const |
Is the orderbook contributors set. More... | |
bool | getBookContributorsModified () const |
Get whether the books contributors have been modified. More... | |
void | setBookContributorsModified (bool modified) |
Set whether the books contributors have been modified. More... | |
Static Public Member Functions | |
static void | setStrictChecking (bool strict) |
Enforce strict checking of order book modifications (at the expense of some performance). More... | |
MamdaOrderBook is a class that provides order book functionality, including iterators over price levels and entries within price levels.
typedef const bidIterator Wombat::MamdaOrderBook::constBidIterator |
typedef const askIterator Wombat::MamdaOrderBook::constAskIterator |
Wombat::MamdaOrderBook::MamdaOrderBook | ( | ) |
Wombat::MamdaOrderBook::~MamdaOrderBook | ( | ) |
Wombat::MamdaOrderBook::MamdaOrderBook | ( | const MamdaOrderBook & | ) |
MamdaOrderBook& Wombat::MamdaOrderBook::operator= | ( | const MamdaOrderBook & | ) |
void Wombat::MamdaOrderBook::clear | ( | bool | deleteLevels = true | ) |
Clear the order book entirely.
deleteLevels | If true then the level objects will be deleted |
void Wombat::MamdaOrderBook::setSymbol | ( | const char * | symbol | ) |
The order book subscription symbol.
symbol | The subscription symbol. |
const char* Wombat::MamdaOrderBook::getSymbol | ( | ) | const |
The orderbook subscription symbol.
void Wombat::MamdaOrderBook::setPartId | ( | const char * | partId | ) |
The orderbook participant id.
partId | The participant id |
const char* Wombat::MamdaOrderBook::getPartId | ( | ) | const |
The orderbook participant id.
bool Wombat::MamdaOrderBook::hasPartId | ( | ) | const |
The orderbook 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.
price | The price of the price level to find/create. |
side | The side of the book of the price level to find/create. |
<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.
level | The price level to add to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::updateLevel | ( | const MamdaOrderBookPriceLevel & | level | ) |
Update an existing level in the orderbook.
level | The details of the price level to update. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::deleteLevel | ( | const MamdaOrderBookPriceLevel & | level | ) |
Delete a price level from the orderbook.
level | The price level to delete from the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::apply | ( | const MamdaOrderBook & | deltaBook | ) |
Apply a delta to this (presumably) full book.
deltaBook | The delta to apply to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::apply | ( | const MamdaOrderBookBasicDelta & | delta | ) |
Apply a delta to this book.
delta | The simple delta to apply to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::apply | ( | const MamdaOrderBookBasicDeltaList & | delta | ) |
Apply a delta to this book.
delta | The complex delta to apply to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::applyMarketOrder | ( | const MamdaOrderBookBasicDelta & | delta | ) |
Apply a market order delta to this book.
delta | The simple market order delta to apply to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::applyMarketOrder | ( | const MamdaOrderBookBasicDeltaList & | delta | ) |
Apply a market order delta to this book.
delta | The market ordercomplex delta to apply to the orderbook. |
<MamdaOrderBookException> | When an error is encountered during book processing. |
void Wombat::MamdaOrderBook::copy | ( | const MamdaOrderBook & | rhs | ) |
Copy a book.
rhs | The orderbook to copy. |
<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).
size_t Wombat::MamdaOrderBook::getNumBidLevels | ( | ) | const |
Get the number of bid price levels.
size_t Wombat::MamdaOrderBook::getNumAskLevels | ( | ) | const |
Get the number of ask price levels.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getBidMarketOrders | ( | ) | const |
Get the bid market orders.
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getAskMarketOrders | ( | ) | const |
Get the ask market orders.
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.
side | The market order side the price level to get. |
MamdaOrderBookPriceLevel* Wombat::MamdaOrderBook::getOrCreateMarketOrdersSide | ( | MamdaOrderBookPriceLevel::Side | side | ) |
Get the market orders for the specified side.
Will create an empty level if none exist.
side | The market order side the price level to get. |
void Wombat::MamdaOrderBook::detach | ( | MamdaOrderBookPriceLevel * | level | ) |
Detach the given level from the book.
level | The level to detach |
void Wombat::MamdaOrderBook::detach | ( | MamdaOrderBookEntry * | entry | ) |
Add the given entry to the detach list to be cleaned up.
entry | The 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.
void Wombat::MamdaOrderBook::setBookTime | ( | const MamaDateTime & | bookTime | ) | const |
Set the BookTime for this order book.
bookTime | The book time |
void Wombat::MamdaOrderBook::setSourceDerivative | ( | const MamaSourceDerivative * | sourceDeriv | ) |
Set the MamaSourceDerivative for this order book.
sourceDeriv | The source derivative |
const MamaSourceDerivative* Wombat::MamdaOrderBook::getSourceDerivative | ( | ) | const |
Get the MamaSourceDerivative for this order book.
const MamaSource* Wombat::MamdaOrderBook::getSource | ( | ) | const |
Get the MamaSource for this order book.
void Wombat::MamdaOrderBook::setQuality | ( | mamaQuality | quality | ) |
Set the mamaQuality for this order book.
quality | The new quality. |
mamaQuality Wombat::MamdaOrderBook::getQuality | ( | ) | const |
Get the mamaQuality for this order book.
void Wombat::MamdaOrderBook::setClosure | ( | void * | closure | ) |
Set the order book closure handle.
closure | The closure. |
void* Wombat::MamdaOrderBook::getClosure | ( | ) | const |
Get the order book closure handle.
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.
rhs | The book to compare this book to. |
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.
rhs | The book to compare this book to. |
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.
book | The source book to add. |
filter | If not NULL, a filter to apply to each entry. |
delta | An 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.
book | The source book to add. |
source | The name to use as the entry ID. |
delta | An 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.
source | The source to match. |
delta | An 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.
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.
price | The price of the order book price level. |
side | The side of the order book to search. |
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.
pos | The position of the order book price level. |
side | The side of the order book to search. |
MamdaOrderBookEntry* Wombat::MamdaOrderBook::getEntryAtPosition | ( | mama_u32_t | pos, |
MamdaOrderBookPriceLevel::Side | side | ||
) | const |
Return the order book entry at position "pos" in the order book.
pos | The position of the order book entry. |
side | The side of the order book to search |
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.
rhs | The book to compare this book to. |
MamdaOrderBookException | When 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.
isConsistent | Whether 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
.
void Wombat::MamdaOrderBook::dump | ( | ostream & | output | ) | const |
Dump the order book to the output stream.
output | The ostream to write the orderbook to. |
|
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.
publish | Whether book delta generation is enabled. |
bool Wombat::MamdaOrderBook::getGenerateDeltaMsgs | ( | ) |
Get 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.
msg | A 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.
msg | A 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
entry | MamdaOrderBookEntry where change occurred. |
level | MamdaOrderBookPriceLevel where change occurred. |
plDeltaSize | Pricelevel size change. |
plAction | Pricelevel action. |
entAction | Entry 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.
bookContributors | The orderbook contributors |
const char* Wombat::MamdaOrderBook::getBookContributors | ( | ) | const |
Get the orderbook contributors.
bool Wombat::MamdaOrderBook::hasBookContributors | ( | ) | const |
Is the orderbook contributors set.
bool Wombat::MamdaOrderBook::getBookContributorsModified | ( | ) | const |
Get whether the books contributors have been modified.
void Wombat::MamdaOrderBook::setBookContributorsModified | ( | bool | modified | ) |
Set whether the books contributors have been modified.
modifies | Whether the book contributors have been modified. |