PLCnext API Documentation
22.9.0.33
|
Base class for a program providing dynamic ports More...
#include <DynamicPortsProgramBase.hpp>
Public Member Functions | |
DynamicPortsProgramBase (const String &programName, TypeDomain &typeDomain) | |
Constructs an ProgramBase instance. More... | |
![]() | |
ProgramBase (const String &programName) | |
Constructs an ProgramBase instance. More... | |
virtual | ~ProgramBase (void)=default |
Destructs this instance and frees all resouces. More... | |
const String & | GetFullName (void) const override |
Returns the program name with full namespace. More... | |
const String & | GetTaskName (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... | |
![]() | |
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... | |
DynamicPortsBuilder & | GetDynamicPortsBuilder () |
Returns a reference to the DynamicPortsBuilder More... | |
const DynamicPortsBuilder & | GetDynamicPortsBuilder () const |
Returns a constant reference to the DynamicPortsBuilder More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
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.
TProgram | Type of the derived program type. |
MaxNumPorts | Maximum number of ports to provide |
Arp::Plc::Commons::Esm::DynamicPortsProgramBase< TProgram, MaxNumPorts >::DynamicPortsProgramBase | ( | const String & | programName, |
TypeDomain & | typeDomain | ||
) |
Constructs an ProgramBase instance.
programName | The full name of the program instance. |
typeDomain | TypeDomain of the library including this program. |
|
protected |
Adds a variable as dynamic port
portName | Name of the port |
value | Reference to the value of the port |
standardAttributes | Definition of attribus for the port (e.g. Input, Output) |
|
protected |
Returns a reference to the DynamicPortsBuilder
|
protected |
Returns a constant reference to the DynamicPortsBuilder
|
protected |
Updates the type definition for this program in the library's TypeDomain