CppWAMP
C++11 client library for the WAMP protocol
wamp::Subscription Class Reference

Represents a pub/sub event subscription. More...

#include <cppwamp/subscription.hpp>

Inheritance diagram for wamp::Subscription:

Public Member Functions

 Subscription ()
 Constructs an empty subscription. More...
 
 Subscription (const Subscription &other)
 Copy constructor.
 
 Subscription (Subscription &&other) noexcept
 Move constructor. More...
 
 operator bool () const
 Returns false if the subscription is empty.
 
SubscriptionId id () const
 Obtains the ID number of this subscription.
 
Subscriptionoperator= (const Subscription &other)
 Copy assignment.
 
Subscriptionoperator= (Subscription &&other) noexcept
 Move assignment. More...
 
void unsubscribe () const
 Unsubscribes from the topic.
 

Detailed Description

Represents a pub/sub event subscription.

A Subscription is a lightweight object returned by the subscribe member functions of the Session family of classes. This objects allows users to unsubscribe the subscription.

It is always safe to unsubscribe via a Subscription object. If the Session or the subscription no longer exists, an unsubscribe operation effectively does nothing.

See also
ScopedSubscription, Session::subscribe

Constructor & Destructor Documentation

◆ Subscription() [1/2]

wamp::Subscription::Subscription ( )

Constructs an empty subscription.

Postcondition
!!(*this) == false

◆ Subscription() [2/2]

wamp::Subscription::Subscription ( Subscription &&  other)
noexcept

Move constructor.

Postcondition
!other == true

Member Function Documentation

◆ operator=()

Subscription & wamp::Subscription::operator= ( Subscription &&  other)
noexcept

Move assignment.

Postcondition
!other == true

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