Classes Files

Wombat::MamdaSubscription

More…

#include <MamdaSubscription.h>

Public Functions

  Name
  MamdaSubscription()
virtual ~MamdaSubscription()
virtual MamdaSubscription * clone() const
void create(MamaQueue * queue, MamaSource * source, const char * symbol, void * closure =NULL)
void destroy()
bool isActive() const
void setSource(MamaSource * source)
void setSymbol(const char * symbol)
void setQueue(MamaQueue * queue)
void setMdDataType(mamaMdDataType mdDataType)
void setType(mamaSubscriptionType type)
void setServiceLevel(mamaServiceLevel serviceLevel, long serviceLevelOpt =0)
void setRequireInitial(bool require)
void setTimeout(double timeout)
void setRecapTimeout(double timeout)
void setRetries(int retries)
void setClosure(void * closure)
void setGroupSizeHint(int groupSizeHint)
void setMamaSubscription(MamaSubscription * subscription)
void addMsgListener(MamdaMsgListener * listener)
void addQualityListener(MamdaQualityListener * listener)
void addErrorListener(MamdaErrorListener * listener)
std::vector< MamdaMsgListener * > & getMsgListeners()
void activate()
void deactivate()
void requestRecap()
MamaSource * getSource() const
const char * getSourceName() const
const char * getSymbol() const
const char * getExchange() const
MamaTransport * getTransport() const
MamaQueue * getQueue() const
MamaSubscription * getMamaSubscription()
mamaSubscriptionType getType() const
mamaServiceLevel getServiceLevel() const
long getServiceLevelOpt() const
bool getRequireInitial() const
double getTimeout() const
double getRecapTimeout() const
int getRetries() const
void * getClosure() const
uint32_t getSeqNum() const
void setItemClosure(void * closure)
void * getItemClosure(void )
bool checkDebugLevel(MamaLogLevel level) const

Detailed Description

class Wombat::MamdaSubscription;

A MamdaSubscription is used to register interest in a particular symbol and source. A MamaSource object is required to actually activate the subscription.

Multiple listeners can be added to the MamdaSubscription. In this way, an application can make use of more than one of the specialized value added MAMDA listeners, such as MamdaTradeListener and MamdaQuoteListener.

The queue argument may be null to use Mama’s internal queue.

Public Functions Documentation

function MamdaSubscription

MamdaSubscription()

Default constructor. Use the create() method to create and activate the subscription.

function ~MamdaSubscription

virtual ~MamdaSubscription()

Destructor.

function clone

virtual MamdaSubscription * clone() const

Clone this MamdaSubscription. Allocate an inactive MamdaSubscription object that is initialized as a duplicate of this one. The purpose of this facility is to enable a “template” of a MamdaSubscription for use with many subscriptions. The following subscription attributes are copied: source, symbol, queue, subscription type, service level, requires initial and timeout.

function create

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

Create and activate a subscription. Set any subscription properties prior to calling this method.

function destroy

void destroy()

Destroy a subscription.

function isActive

bool isActive() const

Return whether subscription is active.

function setSource

void setSource(
    MamaSource * source
)

Set the data source name. Do this before calling activate().

function setSymbol

void setSymbol(
    const char * symbol
)

Set the symbol. Do this before calling activate().

function setQueue

void setQueue(
    MamaQueue * queue
)

Set the MAMA queue. Do this before calling activate().

function setMdDataType

void setMdDataType(
    mamaMdDataType mdDataType
)

Set the market data type. Do this before calling activate().

function setType

void setType(
    mamaSubscriptionType type
)

Set the subscription type. Do this before calling activate().

function setServiceLevel

void setServiceLevel(
    mamaServiceLevel serviceLevel,
    long serviceLevelOpt =0
)

Set the MAMA service level.

function setRequireInitial

void setRequireInitial(
    bool require
)

Set whether an initial value is required. Do this before calling activate().

function setTimeout

void setTimeout(
    double timeout
)

Set the subscription initial timeout (in seconds). Do this before calling activate().

function setRecapTimeout

void setRecapTimeout(
    double timeout
)

Set the subscription recap timeout (in seconds). Do this before calling activate().

function setRetries

void setRetries(
    int retries
)

Set the subscription retries. Do this before calling activate().

function setClosure

void setClosure(
    void * closure
)

Set the closure. Do this before calling activate().

function setGroupSizeHint

void setGroupSizeHint(
    int groupSizeHint
)

Set the group size hint. Do this before calling activate().

function setMamaSubscription

void setMamaSubscription(
    MamaSubscription * subscription
)

Set the MamaSubscription. This is normally done automatically.

function addMsgListener

void addMsgListener(
    MamdaMsgListener * listener
)

Add a listener for regular messages.

function addQualityListener

void addQualityListener(
    MamdaQualityListener * listener
)

Add a listener for changes in quality status.

function addErrorListener

void addErrorListener(
    MamdaErrorListener * listener
)

Add a listener for error events.

function getMsgListeners

std::vector< MamdaMsgListener * > & getMsgListeners()

Return: Vector of message listeners registered with the object.

Return the vector of message listeners.

function activate

void activate()

Activate the subscription. Until this method is invoked, no updates will be received. The parameters for the subscription should have been specified using the “set” methods.

function deactivate

void deactivate()

Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again).

This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.

function requestRecap

void requestRecap()

Deprecated. This method is now a no-op.

function getSource

MamaSource * getSource() const

Return the source. Note: When using managed subscriptions this currently returns NULL

function getSourceName

const char * getSourceName() const

Return the publisher source name.

function getSymbol

const char * getSymbol() const

Return the symbol.

function getExchange

const char * getExchange() const

Return the exchange.

function getTransport

MamaTransport * getTransport() const

Return the transport.

function getQueue

MamaQueue * getQueue() const

Return the queue.

function getMamaSubscription

MamaSubscription * getMamaSubscription()

Return the MamaSubscription object.

function getType

mamaSubscriptionType getType() const

Return the subscription type.

function getServiceLevel

mamaServiceLevel getServiceLevel() const

Return the service level.

function getServiceLevelOpt

long getServiceLevelOpt() const

Return the service level option.

function getRequireInitial

bool getRequireInitial() const

Return whether an initial is required.

function getTimeout

double getTimeout() const

Return the timeout (seconds).

function getRecapTimeout

double getRecapTimeout() const

Return the recap timeout (seconds).

function getRetries

int getRetries() const

Return the retries.

function getClosure

void * getClosure() const

Get the additional object passed as the closure to the create() method.

function getSeqNum

uint32_t getSeqNum() const

Get the message-level sequence number. This number is normally sequential although there are some exceptions. Erroneous exceptions are reported via the “quality listener” interface.

function setItemClosure

void setItemClosure(
    void * closure
)

Set the item closure for group subscriptions.

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

function getItemClosure

void * getItemClosure(
    void 
)

Get the item closure for group subscriptions.

function checkDebugLevel

bool checkDebugLevel(
    MamaLogLevel level
) const

Parameters:

  • level The debug level to check.

Return: whether the level equals or exceeds the set level for this subscription.

Return whether the debug level for this subscription equals or exceeds some level.


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