PLCnext API Documentation 25.0.2.69
ThreadConfigs.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Xml/IXmlSerializable.hpp"
9#include "Arp/System/Commons/Configuration/ThreadConfig.hpp"
10
11#include <list>
12
13namespace Arp { namespace System { namespace Commons { namespace Configuration
14{
15
16using namespace Arp::System::Commons::Xml;
17
18class ThreadConfigs : public IXmlSerializable, private Loggable<ThreadConfigs>
19{
20public: // typedefs
21 using Items = std::list<ThreadConfig>;
22
23public: // construction/destruction
25 ThreadConfigs(void) = default;
27 ThreadConfigs(const ThreadConfigs& arg) = delete;
31 ~ThreadConfigs(void) = default;
32
33public: // setter/getter operations
34 Items& GetItems();
35 bool TryGetThreadConfig(const String& threadName, ThreadConfig::ConstPtr& threadConfig)const;
36 const ThreadConfig& GetThreadConfig(const String& threadName)const;
37
38public: // operations
39 void Clear(void);
40
41public: // IXmlSerializable operations
42 void ReadXml(XmlReader& reader, XmlSerializationContext& context)override;
43 void WriteXml(XmlWriter& writer, XmlSerializationContext& context)override;
44
45private: // static fields
46 static const char* XmlElementName;
47
48private: // fields
49 Items items;
50};
51
52}}}} // end of namespace Arp::System::Commons::Configuration
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
void ReadXml(XmlReader &reader, XmlSerializationContext &context) override
ReadXML must be implemented by all classes which should read its context from xml files
Definition: ThreadConfigs.cpp:13
ThreadConfigs(void)=default
Constructs an ThreadConfigs instance.
~ThreadConfigs(void)=default
Destructs this instance and frees all resources.
ThreadConfigs(const ThreadConfigs &arg)=delete
Copy constructor.
ThreadConfigs(ThreadConfigs &&arg)=delete
Move constructor.
Derive from this class to inherit logging functionality.
Definition: Loggable.hxx:28
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