OpenMAMA
MamdaOrderBookDepthFilter Class Reference

#include <MamdaOrderBookDepthFilter.h>

Inheritance diagram for MamdaOrderBookDepthFilter:
Wombat::MamdaOrderBookListener Wombat::MamdaOrderBookHandler Wombat::MamdaMsgListener

Public Member Functions

 MamdaOrderBookDepthFilter (MamdaOrderBookListener &parent, size_t depth)
 
virtual ~MamdaOrderBookDepthFilter ()
 
virtual void addHandler (MamdaOrderBookHandler *handler)
 Add a specialized order book handler. More...
 
virtual void removeHandlers ()
 Remove the reference of handlers from the internal list. More...
 
virtual const MamdaOrderBookgetOrderBook () const
 Return the filtered orderbook. More...
 
virtual const MamdaOrderBookgetFullOrderBook () const
 Return the full depth orderbook. More...
 
virtual void onMsg (MamdaSubscription *subscription, const MamaMsg &msg, short msgType)
 Implementation of MamdaListener interface. More...
 
virtual void onBookRecap (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookComplexDelta *delta, const MamdaOrderBookRecap &event, const MamdaOrderBook &book)
 Method invoked when a full refresh of the order book for the security is available. More...
 
virtual void onBookDelta (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookSimpleDelta &event, const MamdaOrderBook &book)
 Method invoked when a basic order book delta is reported. More...
 
virtual void onBookComplexDelta (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookComplexDelta &event, const MamdaOrderBook &book)
 Method invoked when an order book delta is reported. More...
 
virtual void onBookClear (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookClear &event, const MamdaOrderBook &book)
 Method invoked when an order book is cleared. More...
 
virtual void onBookGap (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookGap &event, const MamdaOrderBook &book)
 Method invoked when a gap in order book updates is discovered. More...
 
- Public Member Functions inherited from Wombat::MamdaOrderBookListener
 MamdaOrderBookListener (MamdaOrderBook *fullBook=NULL)
 Create an order book listener using an optional user-provided object for the full order book. More...
 
virtual ~MamdaOrderBookListener ()
 
virtual void setProcessEntries (bool process)
 Set whether we are interested in "entry level" information at all. More...
 
virtual bool getProcessEntries () const
 Get whether we are interested in "entry level" information. More...
 
virtual void setProcessMarketOrders (bool process)
 Set whether we are interested in market order information, if available. More...
 
virtual bool getProcessMarketOrders () const
 Get whether we are interested in market order information. More...
 
virtual void addIgnoreEntryId (const char *id)
 Add an entry ID to ignore. More...
 
virtual void removeIgnoreEntryId (const char *id)
 Remove an entry ID to ignore. More...
 
virtual void clear ()
 Clear all cached data fields. More...
 
virtual const char * getSymbol () const
 
virtual const char * getPartId () const
 
virtual const MamaDateTime & getSrcTime () const
 
virtual const MamaDateTime & getActivityTime () const
 
virtual const MamaDateTime & getLineTime () const
 
virtual const MamaDateTime & getSendTime () const
 
virtual const MamaMsgQual & getMsgQual () const
 
virtual const MamaDateTime & getEventTime () const
 
virtual mama_seqnum_t getEventSeqNum () const
 
virtual MamdaFieldState getSymbolFieldState () const
 
virtual MamdaFieldState getPartIdFieldState () const
 
virtual MamdaFieldState getEventSeqNumFieldState () const
 
virtual MamdaFieldState getEventTimeFieldState () const
 
virtual MamdaFieldState getSrcTimeFieldState () const
 
virtual MamdaFieldState getActivityTimeFieldState () const
 
virtual MamdaFieldState getLineTimeFieldState () const
 
virtual MamdaFieldState getSendTimeFieldState () const
 
virtual MamdaFieldState getMsgQualFieldState () const
 
virtual MamdaOrderBookgetOrderBook ()
 
virtual mama_seqnum_t getBeginGapSeqNum () const
 
virtual mama_seqnum_t getEndGapSeqNum () const
 
virtual void setUseEntryManager (bool useManager)
 Set whether to use an "entry manager" for finding entries in a book. More...
 
virtual void setEntryIdsAreUnique (bool uniqueIds)
 Set whether the entry IDs are unique across the entire book. More...
 
virtual void setKeepBasicDeltas (bool keep)
 Set whether to gather individual basic deltas when processing a complex delta. More...
 
virtual void setUpdateInconsistentBook (bool update)
 Whether to handle or ignore updates sent for an inconsistent book. More...
 
virtual void setUpdateStaleBook (bool update)
 Whether to handle or ignore updates sent for a stale order book. More...
 
virtual void setClearStaleBook (bool clear)
 Whether to clear the order book upon detection of a stale book condition. More...
 
virtual void setQuality (MamdaSubscription *sub, mamaQuality quality)
 Change the order book quality and invoke appropriate callbacks. More...
 
virtual void setConflateDeltas (bool conflate)
 Whether to conflate the order book deltas. More...
 
virtual bool getConflateDeltas ()
 Whether or not order book deltas are conflated. More...
 
virtual void setConflationInterval (double interval)
 The conflation interval. More...
 
virtual void forceInvokeDeltaHandlers ()
 Invoke delta handlers immediately if there is a conflated delta pending. More...
 
virtual void clearConflatedDeltas ()
 Clear any pending conflated deltas. More...
 
virtual void acquireReadLock ()
 Acquire a read lock on the full book, so that an alternative running thread can view the book without it being changed from within the MamdaBookListener. More...
 
virtual void releaseReadLock ()
 Release the read lock on the full book. More...
 
virtual void acquireWriteLock ()
 
virtual void releaseWriteLock ()
 
virtual void getBookSnapShot (MamdaOrderBook &result)
 A thread safe function that can be called to populate a snapshot of the full book for the given symbol providing there already exists a MamdaBookListener for the symbol within the process. More...
 
virtual void setBookPropertyFids (mama_fid_t *fids, mama_size_t numFids)
 Set the FIDs for any additional fields to cached in the book properties for the book. More...
 
virtual void setLevelPropertyFids (mama_fid_t *fids, mama_size_t numFids)
 Set the FIDs for any additional fields to cached in the price level properties for the book. More...
 
virtual void setEntryPropertyFids (mama_fid_t *fids, mama_size_t numFids)
 Set the FIDs for any additional fields to cached in the entry properties for the book. More...
 
- Public Member Functions inherited from Wombat::MamdaMsgListener
virtual ~MamdaMsgListener ()
 
- Public Member Functions inherited from Wombat::MamdaOrderBookHandler
virtual void onMarketOrderDelta (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookSimpleDelta &event, const MamdaOrderBook &book)
 Deprecated. More...
 
virtual void onMarketOrderComplexDelta (MamdaSubscription *subscription, MamdaOrderBookListener &listener, const MamaMsg *msg, const MamdaOrderBookComplexDelta &event, const MamdaOrderBook &book)
 Deprecated. More...
 
virtual ~MamdaOrderBookHandler ()
 

Additional Inherited Members

- Public Attributes inherited from Wombat::MamdaOrderBookListener
MamdaOrderBookListenerImpl & mImpl
 

Constructor & Destructor Documentation

MamdaOrderBookDepthFilter::MamdaOrderBookDepthFilter ( MamdaOrderBookListener parent,
size_t  depth 
)
virtual MamdaOrderBookDepthFilter::~MamdaOrderBookDepthFilter ( )
virtual

Member Function Documentation

virtual void MamdaOrderBookDepthFilter::addHandler ( MamdaOrderBookHandler handler)
virtual

Add a specialized order book handler.

Currently, only one handler can (and must) be registered.

Parameters
handlerThe hadler registered to receive order book update callbacks.

Reimplemented from Wombat::MamdaOrderBookListener.

virtual void MamdaOrderBookDepthFilter::removeHandlers ( )
virtual

Remove the reference of handlers from the internal list.

Memory is not freed.

Reimplemented from Wombat::MamdaOrderBookListener.

virtual const MamdaOrderBook* MamdaOrderBookDepthFilter::getOrderBook ( ) const
virtual

Return the filtered orderbook.

Reimplemented from Wombat::MamdaOrderBookListener.

virtual const MamdaOrderBook* MamdaOrderBookDepthFilter::getFullOrderBook ( ) const
virtual

Return the full depth orderbook.

virtual void MamdaOrderBookDepthFilter::onMsg ( MamdaSubscription subscription,
const MamaMsg &  msg,
short  msgType 
)
virtual

Implementation of MamdaListener interface.

Reimplemented from Wombat::MamdaOrderBookListener.

70  { };
virtual void MamdaOrderBookDepthFilter::onBookRecap ( MamdaSubscription subscription,
MamdaOrderBookListener listener,
const MamaMsg *  msg,
const MamdaOrderBookComplexDelta delta,
const MamdaOrderBookRecap event,
const MamdaOrderBook book 
)
virtual

Method invoked when a full refresh of the order book for the security is available.

The reason for the invocation may be any of the following:

  • Initial image.
  • Start-of-day book state.
  • Recap update (e.g., after server fault tolerant event or data quality event.)
  • After stale status removed.
Parameters
subscriptionThe subscription which received the update.
listenerThe order book listener that invoked this callback.
msgThe MamaMsg that triggered this invocation.
deltaAlways NULL. Reserved for future use.
eventThe order book recap event.
bookThe current full book.

Implements Wombat::MamdaOrderBookHandler.

virtual void MamdaOrderBookDepthFilter::onBookDelta ( MamdaSubscription subscription,
MamdaOrderBookListener listener,
const MamaMsg *  msg,
const MamdaOrderBookSimpleDelta event,
const MamdaOrderBook book 
)
virtual

Method invoked when a basic order book delta is reported.

A basic delta consists of one price levels (add/update/delete), which contains zero or one entries (add/update/delete). Some feeds do not provide order book entry information.

Parameters
subscriptionThe MamdaSubscription handle.
listenerThe order book listener that received the update.
msgThe MamaMsg that triggered this invocation.
eventDetails of the delta event.
bookThe current full book (after applying the delta).

Implements Wombat::MamdaOrderBookHandler.

virtual void MamdaOrderBookDepthFilter::onBookComplexDelta ( MamdaSubscription subscription,
MamdaOrderBookListener listener,
const MamaMsg *  msg,
const MamdaOrderBookComplexDelta event,
const MamdaOrderBook book 
)
virtual

Method invoked when an order book delta is reported.

A delta consists of one or more price levels (add/update/delete), each of which contains zero or more entries (add/update/delete). Some feeds do not provide order book entry information.

Parameters
subscriptionThe MamdaSubscription handle.
listenerThe order book listener that received the update.
msgThe MamaMsg that triggered this invocation.
eventDetails of the the delta.
bookThe current full book (after applying the delta).

Implements Wombat::MamdaOrderBookHandler.

virtual void MamdaOrderBookDepthFilter::onBookClear ( MamdaSubscription subscription,
MamdaOrderBookListener listener,
const MamaMsg *  msg,
const MamdaOrderBookClear event,
const MamdaOrderBook book 
)
virtual

Method invoked when an order book is cleared.

Parameters
subscriptionThe MamdaSubscription handle.
listenerThe order book listener that caused the clear.
msgThe MamaMsg that triggered this invocation.
eventThe clear event.
bookThe current state of the book (empty).

Implements Wombat::MamdaOrderBookHandler.

virtual void MamdaOrderBookDepthFilter::onBookGap ( MamdaSubscription subscription,
MamdaOrderBookListener listener,
const MamaMsg *  msg,
const MamdaOrderBookGap event,
const MamdaOrderBook book 
)
virtual

Method invoked when a gap in order book updates is discovered.

It is usual for a recap to follow shortly after an order book gap is detected.

Parameters
subscriptionThe MamdaSubscription handle.
listenerThe order book listener that detected the gap.
msgThe MamaMsg that triggered this invocation.
eventProvides the sequence number gap range.
bookThe current state of the book.

Implements Wombat::MamdaOrderBookHandler.


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


© 2012 Linux Foundation