PLCnext API Documentation 25.0.2.69
TicBase.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/PimplPtr.hxx"
9#include "Arp/Io/Commons/Configuration/ITicSerializable.hpp"
10
11namespace Arp::Io::Commons::Configuration
12{
13
41class ARP_EXPORT TicBase : public ITicSerializable
42{
43public: // Impl forward declaration
44 class Impl;
45
46public: // usings
47 using Ptr = std::shared_ptr<TicBase>;
48 using ChildPtr = ITicSerializable::Ptr;
49 using ChildElements = std::vector<ChildPtr>;
50
51public: // canonical construction/destruction/assignment
52 TicBase(const TicBase& arg) = delete;
53 TicBase(TicBase&& arg)noexcept;
54 TicBase& operator=(const TicBase& arg) = delete;
55 TicBase& operator=(TicBase&& arg)noexcept;
56 ~TicBase(void)override;
57
58public: // construction
59 TicBase(void);
60
61public: // setter/getter operations
62 const ChildElements& GetChildElements(void)const;
63
64public: // operations
65 void ReadTic(TicReader& reader)final;
66 void WriteTic(TicWriter& writer)final;
67
68public: // virtual operations to override
69 virtual bool TryReadAttribute(TicReader& reader, const String& attributeName);
70 virtual bool TryCreateElement(const String& elementName, ChildPtr& result);
71 virtual bool TryReadCustomAttribute(TicReader& reader, const String& attributeName);
72 virtual bool TryCreateCustomElement(const String& elementName, ChildPtr& result);
73 virtual void OnReadEnd(void);
74
75public: // Impl operations
76 Impl& GetImpl(void);
77 const Impl& GetImpl(void)const;
78
79private: // Impl usings
80 using Pimpl = PimplPtr<Impl>;
81
82private: // Impl fields
83 Pimpl pimpl;
84};
85
86} // end of namespace Arp::Io::Commons::Configuration
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Interface for all classes which should be serializable from and to Tic doccuments.
Definition: ITicSerializable.hpp:17
This class is the base class for all predefined Tic elements.
Definition: TicBase.hpp:42
TicBase(void)
Default constructor.
TicBase(TicBase &&arg) noexcept
Default move constructor.
TicBase & operator=(TicBase &&arg) noexcept
Default move-assignment operator.
~TicBase(void) override
Default destructor.
This class is used to read the content of Tic files.
Definition: TicReader.hpp:24