#include <MamdaSubscription.h>
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 |
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.
MamdaSubscription()
Default constructor. Use the create() method to create and activate the subscription.
virtual ~MamdaSubscription()
Destructor.
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.
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.
void destroy()
Destroy a subscription.
bool isActive() const
Return whether subscription is active.
void setSource(
MamaSource * source
)
Set the data source name. Do this before calling activate().
void setSymbol(
const char * symbol
)
Set the symbol. Do this before calling activate().
void setQueue(
MamaQueue * queue
)
Set the MAMA queue. Do this before calling activate().
void setMdDataType(
mamaMdDataType mdDataType
)
Set the market data type. Do this before calling activate().
void setType(
mamaSubscriptionType type
)
Set the subscription type. Do this before calling activate().
void setServiceLevel(
mamaServiceLevel serviceLevel,
long serviceLevelOpt =0
)
Set the MAMA service level.
void setRequireInitial(
bool require
)
Set whether an initial value is required. Do this before calling activate().
void setTimeout(
double timeout
)
Set the subscription initial timeout (in seconds). Do this before calling activate().
void setRecapTimeout(
double timeout
)
Set the subscription recap timeout (in seconds). Do this before calling activate().
void setRetries(
int retries
)
Set the subscription retries. Do this before calling activate().
void setClosure(
void * closure
)
Set the closure. Do this before calling activate().
void setGroupSizeHint(
int groupSizeHint
)
Set the group size hint. Do this before calling activate().
void setMamaSubscription(
MamaSubscription * subscription
)
Set the MamaSubscription. This is normally done automatically.
void addMsgListener(
MamdaMsgListener * listener
)
Add a listener for regular messages.
void addQualityListener(
MamdaQualityListener * listener
)
Add a listener for changes in quality status.
void addErrorListener(
MamdaErrorListener * listener
)
Add a listener for error events.
std::vector< MamdaMsgListener * > & getMsgListeners()
Return: Vector of message listeners registered with the object.
Return the vector of message listeners.
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.
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.
void requestRecap()
Deprecated. This method is now a no-op.
MamaSource * getSource() const
Return the source. Note: When using managed subscriptions this currently returns NULL
const char * getSourceName() const
Return the publisher source name.
const char * getSymbol() const
Return the symbol.
const char * getExchange() const
Return the exchange.
MamaTransport * getTransport() const
Return the transport.
MamaQueue * getQueue() const
Return the queue.
MamaSubscription * getMamaSubscription()
Return the MamaSubscription object.
mamaSubscriptionType getType() const
Return the subscription type.
mamaServiceLevel getServiceLevel() const
Return the service level.
long getServiceLevelOpt() const
Return the service level option.
bool getRequireInitial() const
Return whether an initial is required.
double getTimeout() const
Return the timeout (seconds).
double getRecapTimeout() const
Return the recap timeout (seconds).
int getRetries() const
Return the retries.
void * getClosure() const
Get the additional object passed as the closure to the create() method.
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.
void setItemClosure(
void * closure
)
Set the item closure for group subscriptions.
Setting the item closure for a non-group subscription provides a second closure.
void * getItemClosure(
void
)
Get the item closure for group subscriptions.
bool checkDebugLevel(
MamaLogLevel level
) const
Parameters:
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