#include <MamaSubscription.h>
Inherits from Wombat::MamaBasicSubscription
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() |
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 |
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.
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
)
Parameters:
Set up a subscription.
virtual void setup(
MamaQueue * queue,
MamaSubscriptionCallback * callback,
MamaSource * source,
const char * symbol,
void * closure =NULL
)
Parameters:
Set up a subscription.
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.
virtual void deactivate()
Deactivate a subscriber. The subscription can be reactivated using activate().
virtual void create(
MamaTransport * transport,
MamaQueue * queue,
MamaSubscriptionCallback * callback,
const char * source,
const char * symbol,
void * closure =NULL
)
Parameters:
Set up and activate a subscriber using the throttle queue. This method is equivalent to calling setup() followed by activate().
virtual void create(
MamaQueue * queue,
MamaSubscriptionCallback * callback,
MamaSource * source,
const char * symbol,
void * closure =NULL
)
Parameters:
Set up and activate a subscriber using the throttle queue. This method is equivalent to calling setup() followed by activate().
virtual void createSnapshot(
MamaTransport * transport,
MamaQueue * queue,
MamaSubscriptionCallback * callback,
const char * source,
const char * symbol,
void * closure =NULL
)
Parameters:
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().
virtual void setRequiresInitial(
bool requiresInitial
)
Parameters:
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.
virtual bool getRequiresInitial(
void
)
Return true if the subscription requires an initial value.
virtual bool getReceivedInitial(
void
)
Return true if the subscription has received an initial.
virtual void setRetries(
int retries
)
Parameters:
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.
virtual int getRetries(
void
)
Return the retries.
virtual void setSubscriptionType(
mamaSubscriptionType type
)
Parameters:
Set the subscription type. The default is normal.
virtual mamaSubscriptionType getSubscriptionType(
void
)
Return the subscription type.
virtual long getServiceLevelOpt(
void
)
Return the service level option.
virtual void setServiceLevel(
mamaServiceLevel svcLevel,
long svcLevelOpt
)
Parameters:
Set the service level. This method must be invoked before createXXX().
virtual mamaServiceLevel getServiceLevel(
void
)
Return the service level.
virtual const char * getSymbol(
void
) const
Return: The topic.
Return the symbol for this subscription.
virtual MamaSubscriptionCallback * getCallback(
void
) const
virtual void setSymbol(
const char * symbol
)
Sets the symbol for this subscription. Should generally only be used for updating symbology mappings.
virtual const MamaSourceDerivative * getSourceDerivative(
void
) const
Return: The source derivative.
Return the (subscription-specific) MAMA source derivative for this subscription.
virtual MamaSourceDerivative * getSourceDerivative(
void
)
Return: The source derivative.
Return the (subscription-specific) MAMA source derivative for this subscription.
virtual const MamaSource * getSource(
void
) const
Return: The source.
Return the MAMA source for this subscription.
virtual const char * getSubscSource(
void
) const
Return: The source.
Return the source for this subscription.
virtual void setTimeout(
double timeout
)
Parameters:
Set the timeout for this subscription. The timeout is used for requesting initial values.
virtual double getTimeout(
void
)
Return the timeout.
virtual void setRecapTimeout(
double timeout
)
Parameters:
Set the timeout for this subscription. The timeout is used for requesting recaps.
virtual double getRecapTimeout(
void
)
Return the recap timeout.
virtual void setRecoverGaps(
bool recover
)
Parameters:
Attempt to recover from sequence number gaps by requesting a recap.
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.
virtual void setAppDataType(
uint8_t dataType
)
Parameters:
Set the application data type. The default is 0.
virtual uint8_t getAppDataType() const
Return: The application-specific data type (e.g., market data).
Get the application data type. The default is 0.
virtual void setGroupSizeHint(
int groupSizeHint
)
Parameters:
Set a hint to the size of groups when making group subscriptions.
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.
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.
virtual void setPreInitialCacheSize(
int cacheSize
)
Parameters:
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.
virtual int getPreInitialCacheSize(
void
)
Return: The cache size.
Return the initial value cache size.
virtual void setMsgQualifierFilter(
bool ignoreDefinitelyDuplicate,
bool ignorePossiblyDuplicate,
bool ignoreDefinitelyDelyaed,
bool ignorePossiblyDelayed,
bool ignoreOutOfSequence
)
Parameters:
Set a filter to discard messages.
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.
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()
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