PLCnext API Documentation 25.0.2.69
|
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. | |
PortDefinition & | operator= (const PortDefinition &arg) |
THe default copy-assignment operator. | |
PortDefinition & | operator= (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 |
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:
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
name | Name of the node, must not be empty |
dataType | Data type of the IO variable, only primitive types allowed |
arrayDimensions | Dimensions of the array, must be empty |
standardAttribute | Combination of StandardAttribute enumerators. Io is always added. |
customAttributes | Initial set of CustomAttributes. Attribute names must be unique. |
bufferName | Name of the corresponding buffer, must not be empty |
offset | Offset in the buffer (BitSize) |
ArgumentException | Throws on invalid parameters |
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
name | Name of the node, must not be empty |
dataType | Data type of the IO variable, only primitive types allowed |
typeName | Type name for complex types, must be empty |
size | Size of the one array element of variable (BitSize) |
arrayDimensions | Dimensions of the array, must be empty |
standardAttribute | Combination of StandardAttribute enumerators. Io is always added. |
customAttributes | Initial set of CustomAttributes. Attribute names must be unique. |
bufferName | Name of the corresponding buffer, must not be empty |
offset | Offset in the buffer (BitSize) |
ArgumentException | Throws on invalid parameters |
Arp::Plc::Meta::Commons::Io::PortDefinition::PortDefinition | ( | const String & | name, |
const CustomAttributes & | customAttributesArg, | ||
const Children & | childrenArg | ||
) |
Construct a PortDefinition for a hierarchy node
name | Name of the node, must not be empty |
customAttributesArg | Initial set of CustomAttributes. Attribute names must be unique. |
childrenArg | Initial set of children. Child names must be unique. |
ArgumentException | Throws on invalid parameters |
void Arp::Plc::Meta::Commons::Io::PortDefinition::AddAttribute | ( | const CustomAttribute & | customAttribute | ) |
Adds a CustomAttribute
customAttribute | New custom attribute. Attribute name must be unique. |
void Arp::Plc::Meta::Commons::Io::PortDefinition::AddChild | ( | const PortDefinition & | child | ) |
Adds a child
child | New child. Child name must be unique. |
InvalidOperationException | Throws if child is added to IO variable. |
PortDefinition::ArrayDimensions Arp::Plc::Meta::Commons::Io::PortDefinition::GetArrayDimensions | ( | void | ) | const |
Returns the array dimensions
String Arp::Plc::Meta::Commons::Io::PortDefinition::GetBufferName | ( | ) | const |
Returns the buffer name
const PortDefinition::Children & Arp::Plc::Meta::Commons::Io::PortDefinition::GetChildren | ( | ) | const |
Returns the children of the node
PortDefinition::CustomAttributes Arp::Plc::Meta::Commons::Io::PortDefinition::GetCustomAttributes | ( | ) | const |
Returns the custom attributes
DataType Arp::Plc::Meta::Commons::Io::PortDefinition::GetDataType | ( | void | ) | const |
Returns the data type
String Arp::Plc::Meta::Commons::Io::PortDefinition::GetName | ( | void | ) | const |
Returns the name of the node
BitSize Arp::Plc::Meta::Commons::Io::PortDefinition::GetOffset | ( | void | ) | const |
Returns the offset in the buffer
BitSize Arp::Plc::Meta::Commons::Io::PortDefinition::GetSize | ( | void | ) | const |
Returns the size
StandardAttribute Arp::Plc::Meta::Commons::Io::PortDefinition::GetStandardAttribute | ( | ) | const |
Returns the standard attributes
String Arp::Plc::Meta::Commons::Io::PortDefinition::GetTypeName | ( | ) | const |
Returns the type name