OpenDaVINCI  4.16.0
WIN32Thread.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32THREAD_H_
21 #define OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32THREAD_H_
22 
23 #include <memory>
24 
25 // Using c++11 standard.
26 #include <thread>
27 
29 
35 
36 namespace odcore {
37  namespace wrapper {
38  namespace WIN32Impl {
39 
40  using namespace std;
41 
48  class WIN32Thread : public Thread {
49  private:
51 
58 
59  private:
60  enum THREAD_STATE {
61  INITIALIZED,
62  RUNNING,
63  STOPPED
64  };
65 
66  private:
72  WIN32Thread(const WIN32Thread &);
73 
79  WIN32Thread& operator=(const WIN32Thread &);
80 
81  public:
82  virtual ~WIN32Thread();
83 
84  virtual bool start();
85 
86  virtual bool stop();
87 
88  virtual bool isRunning() const;
89 
90  private:
91  unique_ptr<Mutex> m_threadStateMutex;
92  THREAD_STATE m_threadState;
93 
94  Runnable &m_runnable;
95 
96  std::thread m_theThread;
97  };
98 
99  }
100  }
101 } // odcore::wrapper::WIN32Impl
102 
103 #endif /*OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32THREAD_H_*/
Definition: ConcurrencyFactoryWorker.h:42
Definition: WIN32Thread.h:48
Definition: Runnable.h:35
Definition: base/Thread.h:34
Definition: SystemLibraryProducts.h:29