PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::Plc::Meta::Commons::Io::PortDefinition Class Reference

This class is used to define a single IO variable or a tree if IO variables More...

#include <PortDefinition.hpp>

Public Types

using ArrayDimensions = std::vector< ArrayDimension >
 
using CustomAttributes = std::vector< CustomAttribute >
 
using Children = std::vector< PortDefinition >
 

Public Member Functions

 PortDefinition (const String &name, DataType dataType, const ArrayDimensions &arrayDimensions, StandardAttribute standardAttribute, const CustomAttributes &customAttributes, const String &bufferName, const BitSize &offset)
 Construct a PortDefinition for an IO variable, size deduced from data type More...
 
 PortDefinition (const String &name, DataType dataType, const String &typeName, const BitSize &size, const ArrayDimensions &arrayDimensions, StandardAttribute standardAttribute, const CustomAttributes &customAttributes, const String &bufferName, const BitSize &offset)
 Construct a PortDefinition for an IO variable More...
 
 PortDefinition (const String &name, const CustomAttributes &customAttributesArg, const Children &childrenArg)
 Construct a PortDefinition for a hierarchy node More...
 
 PortDefinition (const PortDefinition &arg)
 The default copy constructor.
 
 PortDefinition (PortDefinition &&arg) noexcept
 The default move constructor.
 
PortDefinitionoperator= (const PortDefinition &arg)
 THe default copy-assignment operator.
 
PortDefinitionoperator= (PortDefinition &&arg) noexcept
 The default move-assignment operator.
 
 ~PortDefinition (void)
 The default destructor.
 
String GetName () const
 Returns the name of the node More...
 
DataType GetDataType () const
 Returns the data type More...
 
String GetTypeName () const
 Returns the type name More...
 
BitSize GetSize () const
 Returns the size More...
 
ArrayDimensions GetArrayDimensions () const
 Returns the array dimensions More...
 
StandardAttribute GetStandardAttribute () const
 Returns the standard attributes More...
 
CustomAttributes GetCustomAttributes () const
 Returns the custom attributes More...
 
String GetBufferName () const
 Returns the buffer name More...
 
BitSize GetOffset () const
 Returns the offset in the buffer More...
 
const Children & GetChildren () const
 Returns the children of the node More...
 
void AddAttribute (const CustomAttribute &customAttribute)
 Adds a CustomAttribute More...
 
void AddChild (const PortDefinition &child)
 Adds a child More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class is used to define a single IO variable or a tree if IO variables

There are IO variables and hierarchy nodes. The IO variables are the leafs of the tree. Only they contain information about the data type or buffer.
Each node may contain an arbitrary number of custom attributes.
The following properties are provided for future use cases. Using them now will result in exceptions:

Constructor & Destructor Documentation

◆ PortDefinition() [1/3]

Arp::Plc::Meta::Commons::Io::PortDefinition::PortDefinition ( const String name,
DataType  dataType,
const ArrayDimensions &  arrayDimensions,
StandardAttribute  standardAttribute,
const CustomAttributes &  customAttributes,
const String bufferName,
const BitSize offset 
)

Construct a PortDefinition for an IO variable, size deduced from data type

Parameters
nameName of the node, must not be empty
dataTypeData type of the IO variable, only primitive types allowed
arrayDimensionsDimensions of the array, must be empty
standardAttributeCombination of StandardAttribute enumerators. Io is always added.
customAttributesInitial set of CustomAttributes. Attribute names must be unique.
bufferNameName of the corresponding buffer, must not be empty
offsetOffset in the buffer (BitSize)
Exceptions
ArgumentExceptionThrows on invalid parameters

◆ PortDefinition() [2/3]

Arp::Plc::Meta::Commons::Io::PortDefinition::PortDefinition ( const String name,
DataType  dataType,
const String typeName,
const BitSize size,
const ArrayDimensions &  arrayDimensions,
StandardAttribute  standardAttribute,
const CustomAttributes &  customAttributes,
const String bufferName,
const BitSize offset 
)

Construct a PortDefinition for an IO variable

Parameters
nameName of the node, must not be empty
dataTypeData type of the IO variable, only primitive types allowed
typeNameType name for complex types, must be empty
sizeSize of the one array element of variable (BitSize)
arrayDimensionsDimensions of the array, must be empty
standardAttributeCombination of StandardAttribute enumerators. Io is always added.
customAttributesInitial set of CustomAttributes. Attribute names must be unique.
bufferNameName of the corresponding buffer, must not be empty
offsetOffset in the buffer (BitSize)
Exceptions
ArgumentExceptionThrows on invalid parameters

◆ PortDefinition() [3/3]

Arp::Plc::Meta::Commons::Io::PortDefinition::PortDefinition ( const String name,
const CustomAttributes &  customAttributesArg,
const Children &  childrenArg 
)

Construct a PortDefinition for a hierarchy node

Parameters
nameName of the node, must not be empty
customAttributesArgInitial set of CustomAttributes. Attribute names must be unique.
childrenArgInitial set of children. Child names must be unique.
Exceptions
ArgumentExceptionThrows on invalid parameters

Member Function Documentation

◆ AddAttribute()

void Arp::Plc::Meta::Commons::Io::PortDefinition::AddAttribute ( const CustomAttribute customAttribute)

Adds a CustomAttribute

Parameters
customAttributeNew custom attribute. Attribute name must be unique.

◆ AddChild()

void Arp::Plc::Meta::Commons::Io::PortDefinition::AddChild ( const PortDefinition child)

Adds a child

Parameters
childNew child. Child name must be unique.
Exceptions
InvalidOperationExceptionThrows if child is added to IO variable.

◆ GetArrayDimensions()

PortDefinition::ArrayDimensions Arp::Plc::Meta::Commons::Io::PortDefinition::GetArrayDimensions ( void  ) const

Returns the array dimensions

Returns
Array dimensions, empty for hierarchy nodes

◆ GetBufferName()

String Arp::Plc::Meta::Commons::Io::PortDefinition::GetBufferName ( ) const

Returns the buffer name

Returns
Buffer name, empty for hierarchy nodes

◆ GetChildren()

const PortDefinition::Children & Arp::Plc::Meta::Commons::Io::PortDefinition::GetChildren ( ) const

Returns the children of the node

Returns
Children of the node, empty for IO variables

◆ GetCustomAttributes()

PortDefinition::CustomAttributes Arp::Plc::Meta::Commons::Io::PortDefinition::GetCustomAttributes ( ) const

Returns the custom attributes

Returns
Custom attributes

◆ GetDataType()

DataType Arp::Plc::Meta::Commons::Io::PortDefinition::GetDataType ( void  ) const

Returns the data type

Returns
Data type; Node for hierarchy nodes

◆ GetName()

String Arp::Plc::Meta::Commons::Io::PortDefinition::GetName ( void  ) const

Returns the name of the node

Returns
Name of the node

◆ GetOffset()

BitSize Arp::Plc::Meta::Commons::Io::PortDefinition::GetOffset ( void  ) const

Returns the offset in the buffer

Returns
Offset in the buffer, zero for hierarchy nodes

◆ GetSize()

BitSize Arp::Plc::Meta::Commons::Io::PortDefinition::GetSize ( void  ) const

Returns the size

Returns
Size, zero for hierarchy nodes

◆ GetStandardAttribute()

StandardAttribute Arp::Plc::Meta::Commons::Io::PortDefinition::GetStandardAttribute ( ) const

Returns the standard attributes

Returns
Standard attributes, always includes Io

◆ GetTypeName()

String Arp::Plc::Meta::Commons::Io::PortDefinition::GetTypeName ( ) const

Returns the type name

Returns
Type name for complex types; empty for hierarchy nodes

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