BLPAPI C++  3.24.11
MessageIterator Class Reference

#include <blpapi_event.h>

Public Member Functions

 MessageIterator (const MessageIterator &)=delete
 
MessageIteratoroperator= (const MessageIterator &)=delete
 
 MessageIterator (const Event &event)
 
 ~MessageIterator ()
 
bool next ()
 
bool isValid () const
 
Message message (bool createClonable=false) const
 

Detailed Description

An iterator over the Message objects within an Event.

MessageIterator objects are used to process the individual Message objects in an Event received in an EventHandler, from EventQueue::nextEvent() or from Session::nextEvent().

This class is used to iterate over each message in an Event. Changes to the Event invalidate the iterator. The user must ensure that the Event this iterator is created for is not destroyed before the iterator.

See Component blpapi_event

Constructor & Destructor Documentation

◆ MessageIterator() [1/2]

MessageIterator ( const MessageIterator )
delete

◆ MessageIterator() [2/2]

MessageIterator ( const Event event)
explicit

Construct a forward iterator to iterate over the message in the specified event object. The MessageIterator is created in a state where next() must be called to advance it to the first item.

◆ ~MessageIterator()

Destructor.

Member Function Documentation

◆ isValid()

bool isValid ( ) const

Returns true if this iterator is currently positioned on a valid Message. Returns false otherwise.

◆ message()

Message message ( bool  createClonable = false) const

Returns the Message at the current position of this iterator. If the specified createClonable flag is set, the internal handle of the message returned is added a reference and the message can outlive the call to next(). If the createClonable flag is set to false, the use of message outside the scope of the iterator or after the next() call is undefined. The behavior is undefined if isValid() returns false.

◆ next()

bool next ( )

Attempts to advance this MessageIterator to the next Message in this Event. Returns true on success, and false if there are no more messages. After next() returns true, isValid() will return true until the subsequent call to next(). After next() returns false, isValid() will always returns false.

◆ operator=()

MessageIterator& operator= ( const MessageIterator )
delete

The documentation for this class was generated from the following file: