Twitch SDK (Internal)
chatchannelproperties.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 ChatChannelProperties;
22  }
23 }
24 
25 
26 class ttv::chat::ChatChannelProperties : public IChatChannelProperties, public PubSubComponent<IChatChannelPropertyListener>
27 {
28 public:
29  using DisposerFunc = std::function<void()>;
30 
31 public:
32  ChatChannelProperties(const std::shared_ptr<User>& user, ChannelId channelId);
33 
34  // Component Overrides
35  static std::string GetComponentName() { return "ttv::chat::ChatChannelProperties"; }
36  virtual std::string GetLoggerName() const override;
37 
38  // IChatChannelProperties 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;
46 };
Enum
Definition: pubsubclient.h:91
virtual TTV_ErrorCode Dispose() override
std::string mPubSubTopic
Definition: chatchannelproperties.h:45
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Represents a JSON value.
Definition: value.h:114
void OnTopicSubscribeStateChanged(const std::string &topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) override
Definition: ichatchannelproperties.h:25
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
ChatChannelProperties(const std::shared_ptr< User > &user, ChannelId channelId)
Definition: chatchannelproperties.h:26
std::function< void()> DisposerFunc
Definition: chatchannelproperties.h:29
uint32_t ChannelId
Definition: coretypes.h:23
virtual std::string GetLoggerName() const override
void OnTopicMessageReceived(const std::string &topic, const ttv::json::Value &jVal) override
Definition: pubsubcomponent.h:21
static std::string GetComponentName()
Definition: chatchannelproperties.h:35