OpenMAMA C++ API
Wombat::MamaSubscriptionCallback Class Referenceabstract

The message callback interface. More...

#include <MamaSubscriptionCallback.h>

Public Member Functions

virtual ~MamaSubscriptionCallback ()
 
virtual void onCreate (MamaSubscription *subscription)=0
 Method invoked when subscription creation is complete, and before any calls to onMsg. More...
 
virtual void onError (MamaSubscription *subscription, const MamaStatus &status, const char *symbol)=0
 Invoked if an error occurs during prior to subscription creation or if the subscription receives a message for an unentitled symbol. More...
 
virtual void onGap (MamaSubscription *subscription)
 Method invoked when a sequence number gap is detected. More...
 
virtual void onDestroy (MamaSubscription *subscription)
 Method invoked when a subscription has been destroyed through destroyEx. More...
 
virtual void onRecapRequest (MamaSubscription *subscription)
 Method invoked when a recap is requested upon detecting a sequence number gap. More...
 
virtual void onMsg (MamaSubscription *subscription, MamaMsg &msg)=0
 Invoked when a message arrives. More...
 
virtual void onQuality (MamaSubscription *subscription, mamaQuality quality, const char *symbol, short cause, const void *platformInfo)=0
 Invoked when the quality of this subscription changes. More...
 
virtual void onCreate (MamaBasicSubscription *subscription)
 
virtual void onError (MamaBasicSubscription *subscription, const MamaStatus &status, const char *symbol)
 
virtual void onMsg (MamaBasicSubscription *subscription, MamaMsg &msg)
 Invoked when a message arrives. More...
 

Detailed Description

The message callback interface.

Callers provide an object implementing this interface on creating a MamaSubscription.

See also
MamaSubscription
Author
mls

Constructor & Destructor Documentation

§ ~MamaSubscriptionCallback()

virtual Wombat::MamaSubscriptionCallback::~MamaSubscriptionCallback ( )
inlinevirtual

Member Function Documentation

§ onCreate() [1/2]

virtual void Wombat::MamaSubscriptionCallback::onCreate ( MamaSubscription subscription)
pure virtual

Method invoked when subscription creation is complete, and before any calls to onMsg.

Since subscriptions are created asynchronous by throttle, this callback provides the subscription instance after the throttle processes the creation request.

Parameters
subscriptionThe subscription.

§ onError() [1/2]

virtual void Wombat::MamaSubscriptionCallback::onError ( MamaSubscription subscription,
const MamaStatus status,
const char *  symbol 
)
pure virtual

Invoked if an error occurs during prior to subscription creation or if the subscription receives a message for an unentitled symbol.

If the status is MamaMsgStatus.NOT_ENTITTLED the symbol parameter is the specific unentitled symbol. If the subscription symbol contains wildcards, the subscription may still receive messages for other entitled symbol.

Parameters
subscriptionThe subscription.
statusThe wombat error code.
symbolThe symbol for NOT_ENTITLED

§ onGap()

virtual void Wombat::MamaSubscriptionCallback::onGap ( MamaSubscription subscription)
inlinevirtual

Method invoked when a sequence number gap is detected.

At this point the topic is considered stale and the subscription will not receive further messages until the feed handler satisfies a recap request.

Parameters
subscriptionThe subscription.

§ onDestroy()

virtual void Wombat::MamaSubscriptionCallback::onDestroy ( MamaSubscription subscription)
inlinevirtual

Method invoked when a subscription has been destroyed through destroyEx.

Parameters
subscriptionThe subscription.

§ onRecapRequest()

virtual void Wombat::MamaSubscriptionCallback::onRecapRequest ( MamaSubscription subscription)
inlinevirtual

Method invoked when a recap is requested upon detecting a sequence number gap.

Parameters
subscriptionThe subscription.

§ onMsg() [1/2]

virtual void Wombat::MamaSubscriptionCallback::onMsg ( MamaSubscription subscription,
MamaMsg msg 
)
pure virtual

Invoked when a message arrives.

Parameters
subscriptionthe MamaSubscription.
msgThe MamaMsg which resulted in this callback being invoked.

§ onQuality()

virtual void Wombat::MamaSubscriptionCallback::onQuality ( MamaSubscription subscription,
mamaQuality  quality,
const char *  symbol,
short  cause,
const void *  platformInfo 
)
pure virtual

Invoked when the quality of this subscription changes.

Parameters
subscriptionThe subscription.
qualityThe new quality: one of the values in the MamaQuality class.
symbolThe symbol for this subscription.
causeThe cause of the quality event
platformInfoInfo associated with the quality event

The cause and platformInfo are supplied only by some middlewares. The information provided by platformInfo is middleware specific. The following middlewares are supported:

tibrv: provides the char* version of the tibrv advisory message.

§ onCreate() [2/2]

virtual void Wombat::MamaSubscriptionCallback::onCreate ( MamaBasicSubscription subscription)
inlinevirtual

§ onError() [2/2]

virtual void Wombat::MamaSubscriptionCallback::onError ( MamaBasicSubscription subscription,
const MamaStatus status,
const char *  symbol 
)
inlinevirtual

§ onMsg() [2/2]

virtual void Wombat::MamaSubscriptionCallback::onMsg ( MamaBasicSubscription subscription,
MamaMsg msg 
)
inlinevirtual

Invoked when a message arrives.

Parameters
subscriptionthe MamaSubscription.
msgThe TibrvMsg.