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()).
The following code snippet shows basic usage of OmmConsumerClient class to print recevied messages to screen.
{
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.