Update README.md
[deliverable/titan.core.git] / help / info / getreply.html
1 <!--
2 Copyright (c) 2000-2014 Ericsson Telecom AB
3
4 All rights reserved. This program and the accompanying materials
5 are made available under the terms of the Eclipse Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <html>
10 <head>
11 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12 <meta http-equiv="Content-Language" content="en-us">
13 <title>getreply</title>
14 </head>
15 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
16 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
17 <tr>
18 <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
19 </tr>
20 </table>
21 <table border="0" align="right" cellpadding="0" cellspacing="0">
22 <tr>
23 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
24 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
25 <td><a href="getcall.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="getverdict.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
27 </tr>
28 </table>
29 <p><br clear="all">
30 </p>
31 <hr>
32 <h1>getreply</h1>
33 <hr align="left" width="75%">
34 <p>The operation belongs to the family of procedure-based communication operations. It is used to handle replies from a previously called procedure.
35 <ul>
36 <li>The operation can be used on connected procedure-based (or mixed) ports.</li>
37 <li>In case of multiple connections the operation may be restricted to one communication partner.</li>
38 </ul>
39 <p>Related keywords:</p>
40 <ul>
41 <li><a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a></li>
42 <li><a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a></li>
43 <li><a href="from.html"><b><font face="Courier New" color="#003258" size="4">from</font></b></a></li>
44 <li><a href="modifies.html"><b><font face="Courier New" color="#003258" size="4">modifies</font></b></a></li>
45 <li><a href="param.html"><b><font face="Courier New" color="#003258" size="4">param</font></b></a></li>
46 <li><a href="sender.html"><b><font face="Courier New" color="#003258" size="4">sender</font></b></a> &nbsp;</li>
47 <li><a href="signature.html"><b><font face="Courier New" color="#003258" size="4">signature</font></b></a></li>
48 <li><a href="system.html"><b><font face="Courier New" color="#003258" size="4">system</font></b></a></li>
49 <li><a href="value.html"><b><font face="Courier New" color="#003258" size="4">value</font></b></a></li>
50 </ul>
51 <hr align="left" width="50%">
52 <div align="center">
53 <center>
54 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
55 <tr>
56 <td width="100%">
57 <h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.getreply </b></font> [ <font face="Courier New" color="#003258" size="5"><b> (</b></font><i>
58 template_instance&nbsp; </i>[ <font face="Courier New" color="#003258" size="5"><b>value </b></font><i>value_match</i> ] <font face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font
59 face="Courier New" color="#003258" size="5"><b>from </b></font><i>address_reference</i> ] [ <font face="Courier New" color="#003258" size="5"><b>-&gt; </b></font><i>assignment_part</i> ]<font
60 face="Courier New" color="#003258" size="5"><b>;</b></font> &nbsp;</h3>
61 </td>
62 </tr>
63 </table>
64 </center>
65 </div>
66 <ul>
67 <li>
68 <p><i> port_reference</i> points out the port where the reply is awaited from.</p>
69 <ul>
70 <li>
71 <p>the keywords <b><font face="Courier New" color="#003258" size="4">any port</font> </b> may be used to indicate that replies will be accepted at any port (see the <a href="#Example 4:">example
72 4</a>).</p>
73 </li>
74 </ul>
75 </li>
76 <li>
77 <p>The <b><font face="Courier New" color="#003258" size="4">getreply</font> </b>keyword introduces the reply to the procedure call.</p>
78 </li>
79 <li>
80 <p><i>template_instance</i> may be one of the following&nbsp; (<a href="#Example 5">when omitted</a>, the call on the top of the incoming port queue (if any) will be removed):</p>
81 <ul>
82 <li>in-line signature template (see the <a href="#Example 1">example1</a>);</li>
83 <li>a signature template (see the <a href="#Example 2">example 2</a>);</li>
84 <li>a modified signature template (see the <a href="#Example 3">example 3</a>);<br>
85 &nbsp;</li>
86 </ul>
87 </li>
88 <li>
89 <p>The optional <b><font face="Courier New" color="#003258" size="4">value</font> </b>keyword introduces the checking of the returned value (see the <a href="#Example 3">example 3</a>).</p>
90 </li>
91 <li>
92 <p><i>value_match</i> may be one of the following:</p>
93 <ul>
94 <li>in-line value template;</li>
95 <li>a receiving template;</li>
96 <li>a modified template.<br>
97 &nbsp;</li>
98 </ul>
99 </li>
100 <li>
101 <p>The optional <b><font face="Courier New" color="#003258" size="4">from</font> </b> keyword&nbsp; is used when a port is connected to several entities and restriction to one communication
102 partner is required.</p>
103 </li>
104 <li>
105 <p><i>address_reference</i> is one of the following:</p>
106 <ul>
107 <li>a component reference (cf. <a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a>)&nbsp; or the keyword <a href="system.html"
108 target="_blank"><b><font face="Courier New" color="#003258" size="4">system</font></b></a>, in case of one-to-many connections.</li>
109 <li>
110 <p>an address reference (cf. <a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a>) , when there are several entities within the
111 system under test.</p>
112 </li>
113 </ul>
114 </li>
115 <li>
116 <p><i>assignment_part</i> is one or more of the following:</p>
117 <ul>
118 <li>the <a href="sender.html"><b><font face="Courier New" color="#003258" size="4">sender</font></b></a> keyword followed by a variable of <a href="address.html"
119 target="_blank"><b><font face="Courier New" color="#003258" size="4">address</font></b></a> or&nbsp; <a href="component.html"><b><font face="Courier New" color="#003258"
120 size="4">component</font></b></a> type to store the address of the sender (see the <a href="#Example 2">example 2</a>).</li>
121 <li>the <a href="value.html"><b><font face="Courier New" color="#003258" size="4">value</font></b></a> keyword followed by a variable of the appropriate type to store the
122 returned value (see the <a href="#Example 3">example 3</a>).</li>
123 <li>the <a href="param.html"><b><font face="Courier New" color="#003258" size="4">param</font></b></a> keyword followed of variables of the same type as the received message
124 to store the received parameters (see the <a href="#Example 1">example 1</a>).</li>
125 </ul>
126 </li>
127 </ul>
128 <hr align="left" width="50%">
129 <p><a name="Example 1">Example 1</a>: in-line signature template and parameter redirect
130 <p><font face="Courier New">signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) return float;<br>
131 <br>
132 MujPort_PCO.getreply(S_MyProc:{ 14 .. 143, ?, ?}) from system -&gt; param (vl_MyPar1, vl_MyPar2, vl_MyPar3);</font>
133 <p>The signature S_MyProc suitable for blocking communication is defined in the first line. It has three parameters (pl_MyPar1, pl_MyPar2 and pl_MyPar3).<br>
134 In the second line, the response is accepted at&nbsp; the port MujPort_PCO. The port is connected to several components, but communication is restricted to one component, here to the test system
135 interface. The value of the last two parameters does not matter, but the first one must be between 14 and 143 for the response to be accepted. The parameter values are stored in the variables
136 vl_MyPar1, vl_MyPar2 and vl_MyPar3, respectively.</p>
137 <hr align="left" width="50%">
138 <p><a name="Example 2">Example 2</a>: signature template, value match and address redirect</p>
139 <p><font face="Courier New">template S_MyProc t_NiaTemplate (boolean pl_param) := {<br>
140 &nbsp;&nbsp;&nbsp;field1 := 1 .. 6,<br>
141 &nbsp;&nbsp;&nbsp;field2 := pl_param,<br>
142 &nbsp;&nbsp;&nbsp;field3 := &quot;massepain&quot;<br>
143 }</font>
144 <p><font face="Courier New">MujPort_PCO.getreply (t_NiaTemplate(true) value 1.1) -&gt; sender v_address;</font></p>
145 <p>The parameterized template (t_NiaTemplate) has three fields. Replies are accepted where the first parameter is between one and six; the second must have the value true and the last parameter is
146 don't care because it is defined as an <b><font face="Courier New">in</font></b> parameter. Another requirement to be met that the returned value must be equal to 1.1. The address of the component
147 responding to the procedure call is stored in the variable v_address.</p>
148 <hr align="left" width="50%">
149 <p><a name="Example 3">Example 3</a>: modified signature template and value redirect</p>
150 <p><font face="Courier New">MujPort_PCO.getreply (modifies t_NiaTemplate(false) := {field1 := 6}) -&gt; value v_Ile_Flottante;</font></p>
151 <p>The template defined in example 2 is modified. The response is now accepted when the first and the second parameters have the values six and false, respectively. The returned floating point
152 value is stored in the variable v_Ile_Flottante</p>
153 <hr align="left" width="50%">
154 <p><a name="Example 4:">Example 4:</a> receive on any port</p>
155 <p><font face="Courier New">any port.getreply (t_NiaTemplate(true));</font></p>
156 <p>The response matching the template t_NiaTemplate will be accepted on any port.</p>
157 <hr align="left" width="50%">
158 <p><a name="Example 5">Example 5</a>: Accepting any call</p>
159 <p><font face="Courier New">MujPort_PCO.getreply;</font></p>
160 <p>Removes the top reply from MujPort_PCO.</p>
161 <hr align="left" width="25%">
162 <hr align="left" width="25%">
163 <p><a HREF="BNF.html#getreplystatement">BNF definition</a> of <font face="Courier New"> getreply</font></p>
164 </body>
165 </html>
This page took 0.035209 seconds and 5 git commands to generate.