Observable set of subscription symbols.
More...
#include <ObservableSubscription.hpp>
Inherited by DXPublisherObservableSubscription.
Observable set of subscription symbols.
◆ 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
-
listener | The 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
-
eventType | The 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 |
◆ 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
-
id | The subscription change listener id. |