OpenMAMA
Wombat::MamdaBookAtomicListener Class Reference

MamdaBookAtomicListener is a class that specializes in handling order book updates. More...

#include <MamdaBookAtomicListener.h>

Inheritance diagram for Wombat::MamdaBookAtomicListener:
Wombat::MamdaMsgListener Wombat::MamdaBookAtomicLevel Wombat::MamdaBookAtomicLevelEntry Wombat::MamdaBookAtomicGap Wombat::MamdaBasicRecap Wombat::MamdaBasicRecap Wombat::MamdaBasicEvent

Public Member Functions

 MamdaBookAtomicListener ()
 
virtual ~MamdaBookAtomicListener ()
 
void addBookHandler (MamdaBookAtomicBookHandler *handler)
 
void addLevelHandler (MamdaBookAtomicLevelHandler *handler)
 
void addLevelEntryHandler (MamdaBookAtomicLevelEntryHandler *handler)
 
const char * getSymbol () const
 Get the instruments string symbol. More...
 
const char * getPartId () const
 Get the participant identifier. More...
 
const MamaDateTime & getSrcTime () const
 Get the source time. More...
 
const MamaDateTime & getActivityTime () const
 Get the activity time. More...
 
const MamaDateTime & getLineTime () const
 Get the line time. More...
 
const MamaDateTime & getSendTime () const
 Get the send time. More...
 
const MamaMsgQual & getMsgQual () const
 Get the message qualifier. More...
 
const MamaDateTime & getEventTime () const
 Get the event time. More...
 
mama_seqnum_t getEventSeqNum () const
 Get the event sequence number. More...
 
MamdaFieldState getSymbolFieldState () const
 Get the string symbol field state. More...
 
MamdaFieldState getPartIdFieldState () const
 Get the participant identifier field state. More...
 
MamdaFieldState getEventSeqNumFieldState () const
 Get the event sequence number field state. More...
 
MamdaFieldState getEventTimeFieldState () const
 Get the event time field state. More...
 
MamdaFieldState getSrcTimeFieldState () const
 Get the source time field state. More...
 
MamdaFieldState getActivityTimeFieldState () const
 Get the activity time field state. More...
 
MamdaFieldState getLineTimeFieldState () const
 Get the line time of the update. More...
 
MamdaFieldState getSendTimeFieldState () const
 Get the send time field state. More...
 
MamdaFieldState getMsgQualFieldState () const
 Get the message qualifier field state. More...
 
mama_u32_t getPriceLevelNumLevels () const
 Return the number of price levels in the order book update. More...
 
mama_u32_t getPriceLevelNum () const
 Return at which position this level is within an update containing a number of levels. More...
 
double getPriceLevelPrice () const
 Return the price for this price level. More...
 
MamaPrice & getPriceLevelMamaPrice () const
 Return the MamaPrice for this price level. More...
 
mama_f64_t getPriceLevelSize () const
 Return the number of order entries comprising this price level. More...
 
mama_i64_t getPriceLevelSizeChange () const
 Aggregate size at current price level. More...
 
char getPriceLevelAction () const
 The action to apply to the orderbook for this price level. More...
 
char getPriceLevelSide () const
 Side of book at current price level. More...
 
const MamaDateTime & getPriceLevelTime () const
 Time of order book price level. More...
 
mama_f32_t getPriceLevelNumEntries () const
 Number of order book entries at current price level. More...
 
mama_u32_t getPriceLevelActNumEntries () const
 
char getPriceLevelEntryAction () const
 Order book entry action to apply to the full order book. More...
 
char getPriceLevelEntryReason () const
 Order book entry reason. More...
 
const char * getPriceLevelEntryId () const
 Order book entry Id. More...
 
mama_u64_t getPriceLevelEntrySize () const
 Return the order book entry size. More...
 
const MamaDateTime & getPriceLevelEntryTime () const
 Return the time of order book entry update. More...
 
MamdaOrderBookTypes::OrderType getOrderType () const
 Get the Order Type. More...
 
void setOrderType (MamdaOrderBookTypes::OrderType orderType) const
 Set the Order Type. More...
 
bool getHasMarketOrders () const
 
void setProcessMarketOrders (bool process) const
 
mama_seqnum_t getBeginGapSeqNum () const
 The starting number of a detected sequence number gap in order book updates from the feedhandler. More...
 
mama_seqnum_t getEndGapSeqNum () const
 The ending number of a detected sequence number gap in order book updates from the feedhandler. More...
 
virtual void onMsg (MamdaSubscription *subscription, const MamaMsg &msg, short msgType)
 
- Public Member Functions inherited from Wombat::MamdaMsgListener
virtual ~MamdaMsgListener ()
 
- Public Member Functions inherited from Wombat::MamdaBookAtomicLevel
virtual ~MamdaBookAtomicLevel ()
 
- Public Member Functions inherited from Wombat::MamdaBasicRecap
virtual ~MamdaBasicRecap ()
 Destructor. More...
 
- Public Member Functions inherited from Wombat::MamdaBookAtomicLevelEntry
virtual ~MamdaBookAtomicLevelEntry ()
 
- Public Member Functions inherited from Wombat::MamdaBookAtomicGap
virtual ~MamdaBookAtomicGap ()
 
- Public Member Functions inherited from Wombat::MamdaBasicEvent
virtual ~MamdaBasicEvent ()
 Destructor. More...
 

Detailed Description

MamdaBookAtomicListener is a class that specializes in handling order book updates.

Unlike the MamdaOrderBookListener no actual order book is built or maintained. The sole purpose of this is to provide clients direct access to the orderbook updates without the overhead of maintaining a book. Developers provide their own implementation of either or both the MamdaBookAtomicLevelHandler and the MamdaBookAtomicLevelEntryHandler interfaces and will be delivered notifications for order book recaps and deltas. While the MamdaBookAtomicLevelHandler handles recaps and deltas at a Price Level granularity the MamdaBookAtomicLevelEntryHandler handles recaps and deltas at a Price Level Entry level (both level & entry data). Notifications for order book deltas include only the delta. An obvious application for this MAMDA class is any kind of program trading application that needs to build its own order book or an application that needs to archive order book data.

Note: The MamdaBookAtomicListener class caches only order book deltas. If only an MamdaBookAtomicLevelHandler is add to this listener updates and deltas are only processed to Price Level granularity and Entry Level data ignored saving on processing time. Among other reasons, caching of these fields makes it possible to provide complete trade-related callbacks, even when the publisher (e.g., feed handler) is only publishing deltas containing modified fields.

Constructor & Destructor Documentation

Wombat::MamdaBookAtomicListener::MamdaBookAtomicListener ( )
virtual Wombat::MamdaBookAtomicListener::~MamdaBookAtomicListener ( )
virtual

Member Function Documentation

void Wombat::MamdaBookAtomicListener::addBookHandler ( MamdaBookAtomicBookHandler handler)
void Wombat::MamdaBookAtomicListener::addLevelHandler ( MamdaBookAtomicLevelHandler handler)
void Wombat::MamdaBookAtomicListener::addLevelEntryHandler ( MamdaBookAtomicLevelEntryHandler handler)
const char* Wombat::MamdaBookAtomicListener::getSymbol ( ) const
virtual

Get the instruments string symbol.

Returns
Symbol. This is the "well-known" symbol for the security, including any symbology mapping performed by the publisher.

Implements Wombat::MamdaBasicEvent.

const char* Wombat::MamdaBookAtomicListener::getPartId ( ) const
virtual

Get the participant identifier.

Returns
Participant ID. This may be an exchange identifier, a market maker ID, etc., or NULL (if this is not related to any specific participant).

Implements Wombat::MamdaBasicEvent.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getSrcTime ( ) const
virtual

Get the source time.

Returns
Source time. Typically, the exchange generated feed time stamp. This is often the same as the "event time", because many feeds do not distinguish between the actual event time and when the exchange sent the message.

Implements Wombat::MamdaBasicEvent.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getActivityTime ( ) const
virtual

Get the activity time.

Returns
Activity time. A feed handler generated time stamp representing when the data item was last updated.

Implements Wombat::MamdaBasicEvent.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getLineTime ( ) const
virtual

Get the line time.

Returns
Line time. A feed handler (or similar publisher) time stamp representing the time that such publisher received the update message pertaining to the event. If clocks are properly synchronized and the source time (see above) is accurate enough, then the difference between the source time and line time is the latency between the data source and the feed handler.

Implements Wombat::MamdaBasicEvent.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getSendTime ( ) const
virtual

Get the send time.

Returns
Send time. A feed handler (or similar publisher) time stamp representing the time that such publisher sent the current message. The difference between the line time and send time is the latency within the feed handler itself. Also, if clocks are properly synchronized then the difference between the send time and current time is the latency within the market data distribution framework (i.e. MAMA and the underlying middleware). See MAMA API: MamaDateTime::currentTime()).

Implements Wombat::MamdaBasicEvent.

const MamaMsgQual& Wombat::MamdaBookAtomicListener::getMsgQual ( ) const
virtual

Get the message qualifier.

Returns
Message Qualifier. The message qualifier provides information in relation to messages duplicate, delayed or out-of-sequence status.

Implements Wombat::MamdaBasicEvent.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getEventTime ( ) const
virtual

Get the event time.

Returns
Event time. Typically, when the event actually occurred. This is often the same as the "source time", because many feeds do not distinguish between the actual event time and when the exchange sent the message.

Implements Wombat::MamdaBasicEvent.

mama_seqnum_t Wombat::MamdaBookAtomicListener::getEventSeqNum ( ) const
virtual

Get the event sequence number.

Returns
Source sequence number. The exchange generated sequence number.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getSymbolFieldState ( ) const
virtual

Get the string symbol field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getPartIdFieldState ( ) const
virtual

Get the participant identifier field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getEventSeqNumFieldState ( ) const
virtual

Get the event sequence number field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getEventTimeFieldState ( ) const
virtual

Get the event time field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getSrcTimeFieldState ( ) const
virtual

Get the source time field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getActivityTimeFieldState ( ) const
virtual

Get the activity time field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getLineTimeFieldState ( ) const
virtual

Get the line time of the update.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getSendTimeFieldState ( ) const
virtual

Get the send time field state.

Returns
MamdaFieldState. An enumeration representing field state.

Implements Wombat::MamdaBasicEvent.

MamdaFieldState Wombat::MamdaBookAtomicListener::getMsgQualFieldState ( ) const
virtual

Get the message qualifier field state.

Returns
Message Qualifier. The message qualifier provides information in relation to messages duplicate, delayed or out-of-sequence status.

Implements Wombat::MamdaBasicEvent.

mama_u32_t Wombat::MamdaBookAtomicListener::getPriceLevelNumLevels ( ) const
virtual

Return the number of price levels in the order book update.

Returns
The number of price levels.

Implements Wombat::MamdaBookAtomicLevel.

mama_u32_t Wombat::MamdaBookAtomicListener::getPriceLevelNum ( ) const
virtual

Return at which position this level is within an update containing a number of levels.

(i.e. level m of n levels in the update)

Returns
The position of this level in the update received.

Implements Wombat::MamdaBookAtomicLevel.

double Wombat::MamdaBookAtomicListener::getPriceLevelPrice ( ) const
virtual

Return the price for this price level.

Returns
The price level price.

Implements Wombat::MamdaBookAtomicLevel.

MamaPrice& Wombat::MamdaBookAtomicListener::getPriceLevelMamaPrice ( ) const
virtual

Return the MamaPrice for this price level.

Returns
The price level price.

Implements Wombat::MamdaBookAtomicLevel.

mama_f64_t Wombat::MamdaBookAtomicListener::getPriceLevelSize ( ) const
virtual

Return the number of order entries comprising this price level.

Warning
Not supported for V5 entry book updates.
Returns
The number of entries in this price level.

Implements Wombat::MamdaBookAtomicLevel.

mama_i64_t Wombat::MamdaBookAtomicListener::getPriceLevelSizeChange ( ) const
virtual

Aggregate size at current price level.

Warning
Not supported for V5 entry book updates.
Returns
The aggregate size at the current price level.

Implements Wombat::MamdaBookAtomicLevel.

char Wombat::MamdaBookAtomicListener::getPriceLevelAction ( ) const
virtual

The action to apply to the orderbook for this price level.

Can have a value of:

  • A : Add a new price level
  • U : Update an existing price level
  • D : Delete an existing price level
  • C : Closing information for price level (often treat the same as Update).
Warning
Not supported for V5 entry book updates.
Returns
The price level action.

Implements Wombat::MamdaBookAtomicLevel.

char Wombat::MamdaBookAtomicListener::getPriceLevelSide ( ) const
virtual

Side of book at current price level.

  • B : Bid side. Same as 'buy' side.
  • A : Ask side. Same as 'sell' side.
Returns
The price level side.

Implements Wombat::MamdaBookAtomicLevel.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getPriceLevelTime ( ) const
virtual

Time of order book price level.

Returns
The time of the orderbook price level.

Implements Wombat::MamdaBookAtomicLevel.

mama_f32_t Wombat::MamdaBookAtomicListener::getPriceLevelNumEntries ( ) const
virtual

Number of order book entries at current price level.

Warning
Not supported for V5 entry book updates.
Returns
The number of entries at the current price level.

Implements Wombat::MamdaBookAtomicLevel.

mama_u32_t Wombat::MamdaBookAtomicListener::getPriceLevelActNumEntries ( ) const
virtual
char Wombat::MamdaBookAtomicListener::getPriceLevelEntryAction ( ) const
virtual

Order book entry action to apply to the full order book.

  • A : Add entry to the price level.
  • U : Update existing entry in the price level.
  • D : Delete existing entry from the price level.
Returns
The orderbook entry action.

Implements Wombat::MamdaBookAtomicLevelEntry.

char Wombat::MamdaBookAtomicListener::getPriceLevelEntryReason ( ) const
virtual

Order book entry reason.

Returns
The orderbook entry reason.

Implements Wombat::MamdaBookAtomicLevelEntry.

const char* Wombat::MamdaBookAtomicListener::getPriceLevelEntryId ( ) const
virtual

Order book entry Id.

(order ID, participant ID, etc.)

Returns
The entry id

Implements Wombat::MamdaBookAtomicLevelEntry.

mama_u64_t Wombat::MamdaBookAtomicListener::getPriceLevelEntrySize ( ) const
virtual

Return the order book entry size.

Returns
Order book entry size

Implements Wombat::MamdaBookAtomicLevelEntry.

const MamaDateTime& Wombat::MamdaBookAtomicListener::getPriceLevelEntryTime ( ) const
virtual

Return the time of order book entry update.

Returns
Time of order book entry update.

Implements Wombat::MamdaBookAtomicLevelEntry.

MamdaOrderBookTypes::OrderType Wombat::MamdaBookAtomicListener::getOrderType ( ) const
virtual

Get the Order Type.

Returns
The order Type.

Implements Wombat::MamdaBookAtomicLevel.

void Wombat::MamdaBookAtomicListener::setOrderType ( MamdaOrderBookTypes::OrderType  orderType) const
virtual

Set the Order Type.

Implements Wombat::MamdaBookAtomicLevel.

bool Wombat::MamdaBookAtomicListener::getHasMarketOrders ( ) const
void Wombat::MamdaBookAtomicListener::setProcessMarketOrders ( bool  process) const
mama_seqnum_t Wombat::MamdaBookAtomicListener::getBeginGapSeqNum ( ) const
virtual

The starting number of a detected sequence number gap in order book updates from the feedhandler.

Returns
Starting sequence number of a sequence number gap.

Implements Wombat::MamdaBookAtomicGap.

mama_seqnum_t Wombat::MamdaBookAtomicListener::getEndGapSeqNum ( ) const
virtual

The ending number of a detected sequence number gap in order book updates from the feedhandler.

Returns
Ending sequence number of a sequence number gap.

Implements Wombat::MamdaBookAtomicGap.

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

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


© 2012 Linux Foundation