PLCnext API Documentation 26.0.1.58
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) noexcept = default;
35 ~ThreadConfig(void) = default;
37 ThreadConfig& operator=(const ThreadConfig& arg) = default;
39 ThreadConfig& operator=(ThreadConfig&& arg) noexcept = default;
40
41public: // operations
43
44public: // setter/getter operations
45 const String& GetName()const;
46 size_t GetPriority()const;
47 size_t GetCpuAffinity()const;
48 size_t GetStackSize()const;
49
50public: // IXmlSerializable operations
51 void ReadXml(XmlReader& reader, XmlSerializationContext& context)override;
52 void WriteXml(XmlWriter& writer, XmlSerializationContext& context)override;
53
54private: // fields
55 String name;
56 size_t priority;
57 size_t cpuAffinity;
58 size_t stackSize;
59};
60
61}}}} // 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 & operator=(ThreadConfig &&arg) noexcept=default
Move assignment operator.
ThreadSettings CreateThreadSettings() const
Returns an ThreadSettings instance.
Definition: ThreadConfig.cpp:27
ThreadConfig & operator=(const ThreadConfig &arg)=default
Copy assignment operator.
ThreadConfig(ThreadConfig &&arg) noexcept=default
Move constructor.
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:26
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