Namespaces

Component blpapi_event
[Package blpapi]

A component which defines events related operations. More...

Namespaces

namespace  blpapi

Detailed Description

A component which defines events related operations.

Outline
Purpose:
A component which defines events related operations
Classes:
blpapi::Event an event resulting from a subscription or request.
blpapi::EventQueue A construct to handle replies synchronously.
blpapi::MessageIterator An iterator over the Messages within an Event.
Description:
This file defines an Event. One or more Events are generated as a result of a subscription or a request. Events contain Message objects which can be accessed using a MessageIterator. This file also defines a EventQueue for handling replies synchronously.
Usage:
The following code snippet shows a how a EventQueue is used with a generateToken request. For any established session session pass an EventQueue object tokenEventQueue when calling generateToken. All Events in responses to generateToken request will be returned in tokenEventQueue.

 //...
 EventQueue tokenEventQueue;
 session->generateToken(CorrelationId(), &tokenEventQueue);


Synchronously read the response event and parse over messages using iter

 Event event = tokenEventQueue.nextEvent();
 if (event.eventType() == Event::TOKEN_STATUS) {
     MessageIterator iter(event);
     while (iter.next()) {
         Message msg = iter.message();
         //...