PLCnext API Documentation  22.9.0.33
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  ARP_DEPRECATED("Use constructor with parameters instead. Supply at least a thread name!")
18  ThreadSettings(void);
19 
21  ThreadSettings(const String& name, size_t priority = 0, size_t cpuAffinity = 0, size_t stackSize = 0);
22 
24  ~ThreadSettings(void) = default;
25 
26 public: // Fields
27 
30 
32  size_t Priority;
33 
37  size_t CpuAffinity;
38 
40  size_t StackSize;
41 };
42 
44 // inline methods of class ThreadSettings
46  : Name("")
47  , Priority(0)
48  , CpuAffinity(0)
49  , StackSize(0)
50 {
51 
52 }
53 
54 inline ThreadSettings::ThreadSettings(const String& name, size_t priority, size_t cpuAffinity, size_t stackSize)
55  : Name(name)
56  , Priority(priority)
57  , CpuAffinity(cpuAffinity)
58  , StackSize(stackSize)
59 {
60 }
61 
62 
63 }}}} // end of namespace Arp::System::Commons::Threading
Container class for adaptable thread settings.
Definition: ThreadSettings.hpp:13
String Name
Name for the thread.
Definition: ThreadSettings.hpp:29
~ThreadSettings(void)=default
Destructs this instance and frees all resources.
size_t CpuAffinity
CPU affinity mask determine which CPU is allowed to run the thread.
Definition: ThreadSettings.hpp:37
ThreadSettings(void)
Constructs an ThreadSettings instance.
Definition: ThreadSettings.hpp:45
size_t Priority
Priority of thread.
Definition: ThreadSettings.hpp:32
size_t StackSize
Bytes-size of requested stack for new thread.
Definition: ThreadSettings.hpp:40
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API