EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Protected Member Functions
thomsonreuters::ema::access::OmmConsumerClient Class Reference

OmmConsumerClient class provides callback interfaces to pass received messages. More...

Public Member Functions

Callbacks
virtual void onRefreshMsg (const RefreshMsg &refreshMsg, const OmmConsumerEvent &consumerEvent)
 
virtual void onUpdateMsg (const UpdateMsg &updateMsg, const OmmConsumerEvent &consumerEvent)
 
virtual void onStatusMsg (const StatusMsg &statusMsg, const OmmConsumerEvent &consumerEvent)
 
virtual void onGenericMsg (const GenericMsg &genericMsg, const OmmConsumerEvent &consumerEvent)
 
virtual void onAckMsg (const AckMsg &ackMsg, const OmmConsumerEvent &consumerEvent)
 
virtual void onAllMsg (const Msg &msg, const OmmConsumerEvent &consumerEvent)
 

Protected Member Functions

 OmmConsumerClient ()
 
virtual ~OmmConsumerClient ()
 

Detailed Description

Application needs to implement an application client class inheriting from OmmConsumerClient. In its own class, application needs to override callback methods it desires to use for item processing. Default empty callback methods are implemented by OmmConsumerClient class.

Application may chose to implement specific callbacks (e.g., onUpdateMsg()) or a general callback (e.g., onAllMsg()).

Remarks
Thread safety of all the methods in this class depends on the user's implementation.

The following code snippet shows basic usage of OmmConsumerClient class to print recevied messages to screen.

class AppClient : public OmmConsumerClient
{
void onRefreshMsg( const RefreshMsg& , const OmmConsumerEvent& );
void onUpdateMsg( const UpdateMsg& , const OmmConsumerEvent& );
void onStatusMsg( const StatusMsg& , const OmmConsumerEvent& );
};
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& event )
{
cout << "Handle " << event.getHandle() << endl
<< "Closure " << event.getClosure() << endl
<< refreshMsg << endl;
}
void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& event )
{
cout << "Handle " << event.getHandle() << endl
<< "Closure " << event.getClosure() << endl
<< updateMsg << endl;
}
void AppClient::onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& event )
{
cout << "Handle " << event.getHandle() << endl
<< "Closure " << event.getClosure() << endl
<< statusMsg << endl;
}
See Also
OmmConsumer, Msg, AckMsg, GenericMsg, RefreshMsg, StatusMsg, UpdateMsg

Definition at line 84 of file OmmConsumerClient.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::OmmConsumerClient::OmmConsumerClient ( )
protected
virtual thomsonreuters::ema::access::OmmConsumerClient::~OmmConsumerClient ( )
protectedvirtual

Member Function Documentation

virtual void thomsonreuters::ema::access::OmmConsumerClient::onAckMsg ( const AckMsg ackMsg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving any ack message. Application need only implement this method if a desire to process messages of type AckMsg.

Parameters
[out]ackMsgreceived ackMsg
[out]consumerEventidentifies open item for which this message is received
Returns
void
virtual void thomsonreuters::ema::access::OmmConsumerClient::onAllMsg ( const Msg msg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving any message. Application need only implement this method if a desire to process all message types.

Parameters
[out]msgreceived message
[out]consumerEventidentifies open item for which this message is received
Returns
void
virtual void thomsonreuters::ema::access::OmmConsumerClient::onGenericMsg ( const GenericMsg genericMsg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving any generic message. Application need only implement this method if a desire to process messages of type GenericMsg.

Parameters
[out]genericMsgreceived genericMsg
[out]consumerEventidentifies open item for which this message is received
Returns
void
virtual void thomsonreuters::ema::access::OmmConsumerClient::onRefreshMsg ( const RefreshMsg refreshMsg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving a refresh message. Refresh message may be a start, interim or final part.

Parameters
[out]refreshMsgreceived refreshMsg
[out]consumerEventidentifies open item for which this message is received
Returns
void
virtual void thomsonreuters::ema::access::OmmConsumerClient::onStatusMsg ( const StatusMsg statusMsg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving a status message.

Parameters
[out]statusMsgreceived statusMsg
[out]consumerEventidentifies open item for which this message is received
Returns
void
virtual void thomsonreuters::ema::access::OmmConsumerClient::onUpdateMsg ( const UpdateMsg updateMsg,
const OmmConsumerEvent consumerEvent 
)
virtual

Invoked upon receiving an update message. Update messages may be interlaced within a multiple part refresh message sequence.

Parameters
[out]updateMsgreceived updateMsg
[out]consumerEventidentifies open item for which this message is received
Returns
void