PLCnext API Documentation  20.3.1.28622
ThreadSettings.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 namespace Arp { namespace System { namespace Commons { namespace Threading
9 {
10 
13 {
14 public: // construction/destruction
15 
17  ThreadSettings(void);
18 
20  ThreadSettings(const String& name, size_t priority = 0, size_t cpuAffinity = 0, size_t stackSize = 0);
21 
23  ~ThreadSettings(void) = default;
24 
25 public: // Fields
26 
29 
31  size_t Priority;
32 
36  size_t CpuAffinity;
37 
39  size_t StackSize;
40 };
41 
43 // inline methods of class ThreadSettings
45  : Name("")
46  , Priority(0)
47  , CpuAffinity(0)
48  , StackSize(0)
49 {
50 
51 }
52 
53 inline ThreadSettings::ThreadSettings(const String& name, size_t priority, size_t cpuAffinity, size_t stackSize)
54  : Name(name)
55  , Priority(priority)
56  , CpuAffinity(cpuAffinity)
57  , StackSize(stackSize)
58 {
59 }
60 
61 
62 }}}} // end of namespace Arp::System::Commons::Threading
String Name
Name for the thread.
Definition: ThreadSettings.hpp:28
size_t CpuAffinity
CPU affinity mask determine which CPU is allowed to run the thread.
Definition: ThreadSettings.hpp:36
~ThreadSettings(void)=default
Destructs this instance and frees all resources.
size_t Priority
Priority of thread.
Definition: ThreadSettings.hpp:31
Container class for adaptable thread settings.
Definition: ThreadSettings.hpp:12
Root namespace for the PLCnext API
size_t StackSize
Bytes-size of requested stack for new thread.
Definition: ThreadSettings.hpp:39
System components used by the System, Device, Plc or Io domains.
ThreadSettings(void)
Constructs an ThreadSettings instance.
Definition: ThreadSettings.hpp:44