Debian Codegraph @

help/info/anytype.html

raw symbols SCIP
1 <!--
2 Copyright (c) 2000-2021 Ericsson Telecom AB
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License v2.0
5 which accompanies this distribution, and is available at
6 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7
8 Contributors:
9 Baji, Laszlo
10 Balasko, Jeno
11 Farkas, Laszlo
12 Forstner, Matyas
13 Szabados, Kristof
14 -->
15 <html>
16 <head>
17 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
18 <meta http-equiv="Content-Language" content="en-us">
19 <title>anytype</title>
20 </head>
21 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
22 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
23 <tr>
24 <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>
25 </tr>
26 </table>
27 <table border="0" align="right" cellpadding="0" cellspacing="0">
28 <tr>
29 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
30 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
31 <td><a href="any.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
32 <td><a href="apply.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
33 </tr>
34 </table>
35 <p><br clear="all">
36 </p>
37 <hr>
38 <h1>anytype</h1>
39 <hr align="left" width="75%">
40 <p>This special type is defined as a shorthand for the union of all known types in a TTCN-3 module. Known types include the following: built-in types, user-defined types, imported ASN.1 and other
41 imported external types.
42 <ul>
43 <li>The fieldnames of the anytype shall be uniquely identified by the corresponding type names using the &quot;dot&quot; notation.</li>
44 </ul>
45 <p>Related keywords:</p>
46 <ul>
47 <li><a href="union.html"><font face="Courier New" color="#003258" size="4"><b>union</b></font></a> &nbsp;</li>
48 </ul>
49 <hr align="left" width="50%">
50 <div align="center">
51 <center>
52 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
53 <tr>
54 <td width="100%">
55 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>anytype</b></font></h3>
56 </td>
57 </tr>
58 </table>
59 </center>
60 </div>
61 <p>&nbsp;</p>
62 <div align="center">
63 <center>
64 <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4">
65 <tr>
66 <td width="100%">
67 <blockquote>
68 <p><u>TITAN specific restriction compared to the standard:</u></p>
69 </blockquote>
70 <ul>
71 <li>
72 <p>&nbsp;<font face="Courier New" size="4"><b>anytype</b></font> can only contain the simple types, the ones defined in the same module and the <b>address</b> type. Imported types are not
73 included.</p>
74 </li>
75 <li>
76 <p>&nbsp;The types included in the <font face="Courier New" size="4"><b>anytype</b></font> of a module have to be declared by the user, using extension attributes.</p>
77 </li>
78 </ul>
79 </td>
80 </tr>
81 </table>
82 </center>
83 </div>
84 <hr align="left" width="50%">
85 <p>Example 1:
86 <p><font face="Courier New">module example {<br>
87 type float MyFloat;<br>
88 type charstring MyString;<br>
89 type record MyRecord {<br>
90 &nbsp;&nbsp;&nbsp;integer i,<br>
91 &nbsp;&nbsp;&nbsp;float f<br>
92 }<br>
93 ...</font>
94 <p><font face="Courier New">control {<br>
95 &nbsp;&nbsp;&nbsp;var anytype v_any;<br>
96 &nbsp;&nbsp;&nbsp;v_any.integer := 3;<br>
97 &nbsp;&nbsp;&nbsp;v_any.charstring := "hello";<br>
98 &nbsp;&nbsp;&nbsp;v_any.MyRecord := { i := 42, f := 0.5};<br>
99 ...<br>
100 &nbsp;&nbsp;&nbsp;v_any.integer := v_any.MyRecord.i - 2;<br>
101 }<br>
102 }<br>
103 with {<br>
104 extension "anytype integer, charstring, MyRecord" }<br>
105 </font>
106 <p><font face="Courier New" size="4"><b>anytype</b></font> is defined to contain 3 types: integer, charstring and the MyRecord type.<br>
107 The type MyFloat will not be a part of the anytype.<br>
108 3 is assigned to the integer part of v_any making it hold an integer value.<br>
109 "hello" is assigned to the charstring part of v_any making it hold a charstring value.<br>
110 A record is assigned to the MyRecord part of v_any making it hold a MyRecord value.<br>
111 The MyRecord contents of v_any is read and after decreasing it with 2 it is assigned to the integer part of v_any.<br>
112 <hr align="left" width="25%">
113 <hr align="left" width="25%">
114 <p><a HREF="BNF.html#anytypekeyword">BNF definition</a> of <font face="Courier New">anytype</font></p>
115 </body>
116 </html>