PLCnext API Documentation 25.0.2.69
ThreadConfig.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
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
39
40public: // setter/getter operations
41 const String& GetName()const;
42 size_t GetPriority()const;
43 size_t GetCpuAffinity()const;
44 size_t GetStackSize()const;
45
46public: // IXmlSerializable operations
47 void ReadXml(XmlReader& reader, XmlSerializationContext& context)override;
48 void WriteXml(XmlWriter& writer, XmlSerializationContext& context)override;
49
50private: // fields
51 String name;
52 size_t priority;
53 size_t cpuAffinity;
54 size_t stackSize;
55};
56
57}}}} // end of namespace Arp::System::Commons::Configuration
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
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
Definition: ThreadConfig.cpp:14
~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.
Definition: ThreadConfig.cpp:27
Derive from this class to inherit logging functionality.
Definition: Loggable.hxx:28
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:27
Class to write an XML File
Definition: XmlWriter.hpp:19
Namespace for classes to read XML files
Root namespace for the PLCnext API