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

This class is used to read and store a single Tic port element called IO:Port. More...

#include <TicPort.hpp>

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

Public Types

using Ptr = std::shared_ptr< TicPort >
 
using ConstPtr = std::shared_ptr< const TicPort >
 
using PortDefinition = Arp::Plc::Meta::Commons::Io::PortDefinition
 
using NodeID = Arp::uint32
 
using DataType = Arp::Plc::Meta::Commons::DataType
 
using BitSize = Arp::Plc::Meta::Commons::BitSize
 
- 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

 TicPort (const TicPort &arg)=delete
 
 TicPort (TicPort &&arg) noexcept
 Default move constructor.
 
TicPortoperator= (const TicPort &arg)=delete
 
TicPortoperator= (TicPort &&arg) noexcept
 Default move-assignment operator.
 
 ~TicPort (void) override
 Default destructor.
 
 TicPort (void)
 Default constructor.
 
NodeID GetNodeID (void) const noexcept
 Returns the node ID of the TicPort. More...
 
const StringGetName (void) const noexcept
 Returns the name of the TicPort More...
 
DataType GetDataType (void) const noexcept
 Returns the DataType of the TicPort; More...
 
BitSize GetLength (void) const noexcept
 Returns the length of the TicPort More...
 
BitSize GetOffset (void) const noexcept
 Returns the offset of the TicPort More...
 
bool TryReadAttribute (TicReader &reader, const String &attributeName) final
 This operation is called every time an attribute is read, to read the attributes content. More...
 
bool TryCreateElement (const String &elementName, ChildPtr &result) final
 Factory method to create a child element. More...
 
void OnReadEnd (void) override
 Validation method. The default implementation is just empty. More...
 
PortDefinition CreatePortDefinition (const String &bufferName) const
 Creates and returns an instance of for the TicPort More...
 
Impl & GetImpl (void)
 For internal use only.
 
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)
 Returns the Tic name of this element called IO:Port. More...
 

Detailed Description

This class is used to read and store a single Tic port element called IO:Port.

This class reads the following Tic attributes by default.

To add custom attributes, the method TryReadCustomAttribute needs to be specialized by a derived class.

Member Function Documentation

◆ CreatePortDefinition()

TicPort::PortDefinition Arp::Io::Commons::Configuration::TicPort::CreatePortDefinition ( const String bufferName) const

Creates and returns an instance of for the TicPort

Returns
Created PortDefinition

◆ GetDataType()

TicPort::DataType Arp::Io::Commons::Configuration::TicPort::GetDataType ( void  ) const
noexcept

Returns the DataType of the TicPort;

Returns
DataType of TicPort

◆ GetLength()

TicPort::BitSize Arp::Io::Commons::Configuration::TicPort::GetLength ( void  ) const
noexcept

Returns the length of the TicPort

Returns
Length of the TicPort

◆ GetName()

const String & Arp::Io::Commons::Configuration::TicPort::GetName ( void  ) const
noexcept

Returns the name of the TicPort

Returns
Name of the tic port

◆ GetNodeID()

TicPort::NodeID Arp::Io::Commons::Configuration::TicPort::GetNodeID ( void  ) const
noexcept

Returns the node ID of the TicPort.

Returns
Node ID

◆ GetOffset()

TicPort::BitSize Arp::Io::Commons::Configuration::TicPort::GetOffset ( void  ) const
noexcept

Returns the offset of the TicPort

Returns
Offset of the TicPort

◆ GetTicElementName()

const char * Arp::Io::Commons::Configuration::TicPort::GetTicElementName ( void  )
static

Returns the Tic name of this element called IO:Port.

Returns
IO:Port

◆ OnReadEnd()

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

Validation method. The default implementation is just empty.

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

◆ TryCreateElement()

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

Factory method to create a child element.

Parameters
elementNameThe name of the child element to create.
resultThe new created child element.
Returns
true if element was created, otherwise false if the element should be skipped.

The default implementation returns always false.

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

◆ TryReadAttribute()

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

This operation is called every time an attribute is read, to read the attributes content.

Parameters
readerThe TicReader to read the attribute value from.
attributeNameThe name of the attribute to read.
Returns
true if the attribute value has been read, otherwise false if the attribute was skipped.

This operation reads following attributes by default:

  • NodeId
  • DataType
  • Offset
  • Length

This operation reads the value of the attribute from the given TicReader. If the containing element should not be processed, the operation returns false to skip the attribute.

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


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