Kanzi Connect 3.9.10
kanzi::connect::SubscriptionContainer< SessionType > Class Template Reference

Container for session subscriptions within abstract service or external service adapter. More...

#include <subscription_container.hpp>

Public Member Functions

bool addSubscription (const string &identifier, SessionType session)
 Add subscription to the given session for this service.
 
vector< SessionType > findSubscribers (const string &identifier)
 Find all subscribers for the given identifier.
 
bool hasSubscriptions (const string &identifier)
 Check if the given identifier has any subscriptions.
 
vector< string > removeSubscriptions (SessionType session, const string &identifier)
 Remove subscription to the given session for this service.
 
 SubscriptionContainer ()=default
 ctor
 
 ~SubscriptionContainer ()=default
 dtor
 

Detailed Description

template<typename SessionType>
class kanzi::connect::SubscriptionContainer< SessionType >

Container for session subscriptions within abstract service or external service adapter.

Template Parameters
SessionTypeThe session object type which class uses for sessions
See also
kanzi::connect::AbstractService
kanzi::connect::ExternalServiceAdapter

Constructor & Destructor Documentation

◆ SubscriptionContainer()

template<typename SessionType >
kanzi::connect::SubscriptionContainer< SessionType >::SubscriptionContainer ( )
explicitdefault

ctor

◆ ~SubscriptionContainer()

template<typename SessionType >
kanzi::connect::SubscriptionContainer< SessionType >::~SubscriptionContainer ( )
default

dtor

Member Function Documentation

◆ addSubscription()

template<typename SessionType >
bool kanzi::connect::SubscriptionContainer< SessionType >::addSubscription ( const string & identifier,
SessionType session )
inline

Add subscription to the given session for this service.

Parameters
identifierIdentifies the subscription, what this means is implementation specific
sessionThe session to subscribe
Returns
True if the subscription was added, double subscription is not accepted

◆ findSubscribers()

template<typename SessionType >
vector< SessionType > kanzi::connect::SubscriptionContainer< SessionType >::findSubscribers ( const string & identifier)
inline

Find all subscribers for the given identifier.

Parameters
identifierIdentifies the subscriptions, what this means is implementation specific
Returns
vector listing all subscribers

◆ hasSubscriptions()

template<typename SessionType >
bool kanzi::connect::SubscriptionContainer< SessionType >::hasSubscriptions ( const string & identifier)
inline

Check if the given identifier has any subscriptions.

Parameters
identifierThe identifier to check, what this means is implementation specific
Returns
True if at least one subscriber is found

◆ removeSubscriptions()

template<typename SessionType >
vector< string > kanzi::connect::SubscriptionContainer< SessionType >::removeSubscriptions ( SessionType session,
const string & identifier )
inline

Remove subscription to the given session for this service.

Parameters
sessionThe session whose subscriptions are to be removed
identifierThe subscriptions to remove, if empty all subscriptions for the session are removed
Returns
vector containing identifiers that no longer have any subscriptions left after this call

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