|
Twitch SDK (Internal)
|
#include <pubsubclient.h>
Classes | |
| struct | Entry |
Public Types | |
| enum | State { State::Initialized, State::ShuttingDown, State::Shutdown } |
Public Member Functions | |
| PubSubTopicListenerHelper (std::shared_ptr< PubSubClient > pubsub, std::shared_ptr< PubSubClient::ITopicListener > listener) | |
| virtual | ~PubSubTopicListenerHelper () |
| State | GetState () const |
| PubSubClient::SubscribeState::Enum | GetSubscriptionState (const std::string &topic) |
| TTV_ErrorCode | Subscribe (const std::string &topic) |
| TTV_ErrorCode | Unsubscribe (const std::string &topic) |
| bool | ContainsTopic (const std::string &topic) const |
| void | Shutdown () |
| virtual void | OnTopicSubscribeStateChanged (PubSubClient *source, const std::string &topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) override |
| virtual void | OnTopicMessageReceived (PubSubClient *source, const std::string &topic, const json::Value &msg) override |
| virtual void | OnTopicListenerRemoved (PubSubClient *source, const std::string &topic, TTV_ErrorCode ec) override |
Protected Attributes | |
| std::map< std::string, Entry > | mSubscriptionStates |
| std::shared_ptr< PubSubClient > | mPubSub |
| std::weak_ptr< PubSubClient::ITopicListener > | mListener |
| State | mState |
A helper listener proxy which makes it easier to manage subscription state.
|
strong |
| ttv::PubSubTopicListenerHelper::PubSubTopicListenerHelper | ( | std::shared_ptr< PubSubClient > | pubsub, |
| std::shared_ptr< PubSubClient::ITopicListener > | listener | ||
| ) |
|
virtual |
| bool ttv::PubSubTopicListenerHelper::ContainsTopic | ( | const std::string & | topic | ) | const |
|
inline |
| PubSubClient::SubscribeState::Enum ttv::PubSubTopicListenerHelper::GetSubscriptionState | ( | const std::string & | topic | ) |
|
overridevirtual |
Indicates the the listener is no longer going to receive topic events and the reference to the listener is removed. This is independent of topic subscription and there could be other registered topic listeners for the same topic.
Implements ttv::PubSubClient::ITopicListener.
|
overridevirtual |
Received a message on a topic.
Implements ttv::PubSubClient::ITopicListener.
|
overridevirtual |
Indicates changes to the topic subscription state on the socket. After receiving SubscribeState::Subscribed the client should resync all absolute state in order for deltas to properly apply to the local data.
Implements ttv::PubSubClient::ITopicListener.
| void ttv::PubSubTopicListenerHelper::Shutdown | ( | ) |
| TTV_ErrorCode ttv::PubSubTopicListenerHelper::Subscribe | ( | const std::string & | topic | ) |
| TTV_ErrorCode ttv::PubSubTopicListenerHelper::Unsubscribe | ( | const std::string & | topic | ) |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.13