Sync with 5.4.0
[deliverable/titan.core.git] / help / info / port.html
1 <!--
2 Copyright (c) 2000-2015 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>port</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="permutation.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="private.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>port</h1>
33 <hr align="left" width="75%">
34 <p>The keyword is used to define a test port. Ports facilitate communication between test components and between test components and the test system interface. Ports are always bidirectional.
35 <ul>
36 <li>Each port shall be defined as being <a href="#message">message-based</a>(1) or <a href="#procedure">procedure-based</a>(2)</li>
37 <li>A <a href="#mixed">mixed port</a>(3) is a shorthand notation for two ports: a message-based and a procedure-based</li>
38 <li>Ports include a list of messages and/or procedures allowed to pass that port together with their direction (in, out, inout)&nbsp;</li>
39 </ul>
40 <p>Related keywords:</p>
41 <ul>
42 <li><a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a></li>
43 <li><a href="in.html"><b><font face="Courier New" color="#003258" size="4">in</font></b></a></li>
44 <li><a href="inout.html"><b><font face="Courier New" color="#003258" size="4">inout</font></b></a></li>
45 <li><a href="message.html"><b><font face="Courier New" color="#003258" size="4">message</font></b></a></li>
46 <li><a href="mixed.html"><b><font face="Courier New" color="#003258" size="4">mixed</font></b></a></li>
47 <li><a href="out.html"><b><font face="Courier New" color="#003258" size="4">out</font></b></a></li>
48 <li><a href="procedure.html"><b><font face="Courier New" color="#003258" size="4">procedure</font></b></a></li>
49 <li><a href="type.html"><b><font face="Courier New" color="#003258" size="4">type</font></b></a></li>
50 </ul>
51 <hr align="left" width="75%">
52 <h4><a name="message">1. Declaring a message-based port</a></h4>
53 <hr align="left" width="50%">
54 <div align="center">
55 <center>
56 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
57 <tr>
58 <td width="100%">
59 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>type port </b></font> <i>port_identifier&nbsp;</i><font face="Courier New" color="#003258" size="5"><b>
60 message {</b></font> [&nbsp; <font face="Courier New" color="#003258" size="5"><b>in all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp; <font
61 face="Courier New" color="#003258" size="5"><b>out all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp; <font
62 face="Courier New" color="#003258" size="5"><b>inout all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp; <font face="Courier New"
63 color="#003258" size="5"><b>};</b></font></h3>
64 </td>
65 </tr>
66 </table>
67 </center>
68 </div>
69 <ul>
70 <li>
71 <p>The <a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</a> port</b></font> keywords introduce the port definition.</p>
72 </li>
73 <li>
74 <p><i>port_identifier</i> is the&nbsp;name used to refer to the port. Must begin with a letter, may contain letters, numbers and underscore characters.&nbsp;<br>
75 According to the&nbsp; Naming convention, the suffix _<b>PT</b> is recommended.</p>
76 </li>
77 <li>
78 <p>The <a href="message.html"><font face="Courier New" color="#003258" size="4"><b>message</b></font></a> keyword indicates that only messages are allowed to pass through the
79 port.</p>
80 </li>
81 <li>
82 <p>The <a href="in.html"><font face="Courier New" color="#003258" size="4"><b>in</b></font></a> keyword introduces the list of messages allowed to pass the port in the incoming
83 direction..</p>
84 </li>
85 <li>
86 <p><i>type_list</i> enumerates the allowed message types separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used
87 when no restriction applies.</p>
88 </li>
89 <li>
90 <p>The <a href="out.html"><font face="Courier New" color="#003258" size="4"><b>out</b></font></a> keyword introduces the list of messages allowed to pass the port in the outgoing
91 direction..</p>
92 </li>
93 <li>
94 <p><i>type_list</i> enumerates the allowed message types separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used
95 when no restriction applies.</p>
96 </li>
97 <li>
98 <p>The <a href="inout.html"><font face="Courier New" color="#003258" size="4"><b>inout</b></font></a> keyword introduces the list of messages allowed to pass the port both in
99 incoming and outgoing direction..</p>
100 </li>
101 <li>
102 <p><i>type_list</i> enumerates the allowed message types separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used
103 when no restriction applies.</p>
104 </li>
105 </ul>
106 <p>No element may be repeated within the curly brackets.</p>
107 <p><a href="#Example">Example</a></p>
108 <hr align="left" width="75%">
109 <h4><a name="procedure">2. Declaring a procedure-based port</a></h4>
110 <hr align="left" width="50%">
111 <div align="center">
112 <center>
113 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
114 <tr>
115 <td width="100%">
116 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>type port </b></font> <i>port_identifier&nbsp;</i><font face="Courier New" color="#003258" size="5"><b>
117 procedure {</b></font> [&nbsp; <font face="Courier New" color="#003258" size="5"><b>in all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp;
118 <font face="Courier New" color="#003258" size="5"><b>out all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp; <font
119 face="Courier New" color="#003258" size="5"><b>inout all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp; <font face="Courier New"
120 color="#003258" size="5"><b>};</b></font></h3>
121 </td>
122 </tr>
123 </table>
124 </center>
125 </div>
126 <ul>
127 <li>
128 <p>The <a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></a><b><font face="Courier New" color="#003258" size="4"> port</font> </b> keywords
129 introduce the port definition.</p>
130 </li>
131 <li>
132 <p><i>port_identifier</i> is the&nbsp;name used to refer to the port. Must begin with a letter, may contain letters, numbers and underscore characters.&nbsp;<br>
133 According to the&nbsp; Naming convention, the suffix _PT is recommended.</p>
134 </li>
135 <li>
136 <p>The <a href="procedure.html"><font face="Courier New" color="#003258" size="4"><b>procedure</b></font></a> keyword indicates that only procedures are allowed to be called
137 through the port.</p>
138 </li>
139 <li>
140 <p>The <a href="in.html"><font face="Courier New" color="#003258" size="4"><b>in</b></font></a> keyword introduces the list of procedures allowed to be called on the port in the
141 incoming direction..</p>
142 </li>
143 <li>
144 <p><i>type_list</i> enumerates the allowed signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used when
145 no restriction applies.</p>
146 </li>
147 <li>
148 <p>The <a href="out.html"><font face="Courier New" color="#003258" size="4"><b>out</b></font></a> keyword introduces the list of procedures allowed to be called on the port in
149 the outgoing direction..</p>
150 </li>
151 <li>
152 <p><i>type_list</i> enumerates the allowed signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used when
153 no restriction applies.</p>
154 </li>
155 <li>
156 <p>The <a href="inout.html"><font face="Courier New" color="#003258" size="4"><b>inout</b></font></a> keyword introduces the list of procedures allowed to be called on the port
157 both in incoming and outgoing direction..</p>
158 </li>
159 <li>
160 <p><i>type_list</i> enumerates the allowed signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a> is used when
161 no restriction applies.</p>
162 </li>
163 </ul>
164 <p>No element may be repeated within the curly brackets.</p>
165 <p><a href="#ex2">Example</a></p>
166 <hr align="left" width="75%">
167 <h4><a name="mixed">3. Declaring a mixed port</a></h4>
168 <hr align="left" width="50%">
169 <div align="center">
170 <center>
171 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
172 <tr>
173 <td width="100%">
174 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>type port </b></font> <i>port_identifier&nbsp;</i><font face="Courier New" color="#003258" size="5"><b>
175 mixed {</b></font> [&nbsp; <font face="Courier New" color="#003258" size="5"><b>in all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp; <font
176 face="Courier New" color="#003258" size="5"><b>out all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp;&nbsp; [&nbsp; <font
177 face="Courier New" color="#003258" size="5"><b>inout all</b></font> | <i>type_list</i><font face="Courier New" color="#003258" size="5"><b>;</b></font> ]&nbsp; <font face="Courier New"
178 color="#003258" size="5"><b>};</b></font></h3>
179 </td>
180 </tr>
181 </table>
182 </center>
183 </div>
184 &nbsp;
185 <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4">
186 <tr>
187 <td width="100%">
188 <blockquote>
189 <p><u>TITAN specific restriction compared to the standard:</u></p>
190 </blockquote>
191 <p>&nbsp;Mixed ports are not implemented. When encountered in the TTCN-3 program, it will cause a compilation error.</p>
192 </td>
193 </tr>
194 </table>
195 <ul>
196 <li>
197 <p>The <a href="type.html"><font face="Courier New" color="#003258" size="4"><b>type</b></font></a><b><font face="Courier New" color="#003258" size="4"> port</font> </b> keywords
198 introduce the port definition.</p>
199 </li>
200 <li>
201 <p><i>port_identifier</i> is the&nbsp;name used to refer to the port. Must begin with a letter, may contain letters, numbers and underscore characters.&nbsp;<br>
202 According to the&nbsp; Naming convention, the suffix _PT is recommended.</p>
203 </li>
204 <li>
205 <p>The <a href="mixed.html"><font face="Courier New" color="#003258" size="4"><b>mixed</b></font></a> keyword indicates that both messages and signatures are allowed to pass
206 through the port.</p>
207 </li>
208 <li>
209 <p>The <a href="in.html"><font face="Courier New" color="#003258" size="4"><b>in</b></font></a> keyword introduces the list of messages and signatures allowed to pass the port in
210 the incoming direction..</p>
211 </li>
212 <li>
213 <p><i>type_list</i> enumerates the allowed messages and signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a>
214 is used when no restriction applies.</p>
215 </li>
216 <li>
217 <p>The <a href="out.html"><font face="Courier New" color="#003258" size="4"><b>out</b></font></a> keyword introduces the list of messages and signatures allowed to pass the port
218 in the outgoing direction..</p>
219 </li>
220 <li>
221 <p><i>type_list</i> enumerates the allowed messages and signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a>
222 is used when no restriction applies.</p>
223 </li>
224 <li>
225 <p>The <a href="inout.html"><font face="Courier New" color="#003258" size="4"><b>inout</b></font></a> keyword introduces the list of messages and signatures allowed to pass the
226 port both in incoming and outgoing direction..</p>
227 </li>
228 <li>
229 <p><i>type_list</i> enumerates the allowed messages and signatures separated by commas; <a href="all.html"><b><font face="Courier New" color="#003258" size="4">all</font></b></a>
230 is used when no restriction applies.</p>
231 </li>
232 </ul>
233 <p>No element may be repeated within the curly brackets.</p>
234 <p><a href="#ex3">Example</a></p>
235 <hr align="left" width="50%">
236 <p><a name="Example">Example</a> 1:
237 <p><font face="Courier New">type port MyMessagePortType_PT message {&nbsp;<br>
238 &nbsp;&nbsp;&nbsp;in ASP_RxType1, ASP_RxType2;&nbsp;<br>
239 &nbsp;&nbsp;&nbsp;out ASP_TxType;&nbsp;<br>
240 &nbsp;&nbsp;&nbsp;inout integer, octetstring;&nbsp;<br>
241 }</font>
242 <p>The message-based port called MyMessagePortType_PT is declared.&nbsp;<br>
243 In incoming directions messages of type ASP_RxType1, ASP_RxType2,&nbsp;<br>
244 in outgoing directions messages of type ASP_TxType1,&nbsp;<br>
245 in both outgoing and incoming direction messages of type integer and octetstring<br>
246 are allowed to pass the port.</p>
247 <hr align="left" width="50%">
248 <p><a name="ex2">Example</a> 2:</p>
249 <p><font face="Courier New">type port MyProcedurePortType_PT procedure {&nbsp;<br>
250 &nbsp;&nbsp;&nbsp;out Proc1, Proc2, Proc3&nbsp;<br>
251 }</font>
252 <p>The procedure-based port called MyProcedurePortType_PT is declared.&nbsp;<br>
253 In outgoing directions the signatures Proc1, Proc2 and Proc3&nbsp;are allowed to pass the port.</p>
254 <hr align="left" width="50%">
255 <p><a name="ex3">Example</a> 3:</p>
256 <p><font face="Courier New">type port MyAllMixedPortType_PT mixed {&nbsp;<br>
257 &nbsp;&nbsp;&nbsp;inout all&nbsp;<br>
258 }</font>
259 <p>The mixed port called MyAllMixedPortType_PT is declared.&nbsp;<br>
260 In both outgoing and incoming direction all message types and all signatures defined in the module can be used at this port to communicate with either the system under test (SUT) or other test
261 components.</p>
262 <hr align="left" width="25%">
263 <hr align="left" width="25%">
264 <p><a HREF="BNF.html#portdef">BNF definition</a> of <font face="Courier New"> port</font></p>
265 </body>
266 </html>
This page took 0.09278 seconds and 5 git commands to generate.