BLPAPI C++  3.24.4
SubscriptionIterator Class Reference

#include <blpapi_session.h>

Public Member Functions

 SubscriptionIterator (Session *session)
 
 ~SubscriptionIterator ()
 
bool next ()
 
bool isValid () const
 
const char * subscriptionString () const
 
const CorrelationIdcorrelationId () const
 
Session::SubscriptionStatus subscriptionStatus () const
 
blpapi_SubscriptionIterator_thandle () const
 

Detailed Description

An iterator which steps through all the subscriptions in a Session.

The SubscriptionIterator can be used to iterate over all the active subscriptions for a Session. However, with an asynchronous Session it is possible for the set of active subscriptions to change whilst the SubscriptionIterator is being used. The SubscriptionIterator is guaranteed to never return the same subscription twice. However, the subscription the iterator points to may no longer be active. In this case the result of subscriptionStatus() will be UNSUBSCRIBED or CANCELLED.

See Component blpapi_session

Constructor & Destructor Documentation

◆ SubscriptionIterator()

SubscriptionIterator ( Session session)
explicit

Construct a forward iterator to iterate over the subscriptions of the specified session. The SubscriptionIterator is created in a state where next() must be called to advance it to the first item.

◆ ~SubscriptionIterator()

Destructor.

Member Function Documentation

◆ correlationId()

const CorrelationId & correlationId ( ) const

Returns the CorrelationId for this subscription.

◆ handle()

blpapi_SubscriptionIterator_t * handle ( ) const

◆ isValid()

bool isValid ( ) const

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

◆ next()

bool next ( )

Attempt to advance this iterator to the next subscription record. Returns true on success and false if there are no more subscriptions. After next() returns true isValid() is guaranteed to return true until the next call to next(). After next() returns false isValid() will return false.

◆ subscriptionStatus()

Session::SubscriptionStatus subscriptionStatus ( ) const

Returns the status of this subscription.

◆ subscriptionString()

const char * subscriptionString ( ) const

Returns a pointer to a null-terminated string which contains the subscription string for this subscription. The pointer returned remains valid until this SubscriptionIterator is destroyed or the underlying Session is destroyed or next() is called.


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