xmsinterp  1.0
ThreadMgr.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
7 //------------------------------------------------------------------------------
8 
9 //----- Included files ---------------------------------------------------------
10 #include <vector>
11 #include <xmscore/misc/base_macros.h> // XM_DISALLOW_COPY_AND_ASSIGN
13 
14 //----- Forward declarations ---------------------------------------------------
15 
16 //----- Namespace declaration --------------------------------------------------
17 namespace xms
18 {
19 class ThreadLoop;
20 class Observer;
21 
22 //----- Constants / Enumerations -----------------------------------------------
23 
24 //----- Structs / Classes ------------------------------------------------------
27 class ThreadMgr
28 {
29 public:
30  static BSHP<ThreadMgr> New();
31  virtual ~ThreadMgr();
32 
35  virtual void SetThreadLoopClass(BSHP<ThreadLoop> a_) = 0;
38  virtual void ExplicitlySetNumThreads(int a_nThreads) = 0;
41  virtual void RunThreads(int a_nIter) = 0;
44  virtual void SetObserver(BSHP<Observer> a_prog) = 0;
47  virtual std::vector<BSHP<ThreadLoop>> Threads() = 0;
48 
49 protected:
50  ThreadMgr();
51 
52 private:
54 };
55 
56 //----- Function prototypes ----------------------------------------------------
57 
58 } // namespace xms
virtual std::vector< BSHP< ThreadLoop > > Threads()=0
XM_DISALLOW_COPY_AND_ASSIGN(ThreadMgr)
prevent copy/assign compiler generated functions
Manages a multi-threaded process.
Definition: ThreadMgr.h:27
static BSHP< ThreadMgr > New()
Creates a ThreadMgr.
Definition: ThreadMgr.cpp:105
ThreadMgr()
constructor
Definition: ThreadMgr.cpp:113
virtual void SetThreadLoopClass(BSHP< ThreadLoop > a_)=0
virtual void RunThreads(int a_nIter)=0
virtual void SetObserver(BSHP< Observer > a_prog)=0
virtual void ExplicitlySetNumThreads(int a_nThreads)=0