OpenMAMA
MamdaQuoteToBookListener Class Reference

#include <MamdaQuoteToBookListener.h>

Inheritance diagram for MamdaQuoteToBookListener:
Wombat::MamdaOrderBookListener Wombat::MamdaMsgListener

Public Member Functions

 MamdaQuoteToBookListener (MamdaOrderBook *fullBook=NULL)
 Create an order book listener using an optional user-provided object for the full order book. More...
 
virtual ~MamdaQuoteToBookListener ()
 
virtual void addHandler (MamdaOrderBookHandler *handler)
 Add a specialized order book handler. More...
 
virtual void setProcessEntries (bool process)
 Set whether we are interested in "entry level" information at all. 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 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 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 setProcessProperties (bool value)
 
virtual bool getProcessProperties () 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 void removeHandlers ()
 Remove the reference of handlers from the internal list. More...
 
virtual void clear ()
 Clear all cached data fields. More...
 
virtual mama_seqnum_t getBeginGapSeqNum () const
 
virtual mama_seqnum_t getEndGapSeqNum () const
 
virtual const MamdaOrderBookgetOrderBook () const
 
virtual const char * getSymbol () const
 
virtual const char * getPartId () const
 
virtual mama_seqnum_t getEventSeqNum () const
 
virtual const MamaDateTime & getEventTime () 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 mama_u32_t getQuoteCount () const
 
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 resolvePossiblyDuplicate (bool tf)
 
virtual void setQuality (MamdaSubscription *sub, mamaQuality quality)
 Change the order book quality and invoke appropriate callbacks. More...
 
void setQuoteSizeMultiplier (int multiplier)
 
virtual void onMsg (MamdaSubscription *subscription, const MamaMsg &msg, short msgType)
 Implementation of MamdaListener interface. 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...
 
- 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 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 MamdaOrderBookgetOrderBook ()
 
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 ()
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ MamdaQuoteToBookListener()

MamdaQuoteToBookListener::MamdaQuoteToBookListener ( MamdaOrderBook fullBook = NULL)

Create an order book listener using an optional user-provided object for the full order book.

If "fullBook" is NULL, an object will be allocated internally. If this listener is destroyed then the full order book object will only be destroyed if it was created by the listener (i.e., if fullBook was passed as NULL in this constructor).

Parameters
fullBookThe MamdaOrderBook used to maintain the full book.

◆ ~MamdaQuoteToBookListener()

virtual MamdaQuoteToBookListener::~MamdaQuoteToBookListener ( )
virtual

Member Function Documentation

◆ addHandler()

virtual void MamdaQuoteToBookListener::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.

◆ setProcessEntries()

virtual void MamdaQuoteToBookListener::setProcessEntries ( bool  process)
virtual

Set whether we are interested in "entry level" information at all.

Many applications only care about price level information. (Default is to process entry level information.)

Parameters
processWhether to process entries in books.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ addIgnoreEntryId()

virtual void MamdaQuoteToBookListener::addIgnoreEntryId ( const char *  id)
virtual

Add an entry ID to ignore.

This only makes sense when the entry type is participant ID (as opposed to order ID). All order book updates for this entry ID will be ignored.

Parameters
idThe id of the participant to ignore when process book updates.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ removeIgnoreEntryId()

virtual void MamdaQuoteToBookListener::removeIgnoreEntryId ( const char *  id)
virtual

Remove an entry ID to ignore.

Parameters
idThe id of the participant whose update will be subsequently processed as part of the book.
See also
addIgnoreEntryId(const char*)

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setUseEntryManager()

virtual void MamdaQuoteToBookListener::setUseEntryManager ( bool  useManager)
virtual

Set whether to use an "entry manager" for finding entries in a book.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setEntryIdsAreUnique()

virtual void MamdaQuoteToBookListener::setEntryIdsAreUnique ( bool  uniqueIds)
virtual

Set whether the entry IDs are unique across the entire book.

This is only relevant if using an "entry manager".

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setKeepBasicDeltas()

virtual void MamdaQuoteToBookListener::setKeepBasicDeltas ( bool  keep)
virtual

Set whether to gather individual basic deltas when processing a complex delta.

Many applications don't need the basic deltas and will iterate over part or all of the full book (with the deltas already applied).

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setConflateDeltas()

virtual void MamdaQuoteToBookListener::setConflateDeltas ( bool  conflate)
virtual

Whether to conflate the order book deltas.

Parameters
conflateWhether to conflate the order book deltas

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getConflateDeltas()

virtual bool MamdaQuoteToBookListener::getConflateDeltas ( )
virtual

Whether or not order book deltas are conflated.

Returns
true if conflation is set to true

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setConflationInterval()

virtual void MamdaQuoteToBookListener::setConflationInterval ( double  interval)
virtual

The conflation interval.

Parameters
intervalThe conflation interval in seconds. Default is 0.5 seconds.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ forceInvokeDeltaHandlers()

virtual void MamdaQuoteToBookListener::forceInvokeDeltaHandlers ( )
virtual

Invoke delta handlers immediately if there is a conflated delta pending.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ clearConflatedDeltas()

virtual void MamdaQuoteToBookListener::clearConflatedDeltas ( )
virtual

Clear any pending conflated deltas.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setProcessProperties()

virtual void MamdaQuoteToBookListener::setProcessProperties ( bool  value)
virtual

◆ getProcessProperties()

virtual bool MamdaQuoteToBookListener::getProcessProperties ( ) const
virtual

◆ getSymbolFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getSymbolFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getPartIdFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getPartIdFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getEventSeqNumFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getEventSeqNumFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getEventTimeFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getEventTimeFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getSrcTimeFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getSrcTimeFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getActivityTimeFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getActivityTimeFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getLineTimeFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getLineTimeFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getSendTimeFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getSendTimeFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getMsgQualFieldState()

virtual MamdaFieldState MamdaQuoteToBookListener::getMsgQualFieldState ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ removeHandlers()

virtual void MamdaQuoteToBookListener::removeHandlers ( )
virtual

Remove the reference of handlers from the internal list.

Memory is not freed.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ clear()

virtual void MamdaQuoteToBookListener::clear ( )
virtual

Clear all cached data fields.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getBeginGapSeqNum()

virtual mama_seqnum_t MamdaQuoteToBookListener::getBeginGapSeqNum ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getEndGapSeqNum()

virtual mama_seqnum_t MamdaQuoteToBookListener::getEndGapSeqNum ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getOrderBook()

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

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getSymbol()

virtual const char* MamdaQuoteToBookListener::getSymbol ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getPartId()

virtual const char* MamdaQuoteToBookListener::getPartId ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getEventSeqNum()

virtual mama_seqnum_t MamdaQuoteToBookListener::getEventSeqNum ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getEventTime()

virtual const MamaDateTime& MamdaQuoteToBookListener::getEventTime ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getSrcTime()

virtual const MamaDateTime& MamdaQuoteToBookListener::getSrcTime ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getActivityTime()

virtual const MamaDateTime& MamdaQuoteToBookListener::getActivityTime ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getLineTime()

virtual const MamaDateTime& MamdaQuoteToBookListener::getLineTime ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getSendTime()

virtual const MamaDateTime& MamdaQuoteToBookListener::getSendTime ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getMsgQual()

virtual const MamaMsgQual& MamdaQuoteToBookListener::getMsgQual ( ) const
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getQuoteCount()

virtual mama_u32_t MamdaQuoteToBookListener::getQuoteCount ( ) const
virtual

◆ setUpdateInconsistentBook()

virtual void MamdaQuoteToBookListener::setUpdateInconsistentBook ( bool  update)
virtual

Whether to handle or ignore updates sent for an inconsistent book.

A book may be in an inconsistent state if there has been a gap on the sequence of update (delta) messages. Default is to not update (and wait for a recap).

Parameters
updateWhether to apply updates to an inconsistent book.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setUpdateStaleBook()

virtual void MamdaQuoteToBookListener::setUpdateStaleBook ( bool  update)
virtual

Whether to handle or ignore updates sent for a stale order book.

A book is in a stale state if its mamaQuality is not MAMA_QUALITY_OK..

Parameters
updateWhether to apply updates to a stale book.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setClearStaleBook()

virtual void MamdaQuoteToBookListener::setClearStaleBook ( bool  clear)
virtual

Whether to clear the order book upon detection of a stale book condition.

If this is set to true, then setUpdateStaleBook() should probably have been set to false.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ resolvePossiblyDuplicate()

virtual void MamdaQuoteToBookListener::resolvePossiblyDuplicate ( bool  tf)
virtual

◆ setQuality()

virtual void MamdaQuoteToBookListener::setQuality ( MamdaSubscription sub,
mamaQuality  quality 
)
virtual

Change the order book quality and invoke appropriate callbacks.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ setQuoteSizeMultiplier()

void MamdaQuoteToBookListener::setQuoteSizeMultiplier ( int  multiplier)

◆ onMsg()

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

Implementation of MamdaListener interface.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ acquireReadLock()

virtual void MamdaQuoteToBookListener::acquireReadLock ( )
virtual

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.

releaseReadLock should be called to release the lock.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ releaseReadLock()

virtual void MamdaQuoteToBookListener::releaseReadLock ( )
virtual

Release the read lock on the full book.

A companion to the acquireReadLock method.

Reimplemented from Wombat::MamdaOrderBookListener.

◆ acquireWriteLock()

virtual void MamdaQuoteToBookListener::acquireWriteLock ( )
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ releaseWriteLock()

virtual void MamdaQuoteToBookListener::releaseWriteLock ( )
virtual

Reimplemented from Wombat::MamdaOrderBookListener.

◆ getBookSnapShot()

virtual void MamdaQuoteToBookListener::getBookSnapShot ( MamdaOrderBook result)
virtual

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.

This routine will throw a MamdaOrderBookException in the following three circumstances:

  • If the Mamda API hasn't been built with multi-threading enabled, or
  • If there is no listener within the process for the given symbol, or
  • The listener hasn't as yet received an initial image.
Exceptions
<MamdaOrderBookException>See above for details.

Reimplemented from Wombat::MamdaOrderBookListener.


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


© 2012 Linux Foundation