PLCnext API Documentation 25.6.0.37
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Arp::Io::Commons::Configuration::TicFieldDefinition Class Reference

This class is used to read a entity of the type 'IO:FieldDefinition' from an TIC file. More...

#include <TicFieldDefinition.hpp>

Inheritance diagram for Arp::Io::Commons::Configuration::TicFieldDefinition:
Inheritance graph

Public Types

using Ptr = std::shared_ptr< TicFieldDefinition >
 
using DataType = Arp::Plc::Meta::Commons::DataType
 
using BitSize = Arp::Plc::Meta::Commons::BitSize
 
using ChildTypeDefinition = Arp::Plc::Meta::Commons::Io::ChildTypeDefinition
 
- Public Types inherited from Arp::Io::Commons::Configuration::TicBase
using Ptr = std::shared_ptr< TicBase >
 
using ChildPtr = ITicSerializable::Ptr
 
using ChildElements = std::vector< ChildPtr >
 
- Public Types inherited from Arp::Io::Commons::Configuration::ITicSerializable
using Ptr = std::shared_ptr< ITicSerializable >
 

Public Member Functions

 TicFieldDefinition (void)
 The default constructor.
 
 TicFieldDefinition (const TicFieldDefinition &arg)=delete
 
 TicFieldDefinition (TicFieldDefinition &&arg) noexcept
 The default move constructor. More...
 
TicFieldDefinitionoperator= (const TicFieldDefinition &arg)=delete
 
TicFieldDefinitionoperator= (TicFieldDefinition &&arg) noexcept
 The default move-assignment operator. More...
 
 ~TicFieldDefinition (void) override
 The default destructor.
 
const StringGetFieldName () const
 Returns the name of the field. More...
 
DataType GetDataType () const
 Returns the field data type More...
 
const StringGetTypeName () const
 Returns the type name of the struct type. Only allowed for DataType::Struct. More...
 
uint32 GetArrayElementCount () const
 Returns the array element count. Optional. More...
 
BitSize GetOffset () const
 Returns the offset of the field inside the struct definition. More...
 
ChildTypeDefinition CreateChildTypeDefinition () const
 Creates an instance of type ChildTypeDefinition More...
 
bool TryReadAttribute (TicReader &reader, const String &attributeName) final
 This operation is called every time an attribute is read. More...
 
bool TryCreateElement (const String &elementName, ChildPtr &result) final
 Factory method to create child elements. More...
 
void OnReadEnd (void) override
 Validates the content of the current element. More...
 
Impl & GetImpl (void)
 For internal use only. More...
 
const Impl & GetImpl (void) const
 
- Public Member Functions inherited from Arp::Io::Commons::Configuration::TicBase
 TicBase (const TicBase &arg)=delete
 
 TicBase (TicBase &&arg) noexcept
 Default move constructor.
 
TicBaseoperator= (const TicBase &arg)=delete
 
TicBaseoperator= (TicBase &&arg) noexcept
 Default move-assignment operator.
 
 ~TicBase (void) override
 Default destructor.
 
 TicBase (void)
 Default constructor.
 
const ChildElements & GetChildElements (void) const
 Returns all childs of this element. More...
 
void ReadTic (TicReader &reader) final
 This operation shall be implemented by all classes which should read its context from Tic files. More...
 
void WriteTic (TicWriter &writer) final
 This method is currently not implemented and should not be used. More...
 
virtual bool TryReadAttribute (TicReader &reader, const String &attributeName)
 This operation is called every time an attribute is read. More...
 
virtual bool TryCreateElement (const String &elementName, ChildPtr &result)
 Factory method to create child elements. More...
 
virtual bool TryReadCustomAttribute (TicReader &reader, const String &attributeName)
 This operation is called every time an attribute is read. More...
 
virtual bool TryCreateCustomElement (const String &elementName, ChildPtr &result)
 Factory method to create child elements. More...
 
virtual void OnReadEnd (void)
 Validates the content of the current element. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 
- Public Member Functions inherited from Arp::Io::Commons::Configuration::ITicSerializable
 ITicSerializable (void)=default
 Constructs an ITicSerializable instance.
 
 ITicSerializable (const ITicSerializable &arg)=default
 Copy constructor.
 
 ITicSerializable (ITicSerializable &&arg) noexcept=default
 Move constructor.
 
ITicSerializableoperator= (const ITicSerializable &arg)=default
 Copy-assignment operator.
 
ITicSerializableoperator= (ITicSerializable &&arg) noexcept=default
 Move-assignment operator.
 
virtual ~ITicSerializable (void)=default
 Destructs this instance and frees all resources.
 
virtual void ReadTic (TicReader &reader)=0
 This operation shall be implemented to read the content from Tic documents. More...
 
virtual void WriteTic (TicWriter &writer)=0
 This operation shall be implemented to write the content to Tic documents. More...
 

Static Public Member Functions

static const char * GetTicElementName (void)
 

Detailed Description

This class is used to read a entity of the type 'IO:FieldDefinition' from an TIC file.

The entity IO:FieldDefinition defines a field of a custom data structure. The data type can be a FDCML type or another custom type. In this case, the optional attribute 'TypeName' must be used. The offset specifies the explicit position in the data structure. The offset and the length of the data type together must be less than or equal to the length of the structure.

Constructor & Destructor Documentation

◆ TicFieldDefinition()

Arp::Io::Commons::Configuration::TicFieldDefinition::TicFieldDefinition ( TicFieldDefinition &&  arg)
defaultnoexcept

The default move constructor.

Parameters
argThe argument to move.

Member Function Documentation

◆ CreateChildTypeDefinition()

TicFieldDefinition::ChildTypeDefinition Arp::Io::Commons::Configuration::TicFieldDefinition::CreateChildTypeDefinition ( ) const

Creates an instance of type ChildTypeDefinition

Returns
Created ChildTypeDefinition

◆ GetArrayElementCount()

uint32 Arp::Io::Commons::Configuration::TicFieldDefinition::GetArrayElementCount ( ) const

Returns the array element count. Optional.

Returns
Array element count

◆ GetDataType()

TicFieldDefinition::DataType Arp::Io::Commons::Configuration::TicFieldDefinition::GetDataType ( void  ) const

Returns the field data type

Returns
data type of the field

◆ GetFieldName()

const String & Arp::Io::Commons::Configuration::TicFieldDefinition::GetFieldName ( ) const

Returns the name of the field.

Returns
Name of the field

◆ GetImpl()

const TicFieldDefinition::Impl & Arp::Io::Commons::Configuration::TicFieldDefinition::GetImpl ( void  )

For internal use only.

Returns
The impl instance.

◆ GetOffset()

TicFieldDefinition::BitSize Arp::Io::Commons::Configuration::TicFieldDefinition::GetOffset ( void  ) const

Returns the offset of the field inside the struct definition.

Returns
Field offset

◆ GetTypeName()

const String & Arp::Io::Commons::Configuration::TicFieldDefinition::GetTypeName ( ) const

Returns the type name of the struct type. Only allowed for DataType::Struct.

Bit granular data types like BitstringX are currently not supported.

Returns
Type name

◆ OnReadEnd()

void Arp::Io::Commons::Configuration::TicFieldDefinition::OnReadEnd ( void  )
overridevirtual

Validates the content of the current element.

Reimplemented from Arp::Io::Commons::Configuration::TicBase.

◆ operator=()

TicFieldDefinition & Arp::Io::Commons::Configuration::TicFieldDefinition::operator= ( TicFieldDefinition &&  arg)
defaultnoexcept

The default move-assignment operator.

Parameters
argThe argument to move.
Returns
This instance.

◆ TryCreateElement()

bool Arp::Io::Commons::Configuration::TicFieldDefinition::TryCreateElement ( const String elementName,
ChildPtr &  result 
)
finalvirtual

Factory method to create child elements.

Reimplemented from Arp::Io::Commons::Configuration::TicBase.

◆ TryReadAttribute()

bool Arp::Io::Commons::Configuration::TicFieldDefinition::TryReadAttribute ( TicReader reader,
const String attributeName 
)
finalvirtual

This operation is called every time an attribute is read.

Reimplemented from Arp::Io::Commons::Configuration::TicBase.


The documentation for this class was generated from the following files: