blob: 6eee3e1c048a766327c92445c5858ed0b1886665 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>eTrice Documentation</title>
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/metisMenu.min.css"/>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="css/prettify.css"/>
<link rel="stylesheet" type="text/css" href="css/custom.css"/>
<link rel="stylesheet" type="text/css" href="css/custom-common.css"/>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" style="padding-bottom: 2px; padding-top: 4px;" href="introduction.html"><img style="height: 100%;" src="images/logo/etrice-logo-interim.png"></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="introduction.html">Online Documentation</a></li>
<li><a href="http://www.eclipse.org/forums/eclipse.etrice">Newsgroup</a></li>
<li><a href="https://www.eclipse.org/etrice/">eTrice Home</a></li>
<li><a href="https://www.eclipse.org/etrice/download.php">Downloads</a></li>
<li><a href="https://git.eclipse.org/c/etrice/org.eclipse.etrice.git/">Git repository</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-3">
<div id="sidebar" role="navigation">
<ul class="nav metismenu" id="sidebarMenu">
<li><a href="introduction.html" aria-expanded="false">Introduction <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="introduction.html#etrice-overview" aria-expanded="false">eTrice Overview <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="introduction.html#what-is-etrice-">What is eTrice?</a></li>
<li><a href="introduction.html#reduction-of-complexity">Reduction of Complexity</a></li>
</ul>
</li>
<li><a href="introduction.html#introduction-room-language" aria-expanded="false">Introduction ROOM Language <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="introduction.html#scope-of-room">Scope of ROOM</a></li>
<li><a href="introduction.html#basic-concepts">Basic Concepts</a></li>
<li><a href="introduction.html#execution-models">Execution Models</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="tutorials.html" aria-expanded="false">Tutorials <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="tutorials.html#working-with-the-tutorials">Working with the tutorials</a></li>
<li><a href="tutorials.html#getting-started-c">Getting Started C</a></li>
<li><a href="tutorials.html#getting-started-c-">Getting Started C++</a></li>
<li><a href="tutorials.html#getting-started-java">Getting Started Java</a></li>
<li><a href="tutorials.html#tutorial-ping-pong-java-c-and-c-" aria-expanded="false">Tutorial Ping Pong Java, C and C++ <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="tutorials.html#scope">Scope</a></li>
<li><a href="tutorials.html#create-the-structure">Create the structure</a></li>
<li><a href="tutorials.html#implement-the-behavior">Implement the Behavior</a></li>
<li><a href="tutorials.html#summary">Summary</a></li>
</ul>
</li>
<li><a href="tutorials.html#troubleshooting">Troubleshooting</a></li>
</ul>
</li>
<li><a href="standalone-generators.html">Standalone Generators</a></li>
<li><a href="examples.html" aria-expanded="false">Examples <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="examples.html#the-c-examples-project" aria-expanded="false">The C examples project <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="examples.html#traffic-light-step-1">Traffic light - step 1</a></li>
<li><a href="examples.html#traffic-light-step-2">Traffic light - step 2</a></li>
<li><a href="examples.html#traffic-light-step-3">Traffic light - step 3</a></li>
<li><a href="examples.html#traffic-light-step-4">Traffic light - step 4</a></li>
<li><a href="examples.html#features">Features</a></li>
</ul>
</li>
<li><a href="examples.html#the-java-examples-project" aria-expanded="false">The Java examples project <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="examples.html#dynamic-actors-1">Dynamic Actors 1</a></li>
<li><a href="examples.html#dynamic-actors-2">Dynamic Actors 2</a></li>
<li><a href="examples.html#dynamic-actors-3">Dynamic Actors 3</a></li>
<li><a href="examples.html#dynamic-actors-4">Dynamic Actors 4</a></li>
<li><a href="examples.html#dynamic-actors-5">Dynamic Actors 5</a></li>
<li><a href="examples.html#dynamic-actors-6">Dynamic Actors 6</a></li>
<li><a href="examples.html#dynamic-actors-7">Dynamic Actors 7</a></li>
<li><a href="examples.html#dynamic-actors-8">Dynamic Actors 8</a></li>
<li><a href="examples.html#dynamic-actors-9">Dynamic Actors 9</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="room-concepts.html" aria-expanded="false">ROOM Concepts <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="room-concepts.html#actors">Actors</a></li>
<li><a href="room-concepts.html#protocols">Protocols</a></li>
<li><a href="room-concepts.html#ports">Ports</a></li>
<li><a href="room-concepts.html#dataclass">DataClass</a></li>
<li><a href="room-concepts.html#layering">Layering</a></li>
<li><a href="room-concepts.html#finite-state-machines">Finite State Machines</a></li>
</ul>
</li>
<li><a href="etrice-features.html" aria-expanded="false">eTrice Features <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#model-navigation" aria-expanded="false">Model Navigation <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#from-model-to-behavior-to-structure">From Model to Behavior to Structure</a></li>
<li><a href="etrice-features.html#model-navigation">Model Navigation</a></li>
<li><a href="etrice-features.html#navigating-behavior-diagrams">Navigating Behavior Diagrams</a></li>
<li><a href="etrice-features.html#navigating-structure-diagrams">Navigating Structure Diagrams</a></li>
</ul>
</li>
<li><a href="etrice-features.html#etrice-java-projects" aria-expanded="false">eTrice Java Projects <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#eclipse-jdt-build">Eclipse JDT Build</a></li>
<li><a href="etrice-features.html#maven-build">Maven Build</a></li>
</ul>
</li>
<li><a href="etrice-features.html#automatic-diagram-layout-with-kieler" aria-expanded="false">Automatic Diagram Layout with KIELER <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#overview">Overview</a></li>
<li><a href="etrice-features.html#performing-automatic-layout">Performing Automatic Layout</a></li>
<li><a href="etrice-features.html#layout-options">Layout Options</a></li>
<li><a href="etrice-features.html#configuring-layout-options">Configuring Layout Options</a></li>
<li><a href="etrice-features.html#special-layout-options">Special Layout Options</a></li>
<li><a href="etrice-features.html#further-references">Further References</a></li>
</ul>
</li>
<li><a href="etrice-features.html#annotations" aria-expanded="false">Annotations <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#annotation-type-definitions">Annotation Type Definitions</a></li>
<li><a href="etrice-features.html#usage-and-effect-of-the-pre-defined-annotations">Usage and Effect of the Pre-defined Annotations</a></li>
</ul>
</li>
<li><a href="etrice-features.html#enumerations">Enumerations</a></li>
<li><a href="etrice-features.html#etrice-models-and-their-relations" aria-expanded="false">eTrice Models and Their Relations <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="etrice-features.html#the-room-model">The ROOM Model</a></li>
<li><a href="etrice-features.html#the-config-model">The Config Model</a></li>
<li><a href="etrice-features.html#the-physical-model">The Physical Model</a></li>
<li><a href="etrice-features.html#the-mapping-model">The Mapping Model</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="feature-reference.html" aria-expanded="false">Feature Reference <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#roomlanguage" aria-expanded="false">ROOMLanguage <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#configmodel">ConfigModel</a></li>
<li><a href="feature-reference.html#logicalmodel" aria-expanded="false">LogicalModel <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#actorclass">ActorClass</a></li>
<li><a href="feature-reference.html#actorref">ActorRef</a></li>
<li><a href="feature-reference.html#annotation">Annotation</a></li>
<li><a href="feature-reference.html#annotationtype">AnnotationType</a></li>
<li><a href="feature-reference.html#attribute">Attribute</a></li>
<li><a href="feature-reference.html#binding">Binding</a></li>
<li><a href="feature-reference.html#communicationtype">CommunicationType</a></li>
<li><a href="feature-reference.html#dataclass">DataClass</a></li>
<li><a href="feature-reference.html#datatype">DataType</a></li>
<li><a href="feature-reference.html#enumeration">Enumeration</a></li>
<li><a href="feature-reference.html#executiontype">ExecutionType</a></li>
<li><a href="feature-reference.html#externalendport">ExternalEndPort</a></li>
<li><a href="feature-reference.html#externaltype">ExternalType</a></li>
<li><a href="feature-reference.html#inheritance">Inheritance</a></li>
<li><a href="feature-reference.html#internalendport">InternalEndPort</a></li>
<li><a href="feature-reference.html#layerconnection">LayerConnection</a></li>
<li><a href="feature-reference.html#logicalsystem">LogicalSystem</a></li>
<li><a href="feature-reference.html#operation">Operation</a></li>
<li><a href="feature-reference.html#port">Port</a></li>
<li><a href="feature-reference.html#primitivetype">PrimitiveType</a></li>
<li><a href="feature-reference.html#protocolclass">ProtocolClass</a></li>
<li><a href="feature-reference.html#relayport">RelayPort</a></li>
<li><a href="feature-reference.html#replication">Replication</a></li>
<li><a href="feature-reference.html#sap">SAP</a></li>
<li><a href="feature-reference.html#spp">SPP</a></li>
<li><a href="feature-reference.html#serviceimplementation">ServiceImplementation</a></li>
<li><a href="feature-reference.html#statemachine">StateMachine</a></li>
<li><a href="feature-reference.html#subsystemclass">SubSystemClass</a></li>
<li><a href="feature-reference.html#subsystemref">SubSystemRef</a></li>
</ul>
</li>
<li><a href="feature-reference.html#mappingmodel">MappingModel</a></li>
<li><a href="feature-reference.html#physicalmodel">PhysicalModel</a></li>
</ul>
</li>
<li><a href="feature-reference.html#modeleditors" aria-expanded="false">ModelEditors <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#graphicalbehavioreditor">GraphicalBehaviorEditor</a></li>
<li><a href="feature-reference.html#graphicalstructureeditor" aria-expanded="false">GraphicalStructureEditor <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#actorrefpropertydialog">ActorRefPropertyDialog</a></li>
<li><a href="feature-reference.html#portpropertydialog">PortPropertyDialog</a></li>
<li><a href="feature-reference.html#spppropertydialog">SPPPropertyDialog</a></li>
<li><a href="feature-reference.html#structureeditorpalette">StructureEditorPalette</a></li>
</ul>
</li>
<li><a href="feature-reference.html#textualroomeditor" aria-expanded="false">TextualROOMEditor <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#outlineview">OutlineView</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="feature-reference.html#codegenerators" aria-expanded="false">CodeGenerators <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#ccodegenerator" aria-expanded="false">CCodeGenerator <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="feature-reference.html#datalogging">DataLogging</a></li>
</ul>
</li>
<li><a href="feature-reference.html#cppcodegenerator">CPPCodeGenerator</a></li>
<li><a href="feature-reference.html#generationoptions">GenerationOptions</a></li>
<li><a href="feature-reference.html#javacodegenerator">JavaCodeGenerator</a></li>
<li><a href="feature-reference.html#msclogging">MSCLogging</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="Dave-Integration.html" aria-expanded="false">Dave Integration <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="Dave-Integration.html#dave-etrice-toolchain-tutorial" aria-expanded="false">DAVE-eTrice Toolchain Tutorial <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="Dave-Integration.html#introduction">Introduction</a></li>
<li><a href="Dave-Integration.html#getting-started-without-operating-system">Getting Started without Operating System</a></li>
<li><a href="Dave-Integration.html#getting-started-with-freertos">Getting Started with FreeRTOS</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="ResourceRequirements.html">Resource Requirements</a></li>
<li><a href="developers-reference.html" aria-expanded="false">Developer's Reference <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="developers-reference.html#etrice-tool-developer-s-reference" aria-expanded="false">eTrice Tool Developer’s Reference <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="developers-reference.html#architecture" aria-expanded="false">Architecture <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="developers-reference.html#editor-and-generator-components">Editor and Generator Components</a></li>
<li><a href="developers-reference.html#the-abstract-finite-state-machine-concept">The Abstract Finite State Machine Concept</a></li>
<li><a href="developers-reference.html#runtimes">Runtimes</a></li>
<li><a href="developers-reference.html#unit-tests">Unit Tests</a></li>
</ul>
</li>
<li><a href="developers-reference.html#component-overview" aria-expanded="false">Component Overview <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="developers-reference.html#room-language-overview">Room Language Overview</a></li>
<li><a href="developers-reference.html#config-language-overview">Config Language Overview</a></li>
<li><a href="developers-reference.html#aggregation-layer-overview">Aggregation Layer Overview</a></li>
<li><a href="developers-reference.html#generator-overview">Generator Overview</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="release-notes.html" aria-expanded="false">Release Notes <span class="fa arrow"></span></a>
<ul class="nav" aria-expanded="false">
<li><a href="release-notes.html#2-0-0-migration">2.0.0 Migration</a></li>
</ul>
</li>
</ul>
</div>
</div>
<span class="version pull-right">version 2.x</span></p>
<div class="col-sm-9">
<!-- generated by featurizer -->
<h1><a href="#roomlanguage" name="roomlanguage"></a>ROOMLanguage</h1>
<p>The Real Time Object Oriented Modeling (ROOM)</p>
<p>eTrice comprises several models:</p>
<ul>
<li>the ROOM model (*.room) – defines model classes and the logical structure of the model</li>
<li>the Config model (*.config) – defines configuration values for attributes</li>
<li>the Physical model (*.etphys) – defines the structure and properties of the physical system</li>
<li>the Mapping model (*.etmap) – defines a mapping from logical elements to physical elements</li>
</ul>
<p>In the following diagram the models and their relations are depicted. The meaning of the arrows is: uses/references.</p>
<p><img src="images/080-models.jpg" alt="Model overview"></p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
<tr>
<td><p><a href="#physicalmodel">PhysicalModel</a></p></td>
<td><p>The PhysicalModel defines the setup of your nodes with their attributes like threads and mode of execution</p></td>
</tr>
<tr>
<td><p><a href="#mappingmodel">MappingModel</a></p></td>
<td><p>The MappingModel describes the mapping of elements of the LogicalModel to elements of the PhysicalModel</p></td>
</tr>
<tr>
<td><p><a href="#configmodel">ConfigModel</a></p></td>
<td><p>The ConfigModel describes the Attribute configuration of ActorInstances and PortInstances. </p></td>
</tr>
</tbody>
</table>
<h2><a href="#configmodel" name="configmodel"></a>ConfigModel</h2>
<p>The ConfigModel describes the Attribute configuration of ActorInstances and PortInstances. </p>
<p>The scope of this model is the configuration of Attributes of the LogicalModel.<br>Thus it provides enhanced capabilities for assigning default values to Attributes, which are:</p>
<ul>
<li>type safe value assignment</li>
<li>setting on class level</li>
<li>setting on instance level</li>
</ul>
<p>Values defined for class attributes are used for all instances unless there is an instance value configured for the same attribute.<br>The configuration is available for actors and ports, thus ActorClasses/ActorRefs and ProtocolClasses/Ports.</p>
<pre><code class="etconfig customHighlighted"><span class="keyword">ConfigModel</span> ExampleConfig {
<span class="keyword">import</span> Example.* <span class="keyword">from</span> <span class="string">"Example.room"</span>
<span class="keyword">ActorClassConfig</span> ActorClass1 {
<span class="keyword">Attr</span> attribute1 = 4
}
<span class="keyword">ActorInstanceConfig</span> LogSys/subsysRef/actor1 {
<span class="keyword">Attr</span> attribute1 = 7
}
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#attribute">Attribute</a></p></td>
<td><p>An Attribute is a member variable of a class</p></td>
</tr>
</tbody>
</table>
<hr>
<h2><a href="#logicalmodel" name="logicalmodel"></a>LogicalModel</h2>
<p>The LogicalModel describes the logical structure and behavior of a ROOM application</p>
<p>The ROOM model defines DataTypes, ProtocolClasses, ActorClasses, SubSystemClasses and LogicalSystems.<br>Thereby the three latter form a hierarchy. The LogicalSystem is the top level element of the structure.<br>It contains references to SubSystemClass elements. The SubSystemClass in turn contains<br>references to ActorClass elements which again contain (recursively) references to<br>ActorClass elements. The complete structural hierarchy implies a tree which has the<br>LogicalSystem as root and where each reference stands for a new node with possibly further<br>branches.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="6" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#logicalsystem">LogicalSystem</a></p></td>
<td><p>The LogicalSystem is the topmost structural class. It assembles a distributed system by means of sub systems</p></td>
</tr>
<tr>
<td><p><a href="#subsystemclass">SubSystemClass</a></p></td>
<td><p>A SubSystem is the topmost building block of the executable part of an system</p></td>
</tr>
<tr>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
<tr>
<td><p><a href="#annotationtype">AnnotationType</a></p></td>
<td><p>AnnotationTypes can be used to tag ROOM classes for further custom processing</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#actorclass" name="actorclass"></a>ActorClass</h3>
<p>An actor is the basic structural building block for building systems with ROOM</p>
<p>An ActorClass consists of three main parts:</p>
<ul>
<li><strong>Interface</strong> (external interface) specifies the communication to ‘outside’ actors and consists of Ports.</li>
<li><strong>Structure</strong> (internal interface) contains Ports, Attributes and ActorRefs. These elements are accessible from the Behavior part of the actor (in contrary to the external interface above). An ActorClass can be composed of other actors again by declaring ActorRefs. Also this part declares the connection of ports in form of Bindings and LayerConnections.</li>
<li><strong>Behavior</strong> is described by the StateMachine. It can receive and send messages from the ports, declared in the Structure above. The Attributes can be used to store data during an state transition. Furthermore it is possible to declare Operations. They can be used to define reusable logic, that is invoked during a state transition.</li>
</ul>
<p><img src="images/040-ActorClass.png" alt="ActorClass"></p>
<pre><code class="room customHighlighted"> <span class="keyword">ActorClass</span> ExampleActorClass {
<span class="keyword">Interface</span> {
<span class="keyword">Port</span> port1: ProtocolClass1
<span class="keyword">Port</span> port4: ProtocolClass1
}
<span class="keyword">Structure</span> {
<span class="keyword">external</span> <span class="keyword">Port</span> port1
<span class="keyword">conjugated</span> <span class="keyword">Port</span> port2: ProtocolClass1
<span class="keyword">conjugated</span> <span class="keyword">Port</span> port3: ProtocolClass1
<span class="keyword">ActorRef</span> ActorRef_A: ActorClass2
<span class="keyword">ActorRef</span> ActorRef_B: ActorClass3
<span class="keyword">Binding</span> port2 <span class="keyword">and</span> ActorRef_A.port5
<span class="comment">// ...
</span> }
<span class="keyword">Behavior</span> {
<span class="comment">// ...
</span> }
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="12" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#executiontype">ExecutionType</a></p></td>
<td><p>Determines the execution type of an actor</p></td>
</tr>
<tr>
<td><p><a href="#actorref">ActorRef</a></p></td>
<td><p>An ActorRef is an instance of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#sap">SAP</a></p></td>
<td><p>A Service Access Point is similar to a Port, but uses a LayerConnection for wiring</p></td>
</tr>
<tr>
<td><p><a href="#spp">SPP</a></p></td>
<td><p>A Service Provision Point is the counterpart of a SAP</p></td>
</tr>
<tr>
<td><p><a href="#serviceimplementation">ServiceImplementation</a></p></td>
<td><p>The implementation of an Service Provision Point (SPP)</p></td>
</tr>
<tr>
<td><p><a href="#binding">Binding</a></p></td>
<td><p>A Binding connects two Ports with each other</p></td>
</tr>
<tr>
<td><p><a href="#layerconnection">LayerConnection</a></p></td>
<td><p>A LayerConnection associates a SPP to an ActorRef, resulting in an connection of all SAPs on its instance hierarchy</p></td>
</tr>
<tr>
<td><p><a href="#attribute">Attribute</a></p></td>
<td><p>An Attribute is a member variable of a class</p></td>
</tr>
<tr>
<td><p><a href="#operation">Operation</a></p></td>
<td><p>An Operation is a member function of a class</p></td>
</tr>
<tr>
<td><p><a href="#statemachine">StateMachine</a></p></td>
<td><p>A StateMachine describes the state based, event driven behavior of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#inheritance">Inheritance</a></p></td>
<td><p>A class can specify a super class and inherits elements from the super class hierarchy</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Typecasts:</p></td>
<td><p><a href="#actorref">ActorRef</a></p></td>
<td><p>An ActorRef is an instance of an ActorClass</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<hr>
<h3><a href="#actorref" name="actorref"></a>ActorRef</h3>
<p>An ActorRef is an instance of an ActorClass</p>
<ul>
<li>ActorClass: The type of the ActorRef</li>
<li>Multiplicity: The number of instances. A number greater than one can be seen as an array of instances</li>
<li>Reference Type: Can be fixed or optional. Fixed requires an integer multiplicity and results in an static instantiation with an fixed number of instances during runtime . Optional denotes an dynamic instantiation, where ActorRefs can be created in arbitrary number during runtime. In this case, the multiplicity has to be set to ’*’
</li>
</ul>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>multiplicity</p></td>
<td><p><em>1..n</em>, <em>*</em></p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#replication">Replication</a></p></td>
<td><p>Replication is mechanism for multi-instantiation for ActorRefs and Ports</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#subsystemclass">SubSystemClass</a></p></td>
<td><p>A SubSystem is the topmost building block of the executable part of an system</p></td>
</tr>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
<tr>
<td><p><a href="#actorrefpropertydialog">ActorRefPropertyDialog</a></p></td>
<td><p>A dialog to edit properties of an ActorRef.</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">SubSystemClass</span> SubSystemExample {
<span class="keyword">ActorRef</span> mainActor : ActorClassExample
<span class="keyword">LogicalThread</span> default_thread
}
<span class="keyword">ActorClass</span> ActorClassExample {
<span class="keyword">Structure</span> {
<span class="keyword">ActorRef</span> sender : Sender
<span class="keyword">ActorRef</span> receiver : Receiver
<span class="keyword">Binding</span> receiver.port <span class="keyword">and</span> sender.port
}
}
<span class="keyword">ActorClass</span> ActorClassExampleReplicated {
<span class="keyword">Structure</span> {
<span class="keyword">ActorRef</span> sender[3]: Sender
<span class="keyword">ActorRef</span> receiver[3] : Receiver
<span class="keyword">Binding</span> receiver.port <span class="keyword">and</span> sender.port
<span class="comment">/* Equivalent to:
* Binding receiver[1].port and sender[1].port
* Binding receiver[2].port and sender[2].port
* ....
*/</span>
}
}
</code></pre>
<p><img src="images/300-ActorRefInstanceDiagram.jpg" alt="ActorRef instance diagram"></p>
<p>Instance hierarchy of ActorRef Example (*System(System)* not shown in code snippet)</p>
<hr>
<h3><a href="#annotation" name="annotation"></a>Annotation</h3>
<p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p>
<p>It refers to an AnnotationType and may have to pass key value pairs. Its notation is similar to Java:</p>
<pre><code class="room customHighlighted">@AnnotationType1
@AnnotationType2(key1=<span class="string">"STRING"</span>, key2=3, ...)
</code></pre>
<p>See section Annotations for further reading.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#annotationtype">AnnotationType</a></p></td>
<td><p>AnnotationTypes can be used to tag ROOM classes for further custom processing</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="5" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalsystem">LogicalSystem</a></p></td>
<td><p>The LogicalSystem is the topmost structural class. It assembles a distributed system by means of sub systems</p></td>
</tr>
<tr>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#subsystemclass">SubSystemClass</a></p></td>
<td><p>A SubSystem is the topmost building block of the executable part of an system</p></td>
</tr>
<tr>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td><p><a href="#dataclass">DataClass</a></p></td>
<td><p>A DataClass is a composition of Attributes</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#datalogging">DataLogging</a></p></td>
<td><p>Runtime logger for data-driven Messages with primitive data.</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">import</span> room.basic.annotations.* <span class="keyword">from</span> <span class="string">"../../org.eclipse.etrice.modellib.c/model/Annotations.room"</span>
<span class="keyword">ActorClass</span> ComponentAbstraction {
<span class="keyword">Interface</span> {
<span class="keyword">conjugated</span> <span class="keyword">Port</span> port1: Protocol1
}
<span class="keyword">Structure</span> {
<span class="keyword">external</span> <span class="keyword">Port</span> port1
}
<span class="keyword">Behavior</span> {
<span class="comment">// custom/external state machine implementation
</span> @BehaviorManual
}
}
</code></pre>
<hr>
<h3><a href="#annotationtype" name="annotationtype"></a>AnnotationType</h3>
<p>AnnotationTypes can be used to tag ROOM classes for further custom processing</p>
<p>They provide the ability to associate custom properties to ROOM classes, that adjust or toogle features, like generation or the runtime behavior.<br>eTrice has some built-in annotations, which can be found in Annotations.room within the eTrice modellib.</p>
<p>See section Annotations for further reading.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Typecasts:</p></td>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#attribute" name="attribute"></a>Attribute</h3>
<p>An Attribute is a member variable of a class</p>
<p>An Attribute can be be used to store arbitrary data. There are two common conceptual purpose of use:</p>
<ul>
<li>model current system state (state machine variable)</li>
<li>store reference to more fine-grained components (e.g. c pointer to handle)</li>
</ul>
<p>Attributes can be defined in several ROOM classes.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>defaultValueLiteral</p></td>
<td><em>target code</em></td>
</tr>
<tr>
<td><p>multiplicity</p></td>
<td><em>1..n</em></td>
</tr>
<tr>
<td><p>ref</p></td>
<td></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td><p><a href="#dataclass">DataClass</a></p></td>
<td><p>A DataClass is a composition of Attributes</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#configmodel">ConfigModel</a></p></td>
<td><p>The ConfigModel describes the Attribute configuration of ActorInstances and PortInstances. </p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">import</span> room.basic.types.* <span class="keyword">from</span> <span class="string">"../../../org.eclipse.etrice.modellib.c/model/Types.room"</span>
<span class="keyword">DataClass</span> SimpleDataClass {
<span class="keyword">Attribute</span> attribute1: int16
<span class="keyword">Attribute</span> attribute2: uint32
}
<span class="keyword">ActorClass</span> ActorClassWithAttributes {
<span class="keyword">Structure</span> {
<span class="keyword">Attribute</span> attribute1: int32 [<span class="string">"attribute of a PrimitiveType"</span> ]
<span class="keyword">Attribute</span> attribute2: SimpleDataClass [ <span class="string">"attribute of a DataClass"</span> ]
}
}
<span class="keyword">ActorClass</span> ActorClassWithAttributes2 {
<span class="keyword">Structure</span> {
<span class="keyword">Attribute</span> arrayAttribute[8] : uint32 [ <span class="string">"attribute with multiplicity"</span>]
<span class="keyword">Attribute</span> refAttribue : voidType <span class="keyword">ref</span> [ <span class="string">"attribute as a reference (void pointer)"</span>]
}
}
<span class="keyword">ActorClass</span> ActorClassWithAttributeInitialization {
<span class="keyword">Structure</span> {
<span class="keyword">Attribute</span> attribute1: uint32 = <span class="string">"3"</span>
<span class="keyword">Attribute</span> attribute2: SimpleDataClass = <span class="string">"{1, 2}"</span>
<span class="keyword">Attribute</span> arrayAttribute[8] : uint32 = <span class="string">"0"</span> <span class="comment">// or {0,0,0, ...}
</span> <span class="keyword">Attribute</span> refAttribue : voidType <span class="keyword">ref</span> = <span class="string">"NULL"</span> <span class="comment">// set reference in constructor or in state machine
</span> }
}
</code></pre>
<hr>
<h3><a href="#binding" name="binding"></a>Binding</h3>
<p>A Binding connects two Ports with each other</p>
<p>In essence, a binding is a abstraction for an underlying communication channel whose function is to convey messages from one port to the other.<br>The precise semantics of these channels are not defined in the Binding. Instead, they are determined by the ProtocolClasses that are associated with the Ports at the end of the Binding.</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorClass</span> ExampleActorClass {
<span class="keyword">Structure</span> {
<span class="keyword">conjugated</span> <span class="keyword">Port</span> sender: ProtocolClass1
<span class="keyword">ActorRef</span> actorRef: ActorClass2
<span class="keyword">Binding</span> sender <span class="keyword">and</span> actorRef.receiver
}
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#port">Port</a><br> : endpoint1</p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#port">Port</a><br> : endpoint2</p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#subsystemclass">SubSystemClass</a></p></td>
<td><p>A SubSystem is the topmost building block of the executable part of an system</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#communicationtype" name="communicationtype"></a>CommunicationType</h3>
<p>The CommunicationType defines the communication semantics of a ProtocolClass</p>
<p>Since from ROOM models executable code can be generated, it is important to define the way the actors are executed and communicate with each other.<br>The combination of communication and execution is called the <em>execution model</em>. Therefore the ExecutionType of an actor and the CommunicationType of the ports has to be considered.</p>
<p>The CommunicationType of a ProtocolClass (and thus of a Port) specifies in which way the communication should happen:</p>
<ul>
<li><strong>message driven</strong> – asynchronous, non blocking, no return value: Usually the message driven communication is implemented with message queues. Message queues are inherently asynchronous and enable a very good decoupling of the communicating parties.</li>
<li><strong>data driven</strong> – asynchronous, non blocking, no return value: In data driven communication sender and receiver often have a shared block of data. The sender writes the data and the receiver polls the data.</li>
<li><em><strong>function call</strong> – synchronous, blocking, return value: Regular function call as known in most programming languages.</em> (not supported yet)</li>
</ul>
<p>CommunicationType relates with the <a href="#executiontype">ExecutionType</a> of an ActorClass, e.g. a data-driven port needs a cyclic thread, that polls the shared data.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>type</p></td>
<td><p><em>eventdriven</em>, <em>datadriven</em>, <em>sync</em></p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#executiontype">ExecutionType</a></p></td>
<td><p>Determines the execution type of an actor</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted">
<span class="keyword">import</span> room.basic.types.* <span class="keyword">from</span> <span class="string">"../../../org.eclipse.etrice.modellib.c/model/Types.room"</span>
<span class="keyword">ProtocolClass</span> EventdrivenProtocolClass1 [ <span class="string">"default is eventdriven"</span> ] {
<span class="comment">// explicit: eventdriven ProtocolClass EventdrivenProtocolClass {
</span> <span class="keyword">incoming</span> {
<span class="keyword">Message</span> msg1() [<span class="string">"message without data"</span>]
<span class="keyword">Message</span> msg2(int32) [<span class="string">"message with data"</span>]
}
<span class="keyword">outgoing</span> {
<span class="keyword">Message</span> msg4() [<span class="string">"eventdriven ProtocolClass can have message into two directions"</span>]
}
}
<span class="keyword">datadriven</span> <span class="keyword">ProtocolClass</span> DatadrivenProtocolClass {
<span class="keyword">incoming</span> {
<span class="keyword">Message</span> signal1 (int32) [<span class="string">"a datadriven message needs data"</span>]
}
<span class="comment">// datadriven ProtocolClass can only have incoming messages (signals)
</span>}
<span class="comment">// sync is not supported yet
</span><span class="comment">// sync ProtocolClass SyncProtcolClass {
</span><span class="comment">//
</span><span class="comment">// }
</span></code></pre>
<hr>
<h3><a href="#dataclass" name="dataclass"></a>DataClass</h3>
<p>A DataClass is a composition of Attributes</p>
<p>Intended to model a type that primarily consists of data, which is usually grouped together in some manner. DataClasses roughly translate to Java classes without interaction or C <em>struct</em>s.</p>
<pre><code class="room customHighlighted"><span class="keyword">DataClass</span> TCPConnectionData {
<span class="keyword">Attribute</span> IPAddr: string
<span class="keyword">Attribute</span> TcpPort: int32
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
<tr>
<td rowspan="3" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#attribute">Attribute</a></p></td>
<td><p>An Attribute is a member variable of a class</p></td>
</tr>
<tr>
<td><p><a href="#operation">Operation</a></p></td>
<td><p>An Operation is a member function of a class</p></td>
</tr>
<tr>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#inheritance">Inheritance</a></p></td>
<td><p>A class can specify a super class and inherits elements from the super class hierarchy</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<p>¦¦¦<br> ```room&lt;br/&gt; DataClass SimpleDataClass {&lt;br/&gt; Attribute attribute1: uint16&lt;br/&gt; Attribute attribute2: uint32&lt;br/&gt; }&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; DataClass DataClassExample {
Attribute attribute1: uint32
Attribute attribute2: SimpleDataClass
Attribute attribute3: voidType ref
Operation operation1(param1: uint32, param2: uint16): boolean &amp;#39;&amp;#39;&amp;#39;
return true;
&amp;#39;&amp;#39;&amp;#39;
}
```
¦¦¦
</p><hr>
<h3><a href="#datatype" name="datatype"></a>DataType</h3>
<p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" style="white-space: nowrap;"><p>Inheriting features:</p></td>
<td><p><a href="#primitivetype">PrimitiveType</a></p></td>
<td><p>A PrimitiveType is an abstraction of a target language’s basic type (e.g. integer or boolean)</p></td>
</tr>
<tr>
<td><p><a href="#enumeration">Enumeration</a></p></td>
<td><p>An EnumerationType declares an enumeration similar to most well-known languages</p></td>
</tr>
<tr>
<td><p><a href="#dataclass">DataClass</a></p></td>
<td><p>A DataClass is a composition of Attributes</p></td>
</tr>
<tr>
<td><p><a href="#externaltype">ExternalType</a></p></td>
<td><p>An ExternalType is used to make an target language type accessible in ROOM</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Typecasts:</p></td>
<td><p><a href="#attribute">Attribute</a></p></td>
<td><p>An Attribute is a member variable of a class</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#operation">Operation</a></p></td>
<td><p>An Operation is a member function of a class</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#enumeration" name="enumeration"></a>Enumeration</h3>
<p>An EnumerationType declares an enumeration similar to most well-known languages</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>literals</p></td>
<td><em>name</em></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">Enumeration</span> EOnOff {
Off = 0, <span class="comment">// explicit value=0
</span> On = 1 <span class="comment">// explicit value=1
</span>}
<span class="keyword">Enumeration</span> EDay {
SUN,
MON,
TUE,
WED,
THU,
FRI,
SAT <span class="comment">// implicit enumeration 0..6
</span>}
</code></pre>
<hr>
<h3><a href="#executiontype" name="executiontype"></a>ExecutionType</h3>
<p>Determines the execution type of an actor</p>
<p>Since from ROOM models executable code can be generated, it is important to define the way the actors are<br>executed and communicate with each other. The combination of communication and execution is called the<br><em>execution model</em>. Therefore the ExecutionType of an actor and the CommunicationType of the ports has to be considered.</p>
<p>The ExecutionType of an ActorClass specifies in which way its instance (ActorRef) should be executed:</p>
<ul>
<li><strong>execution by receive event</strong>: The message queue or the event dispatcher calls a <strong>receive event</strong> function of the message receiver and thereby executes the processing of the event.</li>
<li><strong>polled execution</strong>: The objects are processed by a cyclic <strong>execute</strong> call</li>
<li><em><strong>execution by function call</strong>: The caller executes the called object via function call</em> (not supported yet)</li>
<li><strong>mixture</strong>: An asynchronous execution combines an event dispatcher and a polled execution.</li>
</ul>
<p>Thereby the ExecutionType determines the execution mode of the actor’s logical thread:</p>
<p><img src="images/010-RoomIntroduction03.png" alt="Thread of Control"></p>
<p>The actual execution of the underlying physical thread can be specified in the PhysicalModel in conjunction with the MappingModel.</p>
<p>ExecutionType relates to the <a href="#communicationtype">CommunicationType</a>, e.g. if an actor uses data-driven ports, it should support an polled execution.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>mode</p></td>
<td><p><em>eventdriven</em>, <em>datadriven</em>, <em>async</em>, <em>sync</em></p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#communicationtype">CommunicationType</a></p></td>
<td><p>The CommunicationType defines the communication semantics of a ProtocolClass</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">eventdriven</span> <span class="keyword">ActorClass</span> EventdrivenActor [<span class="string">"default is eventdriven"</span>] {
<span class="comment">// only event-driven Ports and ActorRefs allowed
</span>}
<span class="keyword">datadriven</span> <span class="keyword">ActorClass</span> DatadrivenActor {
<span class="comment">// only data-driven Ports and ActorRefs allowed
</span>}
<span class="keyword">async</span> <span class="keyword">ActorClass</span> MixedActor{
<span class="comment">// both data/event-driven Ports and ActorRefs allowed
</span>}
</code></pre>
<hr>
<h3><a href="#externalendport" name="externalendport"></a>ExternalEndPort</h3>
<p>A ExternalEndPort is an interface Port, that is made accessible to the internal interface of an ActorClass</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorClass</span> ExternalEndPortExample {
<span class="keyword">Interface</span> {
<span class="comment">// externalEndPort is connect from 'outside' and thus needs a Binding from containing ActorClass
</span> <span class="keyword">Port</span> externalEndPort : PSimpleProtocol
}
<span class="keyword">Structure</span> {
<span class="keyword">external</span> <span class="keyword">Port</span> externalEndPort
}
<span class="keyword">Behavior</span> {
<span class="comment">// send/receive messages from externalEndPort
</span> }
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#externaltype" name="externaltype"></a>ExternalType</h3>
<p>An ExternalType is used to make an target language type accessible in ROOM</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>targetName</p></td>
<td><em>identifier name</em></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<p>¦¦¦<br> ```room&lt;br/&gt; // Include is needed when used (e.g. in ActorClassWithExternalType)&lt;br/&gt; ExternalType someStructType -&amp;gt; &amp;ldquo;struct FILE_HANDLE&amp;rdquo;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ActorClass ActorClassWithExternalType{
Structure {
usercode1 &amp;#39;&amp;#39;&amp;#39;
// #include &amp;lt;___.h&amp;gt; /* User includes here*/
&amp;#39;&amp;#39;&amp;#39;
Attribute someHandle : someStructType ref // needs include
}
Behavior {
Operation operation1(param1: charPtr) &amp;#39;&amp;#39;&amp;#39;
// external calls or casts may need includes
write(someHandle, param1);
&amp;#39;&amp;#39;&amp;#39;
}
}
```
¦¦¦
</p><hr>
<h3><a href="#inheritance" name="inheritance"></a>Inheritance</h3>
<p>A class can specify a super class and inherits elements from the super class hierarchy</p>
<p>When a ROOM class specifies a super class, it generally inherits all elements and properties.<br>In several cases, it is possible, to override these inherited elements. Generally, eTrice has two semantics of overriding: refinement and replacement.<br>Refinement is used in most cases (e.g. StateMachine) and realizes an extension of the overridden elements.<br>In this case, if a sub class overrides a piece of logic from a super class, it will always be executed subsequently to the inherited.<br>Contrary to this, replacement is applied to overridden Operations, similar to programming languages C++ and Java.</p>
<p>A formal definition of overriding is given below:</p>
<ul>
<li>early or late resolve - if element is overridden, which one should super class use by default - own or override ?</li>
<li>replacing or refinement - ignore inherited code or prepend inherited code automatically ?</li>
<li>(non-)accessible - if element is overridden, is super class’ original accessible from sub class ? e.g. super.foo()</li>
<li>implicit or explicit - does it use distinct model element / keyword?</li>
</ul>
<p>Examples programming languages:<br>c++ virtual function and java override &lt;==&gt; accessible explicit late replacing<br>c++ function redefine &lt;==&gt; accessible implicit early replacing<br>c++ dtor &lt;==&gt; late refinement\</p>
<p>eTrice override of model elements:<br>Operations (C generation) &lt;==&gt; non_accessible explicit late replacing<br>Operations (Java generation) &lt;==&gt; accessible explicit late replacing<br>State and Transitions &lt;==&gt; non-accessible explicit late refinement<br>ctor/dtor &lt;==&gt; non_accessible implicit late refinement<br>StateMachine &lt;==&gt; non-accessible implicit late refinement<br>UserCode &lt;==&gt; non-accessible implicit late refinement</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#statemachine">StateMachine</a></p></td>
<td><p>A StateMachine describes the state based, event driven behavior of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td><p><a href="#dataclass">DataClass</a></p></td>
<td><p>A DataClass is a composition of Attributes</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<p>¦¦¦<br> ```room&lt;br/&gt; ActorClass ActorSubClass extends ActorBaseClass {&lt;br/&gt; // inherits all elements from super type hierarchy&lt;br/&gt; }&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ActorClass ActorBaseClass {
Interface {
Port port1 : ProtocolBaseClass
}
Structure {
Attribute attribute1 : uint32
}
Behavior {
Operation operation1() &amp;#39;&amp;#39;&amp;#39;
return;
&amp;#39;&amp;#39;&amp;#39;
}
}
ProtocolClass ProtocolSubClass extends ProtocolBaseClass {
// inherits all elements from super type hierarchy
}
ProtocolClass ProtocolBaseClass {
incoming {
Message message1()
}
}
DataClass DataSubClass extends DataBaseClass {
// inherits all elements from super type hierarchy
}
DataClass DataBaseClass {
Attribute attribute1 : uint32
}
```
¦¦¦
</p><hr>
<h3><a href="#internalendport" name="internalendport"></a>InternalEndPort</h3>
<p>A InternalEndPort is an local Port, that is declared in the internal interface of an ActorClass</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorClass</span> InternalEndPortExample {
<span class="keyword">Structure</span> {
<span class="keyword">Port</span> internalEndPort : PSimpleProtocol
<span class="keyword">ActorRef</span> actorRef1 : SimpleActorClass
<span class="comment">// internalEndPort lives 'local' and
</span> <span class="comment">// thus needs a Binding to port of a ActorRef
</span> <span class="keyword">Binding</span> internalEndPort <span class="keyword">and</span> actorRef1.externalPort2
}
<span class="keyword">Behavior</span> {
<span class="comment">// send/receive messages from internalEndPorts
</span> }
}
</code></pre>
<p><img src="images/300-InternalEndPort.png" alt="InternalEndPort"></p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#layerconnection" name="layerconnection"></a>LayerConnection</h3>
<p>A LayerConnection associates a SPP to an ActorRef, resulting in an connection of all SAPs on its instance hierarchy</p>
<ul>
<li>An actor class can define a Service Provision Point (SPP) to publish a specific service, defined by a protocol class</li>
<li>An actor class can define a Service Access Point (SAP) if it needs a service, defined by a protocol class</li>
<li>For a given actor hierarchy, a LayerConnection defines which SAP will be satisfied by (connected to) which SPP</li>
</ul>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#sap">SAP</a><br> : SAPoint</p></td>
<td><p>A Service Access Point is similar to a Port, but uses a LayerConnection for wiring</p></td>
</tr>
<tr>
<td><p><a href="#spp">SPP</a><br> : SPPoint</p></td>
<td><p>A Service Provision Point is the counterpart of a SAP</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#subsystemclass">SubSystemClass</a></p></td>
<td><p>A SubSystem is the topmost building block of the executable part of an system</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#logicalsystem" name="logicalsystem"></a>LogicalSystem</h3>
<p>The LogicalSystem is the topmost structural class. It assembles a distributed system by means of sub systems</p>
<p>It describes the logical topology of your distributed system and is composed of sub systems (SubSystemRefs). Thus it is the notationally root of every instance path or actor hierarchy.</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#subsystemref">SubSystemRef</a></p></td>
<td><p>A Sub System Reference is an instance of an SubSystemClass</p></td>
</tr>
<tr>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#mappingmodel">MappingModel</a></p></td>
<td><p>The MappingModel describes the mapping of elements of the LogicalModel to elements of the PhysicalModel</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#operation" name="operation"></a>Operation</h3>
<p>An Operation is a member function of a class</p>
<p>Operations can be used to define a piece of reusable logic. The definition consists of:</p>
<ul>
<li>Arbitrary amount of arguments</li>
<li>Return type</li>
<li>User code body, which can access the structural part of the containing class (e.g. attributes)</li>
<li>‘override’ keyword, replaces the logic of the inherited operation having the same signature</li>
</ul>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>returnType</p></td>
<td><em>DataType</em></td>
</tr>
<tr>
<td><p>arguments</p></td>
<td><em>name : DataType</em></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td><p><a href="#dataclass">DataClass</a></p></td>
<td><p>A DataClass is a composition of Attributes</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<p>¦¦¦<br> ```room&lt;br/&gt; import room.basic.types.* from &amp;ldquo;../../../org.eclipse.etrice.modellib.c/model/Types.room&amp;rdquo;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; DataClass DataClassWithOperation {
Attribute attribute1 : uint32
Operation operation1(param1: uint32, param2: int32): boolean &amp;#39;&amp;#39;&amp;#39;
return attribute1 &amp;gt; (param1 - param2);
&amp;#39;&amp;#39;&amp;#39;
}
ActorClass ActorClassWithOperation {
Structure {
Attribute attribute1 : uint32
}
Behavior {
Operation operation1(param1: uint32, param2: int32): boolean &amp;#39;&amp;#39;&amp;#39;
return attribute1 &amp;gt; (param1 - param2);
&amp;#39;&amp;#39;&amp;#39;
}
}
ActorClass ActorClassWithOperation2 {
Structure {
usercode1 &amp;#39;&amp;#39;&amp;#39;
// #include &amp;lt;___.h&amp;gt; /* User includes here */
&amp;#39;&amp;#39;&amp;#39;
Attribute someHandle : voidType ref
}
Behavior {
Operation operation1(param1: charPtr) &amp;#39;&amp;#39;&amp;#39;
// external calls or casts may need includes
write(someHandle, param1);
&amp;#39;&amp;#39;&amp;#39;
}
}
```
¦¦¦
</p><hr>
<h3><a href="#port" name="port"></a>Port</h3>
<p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p>
<p>Once a ProtocolClass has been created, it can be used to define actor interfaces. This is accomplished by means of Ports.<br>A Port is a declaration that the set of messages defined by its ProtocolClass is now part of the actor’s interface.<br>It provides strong decoupling of ActorClasses from each other, thus enabling easy testability, reusability and deployment of actors to different threads or nodes.</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorClass</span> Example {
Structure{
<span class="keyword">Port</span> port0 : ProtocolClass1
}
<span class="keyword">Behavior</span> {
<span class="comment">// send/receive message from port0
</span> }
}
</code></pre>
<p>For communication between two actors to take place, a connection must be established between a port on one of the actors and a port on the other.<br>One condition is, that both Ports have compatible ProtocolClasses. In most cases the Ports simply refer to the same protocol.<br>In addition, a ProtocolClass has an imposed directionality - it defines one subset of messages as incoming and the complementary subset as outgoing.<br>Which subset is labeled as incoming and outgoing is arbitrary, it simply depends on the point of view, that was taken when defining.<br>Therefore Ports can be ‘regular’ and ‘conjugated’. When two actors communicate by a connected pair of Ports, one Port has to be regular and the other conjugated.<br>The ProtocolClass’ incoming messages are on one side received by the regular Port and on the other sent by the conjugated Port (outgoing message vice versa).</p>
<p>A connection of Ports is denoted by a Binding. </p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>conjugated</p></td>
<td><p><em>regular</em>, <em>conjugated</em></p></td>
</tr>
<tr>
<td><p>multiplicity</p></td>
<td><p><em>1..n</em>, <em>*</em></p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#replication">Replication</a></p></td>
<td><p>Replication is mechanism for multi-instantiation for ActorRefs and Ports</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" style="white-space: nowrap;"><p>Inheriting features:</p></td>
<td><p><a href="#relayport">RelayPort</a></p></td>
<td><p>A RelayPort forwards its messages without exposing them to the internal interface of the ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#externalendport">ExternalEndPort</a></p></td>
<td><p>A ExternalEndPort is an interface Port, that is made accessible to the internal interface of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#internalendport">InternalEndPort</a></p></td>
<td><p>A InternalEndPort is an local Port, that is declared in the internal interface of an ActorClass</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
<tr>
<td><p><a href="#portpropertydialog">PortPropertyDialog</a></p></td>
<td><p>A dialog to edit properties of an Port.</p></td>
</tr>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#binding">Binding</a><br> : endpoint1</p></td>
<td><p>A Binding connects two Ports with each other</p></td>
</tr>
<tr>
<td><p><a href="#binding">Binding</a><br> : endpoint2</p></td>
<td><p>A Binding connects two Ports with each other</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#primitivetype" name="primitivetype"></a>PrimitiveType</h3>
<p>A PrimitiveType is an abstraction of a target language’s basic type (e.g. integer or boolean)</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th>Properties</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><p>targetName</p></td>
<td><em>identifier name</em></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#datatype">DataType</a></p></td>
<td><p>A DataType can take 4 forms and types data elements like an Attribute or Operation argument</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<p>The eTrice built-in types can be found in the <em>org.eclipse.etrice.modellib</em> project. In most cases the <em>Types.room</em> is already included:</p>
<pre><code class="room customHighlighted"><span class="comment">// Follow import by Open Declaration (F3)
</span><span class="keyword">import</span> room.basic.types.* <span class="keyword">from</span> <span class="string">"../../../org.eclipse.etrice.modellib.c/model/Types.room"</span>
</code></pre>
<hr>
<h3><a href="#protocolclass" name="protocolclass"></a>ProtocolClass</h3>
<p>A ProtocolClass defines messages and is the interface specification for a Port</p>
<p>A ProtocolClass provides a reusable interface specification for ports. It defines a set of incoming and outgoing Messages that can be exchanged between two ports.<br>The exact semantics of a message is defined by the CommunicationType.<br>Protocol classes have only textual notation.</p>
<pre><code class="room customHighlighted"><span class="keyword">ProtocolClass</span> SimpleProtocolClass {
<span class="keyword">incoming</span> {
<span class="keyword">Message</span> msg1(int32}
<span class="keyword">Message</span> msg2()
}
<span class="keyword">outgoing</span> {
<span class="keyword">Message</span> msg3(DataClass1}
<span class="keyword">Message</span> msg4()
}
}
</code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#communicationtype">CommunicationType</a></p></td>
<td><p>The CommunicationType defines the communication semantics of a ProtocolClass</p></td>
</tr>
<tr>
<td><p><a href="#attribute">Attribute</a></p></td>
<td><p>An Attribute is a member variable of a class</p></td>
</tr>
<tr>
<td><p><a href="#operation">Operation</a></p></td>
<td><p>An Operation is a member function of a class</p></td>
</tr>
<tr>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#inheritance">Inheritance</a></p></td>
<td><p>A class can specify a super class and inherits elements from the super class hierarchy</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="3" style="white-space: nowrap;"><p>Typecasts:</p></td>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#sap">SAP</a></p></td>
<td><p>A Service Access Point is similar to a Port, but uses a LayerConnection for wiring</p></td>
</tr>
<tr>
<td><p><a href="#spp">SPP</a></p></td>
<td><p>A Service Provision Point is the counterpart of a SAP</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>
</tr>
</tbody>
</table>
<p><strong>Example</strong>:</p>
<pre><code class="room customHighlighted"><span class="keyword">import</span> room.basic.types.* <span class="keyword">from</span> <span class="string">"../../../org.eclipse.etrice.modellib.c/model/Types.room"</span>
<span class="comment">// eventdriven ProtocolClass (asynchronous message passing, bidirectional)
</span><span class="keyword">eventdriven</span> <span class="keyword">ProtocolClass</span> ProtocolClassEvt {
<span class="comment">// ProtocolClass ProtocolClassEvt { // same like above because eventdriven is default
</span> <span class="keyword">incoming</span> {
<span class="comment">// incoming means incoming for a regular port and outgoing for a conjugated port
</span> <span class="keyword">Message</span> message1() <span class="comment">// message without data
</span> <span class="keyword">Message</span> message2(int32) <span class="comment">// message with simple data
</span> <span class="keyword">Message</span> message3(DMessageData) <span class="comment">// message with complex data (DataClass)
</span>
}
<span class="keyword">outgoing</span> {
<span class="comment">// outgoing means outgoing for a regular port and incoming for a conjugated port
</span> <span class="keyword">Message</span> message1(int32) <span class="comment">// incoming and outgoing Messages can have the same name to enable symmetric protocols
</span> }
}
<span class="comment">// DataClass for sending complex data via message
</span><span class="keyword">DataClass</span> DMessageData {
<span class="keyword">Attribute</span> SomeData: int16
<span class="keyword">Attribute</span> SomeMoreData: int32
}
<span class="comment">// datadriven ProtocolClass (asynchronous data flow, unidirectional)
</span><span class="keyword">datadriven</span> <span class="keyword">ProtocolClass</span> ProtocolClassData {
<span class="keyword">incoming</span> {
<span class="comment">// incoming means incoming for a regular port and outgoing for a conjugated port
</span> <span class="keyword">Message</span> value1(int32) <span class="comment">// a datadriven message (signal) always needs data
</span> <span class="keyword">Message</span> value2(int16) <span class="comment">// datadriven message with simple data
</span> <span class="keyword">Message</span> value3(DMessageData) <span class="comment">// datadriven message with complex data (DataClass)
</span>
}
<span class="comment">// no outgoing messages for datadriven ports allowed
</span>}
</code></pre>
<hr>
<h3><a href="#relayport" name="relayport"></a>RelayPort</h3>
<p>A RelayPort forwards its messages without exposing them to the internal interface of the ActorClass</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorClass</span> RelayPortExample{
<span class="keyword">Interface</span> {
<span class="keyword">Port</span> relayPort : PSimpleProtocol
}
<span class="keyword">Structure</span> {
<span class="keyword">ActorRef</span> actorRef1 : SimpleActorClass2
<span class="comment">// relayPort can be directed to port of an ActorRef
</span> <span class="keyword">Binding</span> relayPort <span class="keyword">and</span> actorRef1.externalPort
}
<span class="keyword">Behavior</span> {
<span class="comment">// relayPort not available !
</span> }
}
</code></pre>
<p><img src="images/300-RelayPort.png" alt="RelayPort"></p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is a:</p></td>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#replication" name="replication"></a>Replication</h3>
<p>Replication is mechanism for multi-instantiation for ActorRefs and Ports</p>
<p>ActorRefs and Ports can be instantiated several times under the same name. The notation is similar to arrays in programming languages.</p>
<p>This possibility provides an elegant way of scaling of your system without redundancy.</p>
<pre><code class="room customHighlighted"><span class="keyword">ActorRef</span> sensor : Sensor <span class="comment">// one instance
</span><span class="keyword">ActorRef</span> sensor[1] : Sensor <span class="comment">// one instance
</span><span class="keyword">ActorRef</span> sensorArray[5] : Sensor <span class="comment">// five instances
</span></code></pre>
<p>Replication can also applied to Ports. One use case is to establish a communication with multiple actors through one port interface.</p>
<pre><code class="room customHighlighted"><span class="keyword">Port</span> service[5] : TimingService <span class="comment">// five instances
</span><span class="keyword">Port</span> service[*] : TimingService <span class="comment">// automatic, as many as needed
</span></code></pre>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#actorref">ActorRef</a></p></td>
<td><p>An ActorRef is an instance of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#port">Port</a></p></td>
<td><p>A Port is an instance of a ProtocolClass and the interface for an ActorClass</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#sap" name="sap"></a>SAP</h3>
<p>A Service Access Point is similar to a Port, but uses a LayerConnection for wiring</p>
<ul>
<li>An actor class can define a Service Provision Point (SPP) to publish a specific service, defined by a protocol class</li>
<li>An actor class can define a Service Access Point (SAP) if it needs a service, defined by a protocol class</li>
<li>For a given actor hierarchy, a LayerConnection defines which SAP will be satisfied by (connected to) which SPP</li>
</ul>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalstructureeditor">GraphicalStructureEditor</a></p></td>
<td><p>The Structure Editor allows to edit the ActorClass’ Structure in a convenient way. It is possible to create and arrange actor references and ports and to create bindings and layer connections.</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#layerconnection">LayerConnection</a><br> : SAPoint</p></td>
<td><p>A LayerConnection associates a SPP to an ActorRef, resulting in an connection of all SAPs on its instance hierarchy</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#spp" name="spp"></a>SPP</h3>
<p>A Service Provision Point is the counterpart of a SAP</p>
<ul>
<li>An actor class can define a Service Provision Point (SPP) to publish a specific service, defined by a protocol class</li>
<li>An actor class can define a Service Access Point (SAP) if it needs a service, defined by a protocol class</li>
<li>For a given actor hierarchy, a LayerConnection defines which SAP will be satisfied by (connected to) which SPP</li>
</ul>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is of type:</p></td>
<td><p><a href="#protocolclass">ProtocolClass</a></p></td>
<td><p>A ProtocolClass defines messages and is the interface specification for a Port</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#spppropertydialog">SPPPropertyDialog</a></p></td>
<td><p>A dialog to edit properties of a SPP.</p></td>
</tr>
<tr>
<td rowspan="2" style="white-space: nowrap;"><p>Is used by:</p></td>
<td><p><a href="#layerconnection">LayerConnection</a><br> : SPPoint</p></td>
<td><p>A LayerConnection associates a SPP to an ActorRef, resulting in an connection of all SAPs on its instance hierarchy</p></td>
</tr>
<tr>
<td><p><a href="#serviceimplementation">ServiceImplementation</a></p></td>
<td><p>The implementation of an Service Provision Point (SPP)</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#serviceimplementation" name="serviceimplementation"></a>ServiceImplementation</h3>
<p>The implementation of an Service Provision Point (SPP)</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#spp">SPP</a></p></td>
<td><p>A Service Provision Point is the counterpart of a SAP</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#statemachine" name="statemachine"></a>StateMachine</h3>
<p>A StateMachine describes the state based, event driven behavior of an ActorClass</p>
<p>In ROOM each actor class can implement its behavior using a state machine. Events occurring at the end ports of an actor will be forwarded to and processed by the state machine. Events possibly trigger state transitions.</p>
<p><img src="images/300-PingPongReceiverFSM.png" alt="PingPongReceiverFSM"></p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Uses:</p></td>
<td><p><a href="#inheritance">Inheritance</a></p></td>
<td><p>A class can specify a super class and inherits elements from the super class hierarchy</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#actorclass">ActorClass</a></p></td>
<td><p>An actor is the basic structural building block for building systems with ROOM</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is edited by:</p></td>
<td><p><a href="#graphicalbehavioreditor">GraphicalBehaviorEditor</a></p></td>
<td><p>The GraphicalBehaviorEditor allows to edit the ActorClass’ StateMachine. It is possible to create (hierarchical) states and transitions to model complex behavior in a convenient way.</p></td>
</tr>
</tbody>
</table>
<hr>
<h3><a href="#subsystemclass" name="subsystemclass"></a>SubSystemClass</h3>
<p>A SubSystem is the topmost building block of the executable part of an system</p>
<p>It represents a class for an logical node in a distributed system. An instantiation translates to an executable application, that runs on a node or process.<br>A SubSystemClass is the structural starting point of an ROOM application. Thus it declares the topmost actor instances (ActorRefs).</p>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Features</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4" style="white-space: nowrap;"><p>Contains:</p></td>
<td><p><a href="#actorref">ActorRef</a></p></td>
<td><p>An ActorRef is an instance of an ActorClass</p></td>
</tr>
<tr>
<td><p><a href="#binding">Binding</a></p></td>
<td><p>A Binding connects two Ports with each other</p></td>
</tr>
<tr>
<td><p><a href="#layerconnection">LayerConnection</a></p></td>
<td><p>A LayerConnection associates a SPP to an ActorRef, resulting in an connection of all SAPs on its instance hierarchy</p></td>
</tr>
<tr>
<td><p><a href="#annotation">Annotation</a></p></td>
<td><p>An Annotation can be attached to a ROOM classes to apply the properties of its AnnotationType</p></td>
</tr>
</tbody>
</table>
<table style="vertical-align: middle;" class="table">
<thead>
<tr>
<th colspan="3">Feature Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Typecasts:</p></td>
<td><p><a href="#subsystemref">SubSystemRef</a></p></td>
<td><p>A Sub System Reference is an instance of an SubSystemClass</p></td>
</tr>
<tr>
<td rowspan="1" style="white-space: nowrap;"><p>Is contained in:</p></td>
<td><p><a href="#logicalmodel">LogicalModel</a></p></td>
<td><p>The LogicalModel describes the logical structure and behavior of a ROOM application</p></td>