Twitch SDK (Internal)
chatgetbitsconfigtask.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 
14 
15 namespace ttv
16 {
17  namespace chat
18  {
19  class ChatGetBitsConfigTask;
20  }
21 }
22 
23 
25 {
26 public:
27  struct Result
28  {
29  std::vector<BitsConfiguration::Action> actions;
30  };
31 
32  typedef std::function<void(ChatGetBitsConfigTask* source, TTV_ErrorCode ec, std::shared_ptr<Result> result)> Callback;
33 
34 public:
35  ChatGetBitsConfigTask(ChannelId channelId, Callback callback);
36 
37  virtual void OnComplete() override;
38 
39 protected:
40  virtual const char* GetTaskName() const override { return "ChatGetBitsConfigTask"; }
41 
42  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
43  virtual void ProcessResponse(uint statusCode, const std::vector<char>& response) override;
44 
45 private:
46  std::shared_ptr<Result> mResult;
48  ChannelId mChannelId; // A ChannelId of 0 implies a global bits configuration
49 };
ChannelId mChannelId
Definition: chatgetbitsconfigtask.h:48
virtual const char * GetTaskName() const override
Definition: chatgetbitsconfigtask.h:40
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
std::vector< BitsConfiguration::Action > actions
Sorted by increasing minBits.
Definition: chatgetbitsconfigtask.h:29
Definition: httptask.h:19
Callback mCallback
Definition: chatgetbitsconfigtask.h:47
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
virtual void OnComplete() override
std::function< void(ChatGetBitsConfigTask *source, TTV_ErrorCode ec, std::shared_ptr< Result > result)> Callback
Definition: chatgetbitsconfigtask.h:32
ChatGetBitsConfigTask(ChannelId channelId, Callback callback)
std::shared_ptr< Result > mResult
Definition: chatgetbitsconfigtask.h:46
unsigned int uint
Definition: coretypes.h:18
Definition: chatgetbitsconfigtask.h:27
uint32_t ChannelId
Definition: coretypes.h:23
Definition: chatgetbitsconfigtask.h:24
virtual void ProcessResponse(uint statusCode, const std::vector< char > &response) override
Definition: httptask.h:22