PLCnext API Documentation 23.6.0.37
ThreadConfig.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Commons/Xml/IXmlSerializable.hpp"
9
10namespace Arp { namespace System { namespace Commons { namespace Threading
11{
12// Forwards
13class ThreadSettings;
14}}}} // end of Arp::System::Commons::Threading
15
16namespace Arp { namespace System { namespace Commons { namespace Configuration
17{
18
19using namespace Arp::System::Commons::Xml;
20
21class ThreadConfig : public IXmlSerializable, private Loggable<ThreadConfig>
22{
23public: // typedefs
24 using ConstPtr = const ThreadConfig*;
26
27public: // construction/destruction
29 ThreadConfig(void) = default;
31 ThreadConfig(const ThreadConfig& arg) = default;
33 ThreadConfig(ThreadConfig&& arg) = default;
35 ~ThreadConfig(void) = default;
36
37public: // operations
40
41public: // setter/getter operations
42 const String& GetName()const;
43 size_t GetPriority()const;
44 size_t GetCpuAffinity()const;
45 size_t GetStackSize()const;
46
47public: // IXmlSerializable operations
48 void ReadXml(XmlReader& reader, XmlSerializationContext& context)override;
49 void WriteXml(XmlWriter& writer, XmlSerializationContext& context)override;
50
51private: // fields
52 String name;
53 size_t priority;
54 size_t cpuAffinity;
55 size_t stackSize;
56};
57
59// inline methods of class ThreadConfig
60inline const String& ThreadConfig::GetName()const
61{
62 return this->name;
63}
64
65inline size_t ThreadConfig::GetPriority()const
66{
67 return this->priority;
68}
69
70inline size_t ThreadConfig::GetCpuAffinity()const
71{
72 return this->cpuAffinity;
73}
74
75inline size_t ThreadConfig::GetStackSize()const
76{
77 return this->stackSize;
78}
79
80}}}} // end of namespace Arp::System::Commons::Configuration
ThreadConfig(const ThreadConfig &arg)=default
Copy constructor.
void ReadXml(XmlReader &reader, XmlSerializationContext &context) override
ReadXML must be implemented by all classes which should read its context from xml files
~ThreadConfig(void)=default
Destructs this instance and frees all resources.
ThreadConfig(void)=default
Constructs an ThreadConfig instance.
ThreadConfig(ThreadConfig &&arg)=default
Move constructor.
ThreadSettings CreateThreadSettings() const
Returns an ThreadSettings instance.
Container class for adaptable thread settings.
Definition: ThreadSettings.hpp:13
Interface for all classes which should be serializable for xml
Definition: IXmlSerializable.hpp:18
Class to read an XML File. Non buffered reader, can only read forward
Definition: XmlReader.hpp:25
XML context used during XML reading and writing to hold the context information
Definition: XmlSerializationContext.hpp:26
Class to write an XML File
Definition: XmlWriter.hpp:19
Namespace for classes to read XML files
Definition: ConfigHeader.hpp:12
Root namespace for the PLCnext API