2 Copyright (c) 2000-2015 Ericsson Telecom AB
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
11 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
12 <meta http-equiv=
"Content-Language" content=
"en-us">
13 <title>signature
</title>
15 <body bgcolor=
"#DAD3C5" vlink=
"#0094D2" link=
"#003258">
16 <table align=
"left" border=
"0" cellspacing=
"0" cellpadding=
"0" valign=top
>
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>
21 <table border=
"0" align=
"right" cellpadding=
"0" cellspacing=
"0">
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=
"setverdict.html" alt=
"previous"><img border=
"0" src=
"../images/left.jpg" width=
"53" height=
"40"></a></td>
26 <td><a href=
"sizeof.html" alt=
"next"><img border=
"0" src=
"../images/right.jpg" width=
"53" height=
"40"></a></td>
33 <hr align=
"left" width=
"75%">
34 <p>Procedure signatures (or signatures for short) are needed for procedure-based communication. Signatures are syntactically similar to
<a href=
"function.html#5.">external
35 functions
</a> (contain the remote procedure prototype) while semantically are similar to
<a href=
"type.html">type definitions
</a> (used for template definitions). There are two classes of
38 <li><a href=
"#Blocking">Signature for blocking communication
</a></li>
39 <li><a href=
"#Non-blocking">Signature for non-blocking communication
</a></li>
42 <li>Signature definitions may have parameters. The direction of the parameters is as seen by the called party rather than the calling party.
</li>
43 <li>Signature definitions may indicate that the remote procedure returns a value after its termination.
</li>
44 <li>Signature definitions may indicate that the remote procedure may raise exception.
</li>
46 <p>Related keywords:
</p>
48 <li><a href=
"exception.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">exception
</font></b></a></li>
49 <li><a href=
"in.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">in
</font></b></a></li>
50 <li><a href=
"inout.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">inout
</font></b></a></li>
51 <li><a href=
"noblock.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">noblock
</font></b></a></li>
52 <li><a href=
"out.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">out
</font></b></a></li>
53 <li><a href=
"return.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">return
</font></b></a></li>
55 <hr align=
"left" width=
"50%">
56 <p>1.
<a name=
"Blocking">Blocking
</a> communication is blocking on the calling and the called side, i.e., TTCN-
3 processing is suspended until the respective response has arrived.
</p>
59 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
62 <h3 align=
"center"><font face=
"Courier New" color=
"#003258" size=
"5"><b>signature
</b></font> <i>identifier
</i> <font face=
"Courier New" color=
"#003258" size=
"5"><b>(
</b></font> [
<i>parameter_list
</i>
63 ]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>)
</b></font>[
<font face=
"Courier New" color=
"#003258" size=
"5"><b>return
</b></font> <i>return_type
</i> ] [
<font face=
"Courier New"
64 color=
"#003258" size=
"5"><b>exception
</b></font> <i>exception_list
</i> ]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>;
</b></font></h3>
72 <p>The
<font face=
"Courier New" color=
"#003258" size=
"4"><b>signature
</b></font> keyword introduces the signature definition.
</p>
75 <p><i>identifier
</i> is the
name used to refer to the structured type. Must begin with a letter, may contain letters, numbers and underscore characters. According to the
<a
76 href=
"../docs/naming.pdf" target=
"_blank">Naming convention
</a>, the prefix
<b> S_
</b> is recommended.
</p>
79 <p>The optional
<a name=
"parameter_list"> <i>parameter_list
</i> </a> may contain some of the following (if more than one parameter applies, they are separated by comma)
</p>
82 <li>the
<a href=
"in.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">in
</font></b></a> keyword, the type of the parameter and the name of the parameter
</li>
83 <li>the
<a href=
"inout.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">inout
</font></b></a> keyword, the type of the parameter and the name of the parameter
</li>
84 <li>the
<a href=
"out.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">out
</font></b></a> keyword, the type of the parameter and the name of the parameter
<br>
88 <p><a name=
"The">The
</a> optional
<font face=
"Courier New" color=
"#003258" size=
"4"><b>return
</b></font> keyword indicates that the called procedure will return a value.
</p>
90 <li><i>return_type
</i> specifies the type of the value returned by the procedure.
</li>
94 <p>The optional
<font face=
"Courier New" color=
"#003258" size=
"4"><b>exception
</b></font> keyword indicates that the called procedure may raise an exception.
</p>
96 <li><i>exception_list
</i> enumerates the (user defined or bulit-on) types of the values representing the exception. More than one types may be specified, they are separated by comma.
</li>
98 <hr align=
"left" width=
"75%" color=
"#0094D2">
99 <p>2.
<a name=
"Non-blocking"> Non-blocking
</a> communication is only blocking on the called side,
i.e., TTCN-
3 processing is suspended on the called side until the response has been sent.
</p>
102 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
105 <h3 align=
"center"><font face=
"Courier New" color=
"#003258" size=
"5"><b>signature
</b></font> <i>identifier
</i> <font face=
"Courier New" color=
"#003258" size=
"5"><b>(
</b></font> [
<i>parameter_list
</i>
106 ]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>)
</b></font> <font face=
"Courier New" color=
"#003258" size=
"5"><b>noblock
</b></font> [
<font face=
"Courier New" color=
"#003258" size=
"5"><b>exception
</b></font>
107 <i>exception_list
</i> ]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>;
</b></font></h3>
115 <p>The
<font face=
"Courier New" color=
"#003258" size=
"4"><b>signature
</b></font> keyword introduces the signature definition.
</p>
118 <p><i>identifier
</i> is the
name used to refer to the structured type. Must begin with a letter, may contain letters, numbers and underscore characters. According to the
<a
119 href=
"../docs/naming.pdf" target=
"_blank">Naming convention
</a>, the prefix S_ is recommended.
</p>
122 <p>The optional
<i>parameter_list
</i> may contain the following:
</p>
126 <p>the
<a href=
"in.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">in
</font></b></a> keyword, the type of the parameter and the name of the parameter
131 <p>The
<font face=
"Courier New" color=
"#003258" size=
"4"><b>noblock
</b></font> keyword indicating that the procedure signature is intended for non-blocking communication.
</p>
133 <li><i>return_type
</i> specifies the type of the value returned by the procedure.
</li>
137 <p>The optional
<font face=
"Courier New" color=
"#003258" size=
"4"><b>exception
</b></font> keyword indicates that the called procedure may raise an exception.
</p>
139 <li><i>exception_list
</i> enumerates the (user defined or bulit-on) types of the values representing the exception. More than one types may be specified, they are separated by comma.
</li>
141 <hr align=
"left" width=
"50%">
142 <p>Example
1: signature for blocking communication
143 <p><font face=
"Courier New">signature P_MyRemoteProcOne ();
</font>
144 <p>P_MyRemoteProcOne will be used for blocking procedure-based communication. It has neither parameters nor a return value.
</p>
145 <hr align=
"left" width=
"25%">
146 <p>Example
2: signature for non-blocking communication
147 <p><font face=
"Courier New">signature P_MyRemoteProcTwo () noblock;
</font>
148 <p>P_MyRemoteProcTwo will be used for non blocking procedure-based communication. It has neither parameters nor a return value.
</p>
149 <hr align=
"left" width=
"25%">
150 <p>Example
3: parameters of procedure signatures
151 <p><font face=
"Courier New">signature P_MyRemoteProcThree (in integer pl_Par1, out float pl_Par2, inout integer pl_Par3);
</font>
152 <p>P_MyRemoteProcThree will be used for blocking procedure-based communication. The procedure has three parameters: pl_Par1 an in parameter of type integer, pl_Par2 an out parameter of type float
153 and pl_Par3 an inout parameter of type integer.
</p>
154 <hr align=
"left" width=
"25%">
155 <p>Example
4: value returning remote procedures
156 <p><font face=
"Courier New">signature P_MyRemoteProcFour (in integer pl_Par1) return integer;
</font>
157 <p>P_MyRemoteProcFour will be used for blocking procedure-based communication. The procedure has the in parameter pl_Par1 of type integer and returns a value of type integer after its termination.
</p>
158 <hr align=
"left" width=
"25%">
159 <p>Example
5: specifying exceptions
160 <p><font face=
"Courier New">signature P_MyRemoteProcFive (inout float pl_Par1) return integer exception (ExceptionType1, ExceptionType2);
</font>
161 <p>P_MyRemoteProcFive will be used for blocking procedure-based communication. It returns a float value in the inout parameter pl_Par1 and an integer value, or may raise exceptions of type
162 ExceptionType1 or ExceptionType2
</p>
163 <hr align=
"left" width=
"25%">
164 <p>Example
6: specifying exceptions for non-blocking communication
165 <p><font face=
"Courier New">signature P_MyRemoteProcSix (in integer pl_Par1) noblock exception (integer, float);
</font>
166 <p>P_MyRemoteProcSix will be used for non-blocking procedure-based communication. In case of an unsuccessful termination, P_MyRemoteProcSix raises exceptions of type integer or float.
</p>
167 <hr align=
"left" width=
"25%">
168 <hr align=
"left" width=
"25%">
169 <p><a HREF=
"BNF.html#signaturedef">BNF definition
</a> of
<font face=
"Courier New"> signature
</font></p>