dxFeed Graal CXX API
Loading...
Searching...
No Matches
ObservableSubscription Struct Referenceabstract

Observable set of subscription symbols. More...

#include <ObservableSubscription.hpp>

Inherited by DXPublisherObservableSubscription.

Public Member Functions

virtual bool isClosed ()=0
 
virtual std::unordered_set< EventTypeEnumgetEventTypes ()=0
 
virtual bool containsEventType (const EventTypeEnum &eventType)=0
 Returns true if this subscription contains the corresponding event type.
 
virtual std::size_t addChangeListener (std::shared_ptr< ObservableSubscriptionChangeListener > listener)=0
 Adds subscription change listener.
 
virtual void removeChangeListener (std::size_t id)=0
 Removes subscription change listener by id.
 

Detailed Description

Observable set of subscription symbols.

Member Function Documentation

◆ addChangeListener()

virtual std::size_t ObservableSubscription::addChangeListener ( std::shared_ptr< ObservableSubscriptionChangeListener > listener)
pure virtual

Adds subscription change listener.

This method does nothing if subscription is closed. Otherwise, it installs the corresponding listener and immediately invokes ObservableSubscriptionChangeListener::symbolsAdded() on the given listener while holding the lock for this subscription. This way the given listener synchronously receives existing subscription state and is synchronously notified on all changes in subscription afterwards.

Parameters
listenerThe subscription change listener.
Returns
The listener id

◆ containsEventType()

virtual bool ObservableSubscription::containsEventType ( const EventTypeEnum & eventType)
pure virtual

Returns true if this subscription contains the corresponding event type.

Parameters
eventTypeThe type of event that is checked.
Returns
true if this subscription contains the corresponding event type.
See also
getEventTypes()

◆ getEventTypes()

virtual std::unordered_set< EventTypeEnum > ObservableSubscription::getEventTypes ( )
pure virtual
Returns
a set of event types for this subscription. The resulting set cannot be modified. The observable subscription that is returned as a result of DXPublisher::getSubscription() has a singleton set of event types.

◆ isClosed()

virtual bool ObservableSubscription::isClosed ( )
pure virtual
Returns
true if this subscription is closed. The observable subscription that is returned as a result of DXPublisher::getSubscription() is closed when the corresponding DXEndpoint is closed.

◆ removeChangeListener()

virtual void ObservableSubscription::removeChangeListener ( std::size_t id)
pure virtual

Removes subscription change listener by id.

This method does nothing if the listener with the given id was not installed or was already removed as subscription change listener for this subscription. Otherwise it removes the corresponding listener and immediately invokes ObservableSubscriptionChangeListener::subscriptionClosed() on the given listener while holding the lock for this subscription.

Parameters
idThe subscription change listener id.