Titan Core Initial Contribution
[deliverable/titan.core.git] / help / info / getcall.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>getcall</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="get_stringencoding.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="getreply.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>getcall</h1>
33 <hr align="left" width="75%">
34 <p>The operation belongs to the family of procedure-based communication operations. It is used to specify that a test component accepts a procedure calls from the system under test or from another
35 test component.
36 <ul>
37 <li>The operation can be used on connected procedure-based (or mixed) ports.</li>
38 <li>The operation is blocking (blocks TTCN3 program execution until <a href="reply.html"><b><font face="Courier New" color="#003258" size="4">reply</font></b></a> is sent).</li>
39 <li>In case of multiple connections the operation may be restricted to one communication partner.</li>
40 </ul>
41 <p>Related keywords:</p>
42 <ul>
43 <li><a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a></li>
44 <li><a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a></li>
45 <li><a href="from.html"><b><font face="Courier New" color="#003258" size="4">from</font></b></a></li>
46 <li><a href="modifies.html"><b><font face="Courier New" color="#003258" size="4">modifies</font></b></a></li>
47 <li><a href="param.html"><b><font face="Courier New" color="#003258" size="4">param</font></b></a></li>
48 <li><a href="sender.html"><b><font face="Courier New" color="#003258" size="4">sender</font></b></a> &nbsp;</li>
49 <li><a href="signature.html"><b><font face="Courier New" color="#003258" size="4">signature</font></b></a></li>
50 <li><a href="system.html"><b><font face="Courier New" color="#003258" size="4">system</font></b></a></li>
51 </ul>
52 <hr align="left" width="50%">
53 <div align="center">
54 <center>
55 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
56 <tr>
57 <td width="100%">
58 <h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.getcall </b></font> [ <font face="Courier New" color="#003258" size="5"><b> (</b></font><i>
59 template_instance&nbsp; </i><font face="Courier New" color="#003258" size="5"><b>)</b></font> ] [ <font face="Courier New" color="#003258" size="5"><b>from </b></font><i>address_reference</i> ] [ <font
60 face="Courier New" color="#003258" size="5"><b>-&gt; </b></font><i>assignment_part</i> ]<font 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 procedure call is accepted at.</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 procedure calls at any ports will be accepted (see the <a
72 href="#Example 4:">example 4</a>).</p>
73 </li>
74 </ul>
75 </li>
76 <li>
77 <p>The <b><font face="Courier New" color="#003258" size="4">getcall</font> </b> keyword introduces the procedure call acceptance.</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">from</font> </b> keyword&nbsp; is used when a port is connected to several entities and restriction to one communication
90 partner is required.</p>
91 </li>
92 <li>
93 <p><i>address_reference</i> is one of the following:</p>
94 <ul>
95 <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"
96 target="_blank"><b><font face="Courier New" color="#003258" size="4">system</font></b></a>, in case of one-to-many connections.</li>
97 <li>
98 <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
99 system under test.</p>
100 </li>
101 </ul>
102 </li>
103 <li>
104 <p><i>assignment_part</i> is one or more of the following:</p>
105 <ul>
106 <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"
107 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"
108 size="4">component</font></b></a> type to store the address of the sender (see the <a href="#Example 2">example 2</a>).</li>
109 <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
110 to store the received parameters (see the <a href="#Example 1">example 1</a>).</li>
111 </ul>
112 </li>
113 </ul>
114 <hr align="left" width="50%">
115 <p><a name="Example 1">Example 1</a>: in-line signature template and parameter redirect
116 <p><font face="Courier New">signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) noblock;<br>
117 <br>
118 MujPort_PCO.getcall(S_MyProc:{ ?, ?, &quot;estanco&quot;}) from system -&gt; param (vl_MyPar1, vl_MyPar2, vl_MyPar3);</font>
119 <p>The signature S_MyProc suitable for non-blocking communication is defined in the first line. It has three parameters (pl_MyPar1, pl_MyPar2 and pl_MyPar3).<br>
120 In the second line, the procedure call 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
121 interface. The value of the first two parameters does not matter, but the third one must be equal to &quot;estanco&quot; for the call to be accepted. The parameter values are sotred in the variables
122 vl_MyPar1, vl_MyPar2 and vl_MyPar3, respectively.</p>
123 <hr align="left" width="50%">
124 <p><a name="Example 2">Example 2</a>: signature template and address redirect</p>
125 <p><font face="Courier New">template S_MyProc t_NiaTemplate (boolean pl_param) := {<br>
126 &nbsp;&nbsp;&nbsp;field1 := 16,<br>
127 &nbsp;&nbsp;&nbsp;field2 := pl_param,<br>
128 &nbsp;&nbsp;&nbsp;field3 := &quot;massepain&quot;<br>
129 }</font>
130 <p><font face="Courier New">MujPort_PCO.getcall (t_NiaTemplate(true)) -&gt; sender v_address;</font></p>
131 <p>The parameterized template (t_NiaTemplate) has three fields. Procedure calls are accepted where the first parameter is don't care because it is defined as an out parameter, the second and the
132 third must have the values true and &quot;massepain&quot;, respectively . The address of the component calling the procedure is stored in the variable v_address.</p>
133 <hr align="left" width="50%">
134 <p><a name="Example 3">Example 3</a>: modified signature template</p>
135 <p><font face="Courier New">MujPort_PCO.getcall (modifies t_NiaTemplate(false) := {field3 := &quot;pate d'amande&quot;});</font></p>
136 <p>The template defined in example 2 is modified. The procedure call is now accepted when the second and the third parameters have the values false and &quot;&quot;pate d'amande&quot;,
137 respectively.</p>
138 <hr align="left" width="50%">
139 <p><a name="Example 4:">Example 4:</a> receive on any port</p>
140 <p><font face="Courier New">any port.getcall (t_NiaTemplate(true));</font></p>
141 <p>The procedure call&nbsp; matching the template t_NiaTemplate will be accepted on any port.</p>
142 <hr align="left" width="50%">
143 <p><a name="Example 5">Example 5</a>: Accepting any call</p>
144 <p><font face="Courier New">MujPort_PCO.getcall;</font></p>
145 <p>Removes the top call from MujPort_PCO.</p>
146 <hr align="left" width="25%">
147 <hr align="left" width="25%">
148 <p><a HREF="BNF.html#getcallstatement">BNF definition</a> of <font face="Courier New"> getcall</font></p>
149 </body>
150 </html>
This page took 0.03463 seconds and 6 git commands to generate.