PLCnext API Documentation 25.6.0.37
TicFieldDefinition.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/TicBase.hpp"
10#include "Arp/Plc/Meta/Commons/Io/ChildTypeDefinition.hpp"
11#include "Arp/Plc/Meta/Commons/DataType.hpp"
12#include "Arp/Plc/Meta/Commons/BitSize.hpp"
13
14namespace Arp::Io::Commons::Configuration
15{
16
26class ARP_EXPORT TicFieldDefinition : public TicBase
27{
28public: // Impl forward declaration
29 class Impl;
30
31public: // usings
32 using Ptr = std::shared_ptr<TicFieldDefinition>;
36
37public: // construction
39
40 // canonical construction/destruction/assignment
41 TicFieldDefinition(const TicFieldDefinition& arg) = delete;
43 TicFieldDefinition& operator=(const TicFieldDefinition& arg) = delete;
45 ~TicFieldDefinition(void)override;
46
47public: // operators
48
49public: // static operations
50 static const char* GetTicElementName(void);
51
52public: // setter/getter operations
53 const String& GetFieldName()const;
54 DataType GetDataType()const;
55 const String& GetTypeName()const;
56 uint32 GetArrayElementCount()const;
57 BitSize GetOffset()const;
58
59public: // operations
60 ChildTypeDefinition CreateChildTypeDefinition()const;
61
62 bool TryReadAttribute(TicReader& reader, const String& attributeName)final;
63 bool TryCreateElement(const String& elementName, ChildPtr& result)final;
64 void OnReadEnd(void)override;
65
66public: // internal operations
67 Impl& GetImpl(void);
68 const Impl& GetImpl(void)const;
69
70private: // Impl usings
71 using Pimpl = PimplPtr<Impl>;
72
73private: // Impl fields
74 Pimpl pimpl;
75};
76
77} // 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
This class is the base class for all predefined Tic elements.
Definition: TicBase.hpp:42
This class is used to read a entity of the type 'IO:FieldDefinition' from an TIC file.
Definition: TicFieldDefinition.hpp:27
TicFieldDefinition(TicFieldDefinition &&arg) noexcept
The default move constructor.
~TicFieldDefinition(void) override
The default destructor.
TicFieldDefinition(void)
The default constructor.
TicFieldDefinition & operator=(TicFieldDefinition &&arg) noexcept
The default move-assignment operator.
This class is used to read the content of Tic files.
Definition: TicReader.hpp:24
This class represents a size of a variable
Definition: BitSize.hpp:16
This class is used to define one member of a structured data type for IO variables
Definition: ChildTypeDefinition.hpp:22
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:33
DataType
This enum represents the data type of a variable.
Definition: DataType.hpp:15