CppELib 1.7.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WindowsThreadFactory.h
Go to the documentation of this file.
1#ifndef WINDOWS_OS_WRAPPER_WINDOWS_THREAD_FACTORY_H_INCLUDED
2#define WINDOWS_OS_WRAPPER_WINDOWS_THREAD_FACTORY_H_INCLUDED
3
5#include <string>
6
7namespace WindowsOSWrapper {
8
10private:
11 class WindowsThread : public StdCppOSWrapper::StdCppThreadFactory::StdCppThread {
12 private:
13 const std::unordered_map<int, int>& m_prioMap;
14 std::wstring m_threadName;
15 public:
16 WindowsThread(OSWrapper::Runnable* r, int priority, std::size_t stackSize, const char* name, const std::unordered_map<int, int>& prioMap);
17 virtual ~WindowsThread() {}
18
19 virtual void setName(const char* name);
20 virtual void setPriority(int priority);
21 };
22public:
23 explicit WindowsThreadFactory(int lowestPriority = 1, int highestPriority = 9);
25
26 void setPriorityRange(int lowestPriority, int highestPriority);
27
28private:
29 virtual int getMaxPriority() const;
30 virtual int getMinPriority() const;
31 virtual int getHighestPriority() const;
32 virtual int getLowestPriority() const;
33
34 virtual StdCppOSWrapper::StdCppThreadFactory::StdCppThread* createStdCppThread(OSWrapper::Runnable* r, int priority, std::size_t stackSize, const char* name);
35
36 int m_lowestPriority;
37 int m_highestPriority;
38 std::unordered_map<int, int> m_prioMap;
39};
40
41}
42
43#endif // WINDOWS_OS_WRAPPER_WINDOWS_THREAD_FACTORY_H_INCLUDED
Interface for implementing an active class.
Definition Runnable.h:9
Definition StdCppThreadFactory.h:15
Definition StdCppThreadFactory.h:13
Definition WindowsThreadFactory.h:9
virtual ~WindowsThreadFactory()
Definition WindowsThreadFactory.h:24
void setPriorityRange(int lowestPriority, int highestPriority)
Definition WindowsThreadFactory.cpp:58
Implementation of OSWrapper for Windows platform.
Definition WindowsEventFlagFactory.h:6