Twitch SDK (Internal)
winthread.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 
13 #include "twitchsdk/core/thread.h"
14 
15 
16 namespace std
17 {
18  class thread;
19 }
20 
21 namespace ttv
22 {
23  class WinThread;
24  class WinThreadFactory;
25 }
26 
27 
28 class ttv::WinThread : public IThread
29 {
30 public:
31  WinThread(ThreadProc threadProc, const std::string& name);
32  ~WinThread();
33 
34  virtual void Run();
35  virtual bool Joinable() const;
36  virtual void Join();
37 
38 private:
40  std::string mName;
41  std::unique_ptr<std::thread> mThread;
42 };
43 
44 
46 {
47 public:
48  virtual ~WinThreadFactory();
49 
50  virtual TTV_ErrorCode CreateThread(ThreadProc threadProc, const std::string& name, std::shared_ptr<IThread>& result);
51 };
Definition: cpp11transition.h:22
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Definition: winthread.h:45
std::unique_ptr< std::thread > mThread
Definition: winthread.h:41
std::string mName
Definition: winthread.h:40
TTV_ErrorCode CreateThread(ThreadProc threadProc, const std::string &name, std::shared_ptr< IThread > &result)
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
ThreadProc mThreadProc
Definition: winthread.h:39
std::function< void()> ThreadProc
Definition: thread.h:22
Definition: thread.h:52
Definition: thread.h:38
Definition: winthread.h:28