sgns::subscription::Subscriber¶
#include <subscriber.hpp>
Inherits from std::enable_shared_from_this< Subscriber< Key, Type, Arguments... > >
Public Types¶
| Name | |
|---|---|
| using Key | KeyType |
| using Type | ValueType |
| using size_t | HashType |
| using uint64_t | SubscriptionSetId |
| using SubscriptionEngine< KeyType, ValueType, Arguments... > | SubscriptionEngineType |
| using std::shared_ptr< SubscriptionEngineType > | SubscriptionEnginePtr |
| using std::function< void(ValueType &, const KeyType &, const Arguments &...)> | CallbackFnType |
Public Functions¶
| Name | |
|---|---|
| template <typename... Args> |
Subscriber(SubscriptionEnginePtr & ptr, Args &&... args) |
| ~Subscriber() | |
| Subscriber(const Subscriber & ) =delete | |
| Subscriber & | operator=(const Subscriber & ) =delete |
| Subscriber(Subscriber && ) =default | |
| Subscriber & | operator=(Subscriber && ) =default |
| void | setCallback(CallbackFnType && f) |
| SubscriptionSetId | generateSubscriptionSetId() |
| void | subscribe(SubscriptionSetId id, const KeyType & key) |
| void | unsubscribe(SubscriptionSetId id, const KeyType & key) |
| void | unsubscribe(SubscriptionSetId id) |
| void | unsubscribe() |
| void | on_notify(const KeyType & key, const Arguments &... args) |
Detailed Description¶
template <typename Key ,
typename Type ,
typename... Arguments>
class sgns::subscription::Subscriber;
Template Parameters:
- Key is a type of a subscription Key.
- Type is a type of an object to receive notifications in.
- Arguments is a set of types of objects needed to construct Type.
Is a wrapper class, which provides subscription to events from SubscriptionEngine
Public Types Documentation¶
using KeyType¶
using ValueType¶
using HashType¶
using SubscriptionSetId¶
using SubscriptionEngineType¶
using sgns::subscription::Subscriber< Key, Type, Arguments >::SubscriptionEngineType =
SubscriptionEngine<KeyType, ValueType, Arguments...>;
using SubscriptionEnginePtr¶
using sgns::subscription::Subscriber< Key, Type, Arguments >::SubscriptionEnginePtr = std::shared_ptr<SubscriptionEngineType>;
using CallbackFnType¶
using sgns::subscription::Subscriber< Key, Type, Arguments >::CallbackFnType = std::function<void(ValueType&, const KeyType &, const Arguments &...)>;
Public Functions Documentation¶
function Subscriber¶
template <typename... Args>
inline explicit Subscriber(
SubscriptionEnginePtr & ptr,
Args &&... args
)
function ~Subscriber¶
Unsubscribe all
function Subscriber¶
function operator=¶
function Subscriber¶
function operator=¶
function setCallback¶
function generateSubscriptionSetId¶
function subscribe¶
Here we check first local subscriptions because of strong connection with SubscriptionEngine.
function unsubscribe¶
function unsubscribe¶
function unsubscribe¶
function on_notify¶
Updated on 2026-03-04 at 13:10:44 -0800