Inhalte

Alarm Message Service: Common Interfaces

Table of Contents

Introduction

To maintain a certain flexibility, we first build a few generally valid interfaces.

Data Types

For methods that take longer than one cycle, we need a return value to see if everything is done. As always, we unify this so we can use it for everything. This will be our enumeration ExecutionState.

Enumeration ExecutionState
{attribute 'qualified_only'}
{attribute 'strict'}
{attribute 'to_string'}
TYPE ExecutionState :(
	ERROR		:= -1,
	SUCCESS		:= 0,
	IDLE		:= 1,
	BUSY		:= 2,
	ABORTED		:= 3
)INT;
END_TYPE

Interfaces

Interface ISortable
INTERFACE ISortable EXTENDS IObject
METHOD sort :ExecutionState
VAR_INPUT
	execute	:BOOL;
END_VAR
Interface IComparator
INTERFACE IComparator EXTENDS IObject
METHOD compare :ComparationResult
VAR_INPUT
	object1	:IObject;
	object2	:IObject;
END_VAR
Interface IResetable
INTERFACE IResetable EXTENDS IObject
METHOD reset
Interface IExecutable
INTERFACE IExecutable EXTENDS IObject, IResetable
METHOD execute :ExecutionState
Interface IClearable
INTERFACE IClearable EXTENDS IObject
METHOD clear
Interface IIterable
INTERFACE IIterable EXTENDS IObject
METHOD iterate :ExecutionState
VAR_INPUT
	execute	:BOOL;
END_VAR
VAR_OUTPUT
	object	:IObject;
END_VAR

Interface IIterator
INTERFACE IIterator EXTENDS IObject, IExecutable
PROPERTY iterable :IIterable
SET
Interface IRunable
INTERFACE IRunable EXTENDS IObject
METHOD run
Interface IRunableHandler
INTERFACE IRunableHandler EXTENDS IRunable
METHOD attachRunable
VAR_INPUT
	runableToAttach	:IRunable;
END_VAR