Classes Files

Wombat::MamaSubscription

More…

#include <MamaSubscription.h>

Inherits from Wombat::MamaBasicSubscription

Public Functions

  Name
virtual ~MamaSubscription()
  MamaSubscription(void )
virtual void setCSubscription(mamaSubscription subscription)
virtual mamaSubscription getCSubscription()
virtual void setup(MamaTransport * transport, MamaQueue * queue, MamaSubscriptionCallback * callback, const char * source, const char * symbol, void * closure =NULL)
virtual void setup(MamaQueue * queue, MamaSubscriptionCallback * callback, MamaSource * source, const char * symbol, void * closure =NULL)
virtual void activate()
virtual void deactivate()
virtual void create(MamaTransport * transport, MamaQueue * queue, MamaSubscriptionCallback * callback, const char * source, const char * symbol, void * closure =NULL)
virtual void create(MamaQueue * queue, MamaSubscriptionCallback * callback, MamaSource * source, const char * symbol, void * closure =NULL)
virtual void createSnapshot(MamaTransport * transport, MamaQueue * queue, MamaSubscriptionCallback * callback, const char * source, const char * symbol, void * closure =NULL)
virtual void setRequiresInitial(bool requiresInitial)
virtual bool getRequiresInitial(void )
virtual bool getReceivedInitial(void )
virtual void setRetries(int retries)
virtual int getRetries(void )
virtual void setSubscriptionType(mamaSubscriptionType type)
virtual mamaSubscriptionType getSubscriptionType(void )
virtual long getServiceLevelOpt(void )
virtual void setServiceLevel(mamaServiceLevel svcLevel, long svcLevelOpt)
virtual mamaServiceLevel getServiceLevel(void )
virtual const char * getSymbol(void ) const
virtual MamaSubscriptionCallback * getCallback(void ) const
virtual void setSymbol(const char * symbol)
virtual const MamaSourceDerivative * getSourceDerivative(void ) const
virtual MamaSourceDerivative * getSourceDerivative(void )
virtual const MamaSource * getSource(void ) const
virtual const char * getSubscSource(void ) const
virtual void setTimeout(double timeout)
virtual double getTimeout(void )
virtual void setRecapTimeout(double timeout)
virtual double getRecapTimeout(void )
virtual void setRecoverGaps(bool recover)
virtual bool getRecoverGaps(void ) const
virtual void setAppDataType(uint8_t dataType)
virtual uint8_t getAppDataType() const
virtual void setGroupSizeHint(int groupSizeHint)
virtual void setItemClosure(void * closure)
virtual void * getItemClosure(void )
virtual void setPreInitialCacheSize(int cacheSize)
virtual int getPreInitialCacheSize(void )
virtual void setMsgQualifierFilter(bool ignoreDefinitelyDuplicate, bool ignorePossiblyDuplicate, bool ignoreDefinitelyDelyaed, bool ignorePossiblyDelayed, bool ignoreOutOfSequence)
virtual void getMsgQualifierFilter(bool & ignoreDefinitelyDuplicate, bool & ignorePossiblyDuplicate, bool & ignoreDefinitelyDelyaed, bool & ignorePossiblyDelayed, bool & ignoreOutOfSequence) const
virtual void destroy()
virtual void destroyEx()

Additional inherited members

Public Functions inherited from Wombat::MamaBasicSubscription

  Name
virtual ~MamaBasicSubscription()
  MamaBasicSubscription(void )
virtual void createBasic(MamaTransport * transport, MamaQueue * queue, MamaBasicSubscriptionCallback * callback, const char * topic, void * closure =NULL)
virtual void createBasic(MamaTransport * transport, MamaQueue * queue, MamaSubscriptionCallback * callback, const char * topic, void * closure =NULL)
virtual bool isActive(void ) const
virtual const char * getTopic(void ) const
virtual MamaTransport * getTransport(void ) const
virtual MamaBasicSubscriptionCallback * getBasicCallback(void ) const
virtual MamaQueue * getQueue(void ) const
virtual void setClosure(void * closure)
virtual void * getClosure(void ) const
virtual void setDebugLevel(MamaLogLevel level)
virtual MamaLogLevel getDebugLevel() const
virtual bool checkDebugLevel(MamaLogLevel level) const
virtual mamaSubscriptionState getState(void )

Protected Attributes inherited from Wombat::MamaBasicSubscription

  Name
void * mClosure
MamaQueue * mQueue
mamaSubscription mSubscription
MamaTransport * mTransport

Detailed Description

class Wombat::MamaSubscription;

The [MamaSubscription](classWombat_1_1MamaSubscription.html) interface represents a subscription to a topic. It provides transparent market data semantics and functionality including initial value requests, recap requests, subscription management and data quality.

Public Functions Documentation

function ~MamaSubscription

virtual ~MamaSubscription()

function MamaSubscription

MamaSubscription(
    void 
)

function setCSubscription

virtual void setCSubscription(
    mamaSubscription subscription
)

function getCSubscription

virtual mamaSubscription getCSubscription()

function setup

virtual void setup(
    MamaTransport * transport,
    MamaQueue * queue,
    MamaSubscriptionCallback * callback,
    const char * source,
    const char * symbol,
    void * closure =NULL
)

Parameters:

  • callback The callback.
  • transport The transport.
  • queue The mama queue.
  • source The data source name for the listener.
  • symbol The symbol for the listener.
  • closure The caller supplied closure.

Set up a subscription.

function setup

virtual void setup(
    MamaQueue * queue,
    MamaSubscriptionCallback * callback,
    MamaSource * source,
    const char * symbol,
    void * closure =NULL
)

Parameters:

  • queue The mama queue.
  • callback The callback.
  • source The MamaSource identifying the publisher for this symbol.
  • symbol The symbol for the listener.
  • closure The caller supplied closure.

Set up a subscription.

function activate

virtual void activate()

Activate a subscriber using the throttle queue. This method places a request to create a subscriber on the throttle queue which dispatches tasks that produce messages at a controlled rate. The rate is determined by the outbound throttle rate of the underlying [MamaTransport](classWombat_1_1MamaTransport.html).

In the event that listener creation fails as the result of an messaging related error the callback is invoked with information regarding the error.

If entitlements are enabled, and the caller is not entitled to the requested symbol, the first invocation of the callback will invoked with status “MamaMsgStatus.NOT_ENTITLED”.

As an added convenience, callers may implement the onComplete and onError members of [MamaSubscriptionCallback](classWombat_1_1MamaSubscriptionCallback.html). onComplete is invoked prior to the arrival of any initial message signalling the successful creation of the listener. onError is invoked if a TIBRV or entitlement error occurs prior to listener creation.

It is also possible for an entitlement error to occur after a listener is created. This occurs when the entitlement information is included in the initial message sent by the feed handler as is often the case.

If an error occurs during listener creation. destroy is called automatically.

function deactivate

virtual void deactivate()

Deactivate a subscriber. The subscription can be reactivated using activate().

function create

virtual void create(
    MamaTransport * transport,
    MamaQueue * queue,
    MamaSubscriptionCallback * callback,
    const char * source,
    const char * symbol,
    void * closure =NULL
)

Parameters:

  • transport The transport.
  • queue The mama queue.
  • callback The callback.
  • source The data source name for the listener.
  • symbol The symbol for the listener.
  • closure The caller supplied closure.

Set up and activate a subscriber using the throttle queue. This method is equivalent to calling setup() followed by activate().

function create

virtual void create(
    MamaQueue * queue,
    MamaSubscriptionCallback * callback,
    MamaSource * source,
    const char * symbol,
    void * closure =NULL
)

Parameters:

  • queue The mama queue.
  • callback The callback.
  • source The MamaSource identifying the publisher for this symbol.
  • symbol The symbol for the listener.
  • closure The caller supplied closure.

Set up and activate a subscriber using the throttle queue. This method is equivalent to calling setup() followed by activate().

function createSnapshot

virtual void createSnapshot(
    MamaTransport * transport,
    MamaQueue * queue,
    MamaSubscriptionCallback * callback,
    const char * source,
    const char * symbol,
    void * closure =NULL
)

Parameters:

  • transport The transport.
  • queue The mama queue.
  • callback The callback.
  • source The data source name for the listener.
  • symbol The symbol for the listener.
  • closure The caller supplied closure.

Set up and activate a snapshot subscriber using the throttle queue. This method is equivalent to calling setup() followed by setServiceLevel(MAMA_SERVICE_LEVEL_SNAPSHOT,0) followed by activate().

function setRequiresInitial

virtual void setRequiresInitial(
    bool requiresInitial
)

Parameters:

  • requiresInitial True if an initial value is required

Determines whether the subscription requires an initial value. Must be set before calling createXXX(). Default is true. Not applicable for snapshot subscriptions as they simply request an initial value.

function getRequiresInitial

virtual bool getRequiresInitial(
    void 
)

Return true if the subscription requires an initial value.

function getReceivedInitial

virtual bool getReceivedInitial(
    void 
)

Return true if the subscription has received an initial.

function setRetries

virtual void setRetries(
    int retries
)

Parameters:

  • retries The number of time to retry the initial value request.

Set the number of retries for initial value requests and recap requests. This must called before createXXX() to affect the initial value requests. Calling it after createXXX() only affects recap requests. The default is MAMA_DEFAULT_RETRIES.

function getRetries

virtual int getRetries(
    void 
)

Return the retries.

function setSubscriptionType

virtual void setSubscriptionType(
    mamaSubscriptionType type
)

Parameters:

  • type The type of subscription (normal, group, order book, etc.).

Set the subscription type. The default is normal.

function getSubscriptionType

virtual mamaSubscriptionType getSubscriptionType(
    void 
)

Return the subscription type.

function getServiceLevelOpt

virtual long getServiceLevelOpt(
    void 
)

Return the service level option.

function setServiceLevel

virtual void setServiceLevel(
    mamaServiceLevel svcLevel,
    long svcLevelOpt
)

Parameters:

  • svcLevel The service level of the subscription (real time, snapshot, etc.). The default is real time.
  • svcLevelOpt An optional argument for certain service levels.

Set the service level. This method must be invoked before createXXX().

function getServiceLevel

virtual mamaServiceLevel getServiceLevel(
    void 
)

Return the service level.

function getSymbol

virtual const char * getSymbol(
    void 
) const

Return: The topic.

Return the symbol for this subscription.

function getCallback

virtual MamaSubscriptionCallback * getCallback(
    void 
) const

function setSymbol

virtual void setSymbol(
    const char * symbol
)

Sets the symbol for this subscription. Should generally only be used for updating symbology mappings.

function getSourceDerivative

virtual const MamaSourceDerivative * getSourceDerivative(
    void 
) const

Return: The source derivative.

Return the (subscription-specific) MAMA source derivative for this subscription.

function getSourceDerivative

virtual MamaSourceDerivative * getSourceDerivative(
    void 
)

Return: The source derivative.

Return the (subscription-specific) MAMA source derivative for this subscription.

function getSource

virtual const MamaSource * getSource(
    void 
) const

Return: The source.

Return the MAMA source for this subscription.

function getSubscSource

virtual const char * getSubscSource(
    void 
) const

Return: The source.

Return the source for this subscription.

function setTimeout

virtual void setTimeout(
    double timeout
)

Parameters:

  • timeout The timeout in seconds.

Set the timeout for this subscription. The timeout is used for requesting initial values.

function getTimeout

virtual double getTimeout(
    void 
)

Return the timeout.

function setRecapTimeout

virtual void setRecapTimeout(
    double timeout
)

Parameters:

  • timeout The timeout in seconds.

Set the timeout for this subscription. The timeout is used for requesting recaps.

function getRecapTimeout

virtual double getRecapTimeout(
    void 
)

Return the recap timeout.

function setRecoverGaps

virtual void setRecoverGaps(
    bool recover
)

Parameters:

  • recover true enables recovery attempts.

Attempt to recover from sequence number gaps by requesting a recap.

function getRecoverGaps

virtual bool getRecoverGaps(
    void 
) const

Return: true if gap recover is enabled.

Returns true if listener is configure to recover from sequence number gaps by requesting a recap.

function setAppDataType

virtual void setAppDataType(
    uint8_t dataType
)

Parameters:

  • dataType The application-specific data type (e.g., market data).

Set the application data type. The default is 0.

function getAppDataType

virtual uint8_t getAppDataType() const

Return: The application-specific data type (e.g., market data).

Get the application data type. The default is 0.

function setGroupSizeHint

virtual void setGroupSizeHint(
    int groupSizeHint
)

Parameters:

  • groupSizeHint Approximate expected group size

Set a hint to the size of groups when making group subscriptions.

function setItemClosure

virtual void setItemClosure(
    void * closure
)

Set the item closure for group subscriptions.

Group subscriptions receive updates for multiple symbols. This method allows calls to set a per-symbol closure which will be passed as the fourth argument to subsequent calls to the onMsg callback. This method may only be called during the onMsg callback.

Setting the item closure for a non-group subscription provides a second closure.

function getItemClosure

virtual void * getItemClosure(
    void 
)

Get the item closure for group subscriptions. See setItemClosure. When invoked during an onMsg callback this method returns the closure for the current item in a group subscription. When invoked outside an onMsg callback, it returns the closure from the most recent callback.

function setPreInitialCacheSize

virtual void setPreInitialCacheSize(
    int cacheSize
)

Parameters:

  • cacheSize The size of the cache.

Set the number of messages to cache for each symbol before the initial value arrives. This allows the subscription to recover when the initial value arrives late (after a subsequent trade or quote already arrived).

For group subscription, a separate cache is used for each group member.

The default is 10.

function getPreInitialCacheSize

virtual int getPreInitialCacheSize(
    void 
)

Return: The cache size.

Return the initial value cache size.

function setMsgQualifierFilter

virtual void setMsgQualifierFilter(
    bool ignoreDefinitelyDuplicate,
    bool ignorePossiblyDuplicate,
    bool ignoreDefinitelyDelyaed,
    bool ignorePossiblyDelayed,
    bool ignoreOutOfSequence
)

Parameters:

Set a filter to discard messages.

function getMsgQualifierFilter

virtual void getMsgQualifierFilter(
    bool & ignoreDefinitelyDuplicate,
    bool & ignorePossiblyDuplicate,
    bool & ignoreDefinitelyDelyaed,
    bool & ignorePossiblyDelayed,
    bool & ignoreOutOfSequence
) const

Parameters:

Get the filters that discard message according to the message qualifier.

function destroy

virtual void destroy()

Reimplements: Wombat::MamaBasicSubscription::destroy

Destroy the subscription.

Destroys the underlying subscription. The subscription can be recreated via a subsequent call to create()

function destroyEx

virtual void destroyEx()

Reimplements: Wombat::MamaBasicSubscription::destroyEx

This function will destroy the subscription and can be called from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received from the MamaBasicSubscriptionCallback interface. To destroy from the dispatching thread the destroy function should be used in preference.


Updated on 2023-03-31 at 15:29:25 +0100