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

Limits a Subscription's lifetime to a particular scope. More...

#include <cppwamp/subscription.hpp>

Inheritance diagram for wamp::ScopedSubscription:

Public Member Functions

 ScopedSubscription ()
 Default constructs an empty ScopedSubscription.
 
 ScopedSubscription (ScopedSubscription &&other) noexcept
 Move constructor.
 
 ScopedSubscription (Subscription subscription)
 Converting constructor taking a Subscription object to manage.
 
 ~ScopedSubscription ()
 Destructor which automatically unsubscribes the subscription.
 
ScopedSubscriptionoperator= (ScopedSubscription &&other) noexcept
 Move assignment.
 
ScopedSubscriptionoperator= (Subscription subscription)
 Assigns another Subscription to manage. More...
 
void release ()
 Releases the subscription so that it will no longer be automatically unsubscribed if the ScopedSubscription is destroyed or reassigned.
 
 ScopedSubscription (const ScopedSubscription &)=delete
 Non-copyable.
 
ScopedSubscriptionoperator= (const ScopedSubscription &)=delete
 Non-copyable.
 
- Public Member Functions inherited from wamp::Subscription
 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

Limits a Subscription's lifetime to a particular scope.

See also
Scoped Subscriptions
Subscription, Session::subscribe
Examples
examples/chat/main.cpp.

Member Function Documentation

◆ operator=()

ScopedSubscription & wamp::ScopedSubscription::operator= ( Subscription  subscription)

Assigns another Subscription to manage.

The old subscription is automatically unsubscribed.


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