PLCnext API Documentation  22.9.0.33
Public Member Functions | Protected Member Functions | List of all members
Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts > Class Template Reference

Base class for a program providing dynamic ports More...

#include <DynamicPortsProgramBase.hpp>

Inheritance diagram for Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >:
Inheritance graph

Public Member Functions

 DynamicPortsProgramBase (const String &programName, TypeDomain &typeDomain)
 Constructs an ProgramBase instance. More...
 
- Public Member Functions inherited from Arp::Plc::Commons::Esm::ProgramBase
 ProgramBase (const String &programName)
 Constructs an ProgramBase instance. More...
 
virtual ~ProgramBase (void)=default
 Destructs this instance and frees all resouces. More...
 
const StringGetFullName (void) const override
 Returns the program name with full namespace. More...
 
const StringGetTaskName (void) const override
 Returns the task name in which is this program will be executed. More...
 
void SetTaskName (const String &taskNameArg) override
 Set the task name in which is this program will be executed. More...
 
void SetInitialValues (void) override
 Set the initial values of all containing variables of this program. More...
 
void AbortRequest (void) override
 Request a abort of program execution. More...
 
bool IsAbortRequested (void) const override
 Determines if this program is requested to abort. More...
 
virtual void Execute (void)=0
 Executes this program. More...
 
- Public Member Functions inherited from Arp::Plc::Commons::Esm::IProgram
 IProgram (void)=default
 Constructs an IProgram instance. More...
 
virtual ~IProgram (void)=default
 Destructs this instance and frees all resouces. More...
 

Protected Member Functions

template<typename T >
void AddPort (const String &portName, T &value, StandardAttribute standardAttributes)
 Adds a variable as dynamic port More...
 
void ReplaceProgramTypeDefinition () const
 Updates the type definition for this program in the library's TypeDomain More...
 
DynamicPortsBuilderGetDynamicPortsBuilder ()
 Returns a reference to the DynamicPortsBuilder More...
 
const DynamicPortsBuilderGetDynamicPortsBuilder () const
 Returns a constant reference to the DynamicPortsBuilder More...
 

Additional Inherited Members

- Public Types inherited from Arp::Plc::Commons::Esm::IProgram
using Ptr = std::shared_ptr< IProgram >
 Shared pointer type of IProgram. More...
 
using EventHandler = delegate< void(void)>
 The Event handler type is executed by the events Executing and Executed. More...
 
- Public Attributes inherited from Arp::Plc::Commons::Esm::IProgram
event< void > Executing
 The Executing event is invoked before this program is executed by the Execute operation. More...
 
event< void > Executed
 The Executed event is executed after this program is executed by the Execute operation. More...
 

Detailed Description

template<typename TProgram, size_t MaxNumPorts>
class Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >

Base class for a program providing dynamic ports

Dynamic ports means that the ports can be defined in the constructor of the program. The ports are defined one at a time by using the AddPort function. After defining the ports ReplaceProgramTypeDefinition must be called to replace an already existing TypeDefinition of this program type in the TypeDomain.

Parameters
TProgramType of the derived program type.
MaxNumPortsMaximum number of ports to provide

Constructor & Destructor Documentation

◆ DynamicPortsProgramBase()

template<typename TProgram , size_t MaxNumPorts>
Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::DynamicPortsProgramBase ( const String programName,
TypeDomain typeDomain 
)

Constructs an ProgramBase instance.

Parameters
programNameThe full name of the program instance.
typeDomainTypeDomain of the library including this program.

Member Function Documentation

◆ AddPort()

template<typename TProgram , size_t MaxNumPorts>
template<typename T >
void Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::AddPort ( const String portName,
T &  value,
StandardAttribute  standardAttributes 
)
protected

Adds a variable as dynamic port

Parameters
portNameName of the port
valueReference to the value of the port
standardAttributesDefinition of attribus for the port (e.g. Input, Output)

◆ GetDynamicPortsBuilder() [1/2]

template<typename TProgram , size_t MaxNumPorts>
DynamicPortsBuilder & Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::GetDynamicPortsBuilder
protected

Returns a reference to the DynamicPortsBuilder

◆ GetDynamicPortsBuilder() [2/2]

template<typename TProgram , size_t MaxNumPorts>
const DynamicPortsBuilder & Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::GetDynamicPortsBuilder
protected

Returns a constant reference to the DynamicPortsBuilder

◆ ReplaceProgramTypeDefinition()

template<typename TProgram , size_t MaxNumPorts>
void Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::ReplaceProgramTypeDefinition
protected

Updates the type definition for this program in the library's TypeDomain


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