All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DefaultWorkPool.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IWorkPool.h"
7 #include "Tasks.h"
8 #include "MessageQueue.h"
9 #include "TaskWorkPool.h"
10 #include "IGlTaskContextFactory.h"
11 
12 namespace Eegeo
13 {
14  namespace Concurrency
15  {
16  namespace Tasks
17  {
18  class DefaultWorkPool : protected Eegeo::NonCopyable, public IWorkPool
19  {
20  public:
23  int numWorkers);
24  ~DefaultWorkPool();
25 
26  void Start();
27  void Stop();
28  void Shutdown();
29  void QueueWork(WorkItem* workItem);
30  void Flush();
31  TaskWorkPoolState::Values GetState() const;
32 
33  private:
36  TaskWorkPool* m_pWorkPool;
37  std::vector<TaskWorker*> m_workers;
38  IGlTaskContextFactory& m_taskContextFactory;
39  };
40  }
41  }
42 }