EMA C++ Edition
List of all members
refinitiv::ema::access::OmmConsumerClient Class Reference

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

Callbacks

virtual void onRefreshMsg (const RefreshMsg &refreshMsg, const OmmConsumerEvent &consumerEvent)
  More...
 
virtual void onUpdateMsg (const UpdateMsg &updateMsg, const OmmConsumerEvent &consumerEvent)
  More...
 
virtual void onStatusMsg (const StatusMsg &statusMsg, const OmmConsumerEvent &consumerEvent)
  More...
 
virtual void onGenericMsg (const GenericMsg &genericMsg, const OmmConsumerEvent &consumerEvent)
  More...
 
virtual void onAckMsg (const AckMsg &ackMsg, const OmmConsumerEvent &consumerEvent)
  More...
 
virtual void onAllMsg (const Msg &msg, const OmmConsumerEvent &consumerEvent)
  More...
 
 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;
}
virtual void onRefreshMsg(const RefreshMsg &refreshMsg, const OmmConsumerEvent &consumerEvent)
virtual void onStatusMsg(const StatusMsg &statusMsg, const OmmConsumerEvent &consumerEvent)
virtual void onUpdateMsg(const UpdateMsg &updateMsg, const OmmConsumerEvent &consumerEvent)
See also
OmmConsumer, Msg, AckMsg, GenericMsg, RefreshMsg, StatusMsg, UpdateMsg

Definition at line 84 of file OmmConsumerClient.h.

Member Function Documentation

◆ onAckMsg()

virtual void refinitiv::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

◆ onAllMsg()

virtual void refinitiv::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

◆ onGenericMsg()

virtual void refinitiv::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

◆ onRefreshMsg()

virtual void refinitiv::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

◆ onStatusMsg()

virtual void refinitiv::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

◆ onUpdateMsg()

virtual void refinitiv::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