Twitch SDK (Internal)
runcommercialtask.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 
12 
13 namespace ttv
14 {
15  namespace broadcast
16  {
17  class RunCommercialTask;
18  }
19 }
20 
21 // TODO: Add support for timebreak
22 
24 {
25 public:
26  struct Result
27  {
28  };
29 
30  typedef std::function<void(RunCommercialTask* source, TTV_ErrorCode ec, const std::shared_ptr<Result>& result)> Callback;
31 
32 public:
33  RunCommercialTask(ChannelId channelId, const std::string& authToken, Callback callback);
34 
35  virtual void OnComplete() override;
36  virtual const char* GetTaskName() const override { return "RunCommercialTask"; }
37 
38 protected:
39  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
40 
41 private:
42  std::shared_ptr<Result> mResult;
45 };
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
RunCommercialTask(ChannelId channelId, const std::string &authToken, Callback callback)
std::shared_ptr< Result > mResult
Definition: runcommercialtask.h:42
virtual const char * GetTaskName() const override
Definition: runcommercialtask.h:36
Definition: httptask.h:19
Callback mCallback
Definition: runcommercialtask.h:43
std::function< void(RunCommercialTask *source, TTV_ErrorCode ec, const std::shared_ptr< Result > &result)> Callback
Definition: runcommercialtask.h:30
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Definition: runcommercialtask.h:23
virtual void OnComplete() override
Definition: runcommercialtask.h:26
uint32_t ChannelId
Definition: coretypes.h:23
Definition: httptask.h:22
ChannelId mChannelId
Definition: runcommercialtask.h:44