Twitch SDK (Internal)
chatroomnotifications.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
16 
17 namespace ttv
18 {
19  namespace chat
20  {
21  class ChatRoomNotifications;
22  }
23 }
24 
25 
26 class ttv::chat::ChatRoomNotifications : public IChatRoomNotifications, public PubSubComponent<IChatRoomNotificationsListener>
27 {
28 public:
29  using DisposerFunc = std::function<void()>;
30 
31 public:
32  ChatRoomNotifications(const std::shared_ptr<User>& user);
33 
34  // Component Overrides
35  static std::string GetComponentName() { return "ttv::chat::ChatRoomNotifications"; }
36  virtual std::string GetLoggerName() const override;
37 
38  // IChatRoomNotifications implementation
39  virtual TTV_ErrorCode Dispose() override;
40 
41  void OnTopicSubscribeStateChanged(const std::string& topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) override;
42  void OnTopicMessageReceived(const std::string& topic, const ttv::json::Value& jVal) override;
43 
44 private:
45  std::string mPubSubTopic;
47 };
uint32_t UserId
Definition: coretypes.h:22
std::function< void()> DisposerFunc
Definition: chatroomnotifications.h:29
virtual std::string GetLoggerName() const override
static std::string GetComponentName()
Definition: chatroomnotifications.h:35
Enum
Definition: pubsubclient.h:91
UserId mUserId
Definition: chatroomnotifications.h:46
Definition: ichatroomnotifications.h:25
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
void OnTopicMessageReceived(const std::string &topic, const ttv::json::Value &jVal) override
Represents a JSON value.
Definition: value.h:114
ChatRoomNotifications(const std::shared_ptr< User > &user)
std::string mPubSubTopic
Definition: chatroomnotifications.h:45
Definition: chatroomnotifications.h:26
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
virtual TTV_ErrorCode Dispose() override
void OnTopicSubscribeStateChanged(const std::string &topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) override
Definition: pubsubcomponent.h:21