2 Copyright (c) 2000-2014 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>anytype
</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=
"any.html" alt=
"previous"><img border=
"0" src=
"../images/left.jpg" width=
"53" height=
"40"></a></td>
26 <td><a href=
"bit2hex.html" alt=
"next"><img border=
"0" src=
"../images/right.jpg" width=
"53" height=
"40"></a></td>
33 <hr align=
"left" width=
"75%">
34 <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
35 imported external types.
37 <li>The fieldnames of the anytype shall be uniquely identified by the corresponding type names using the
"dot
" notation.
</li>
39 <p>Related keywords:
</p>
41 <li><a href=
"union.html"><font face=
"Courier New" color=
"#003258" size=
"4"><b>union
</b></font></a> </li>
43 <hr align=
"left" width=
"50%">
46 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
49 <h3 align=
"center"><font face=
"Courier New" color=
"#003258" size=
"5"><b>anytype
</b></font></h3>
58 <table border=
"0" width=
"100%" bgcolor=
"#C9C2BB" cellpadding=
"4">
62 <p><u>TITAN specific restriction compared to the standard:
</u></p>
66 <p> <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
70 <p> 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>
78 <hr align=
"left" width=
"50%">
80 <p><font face=
"Courier New">module example {
<br>
81 type float MyFloat;
<br>
82 type charstring MyString;
<br>
83 type record MyRecord {
<br>
84 integer i,
<br>
85 float f
<br>
88 <p><font face=
"Courier New">control {
<br>
89 var anytype v_any;
<br>
90 v_any.integer :=
3;
<br>
91 v_any.charstring :=
"hello";
<br>
92 v_any.MyRecord := { i :=
42, f :=
0.5};
<br>
94 v_any.integer := v_any.MyRecord.i -
2;
<br>
98 extension
"anytype integer, charstring, MyRecord" }
<br>
100 <p><font face=
"Courier New" size=
"4"><b>anytype
</b></font> is defined to contain
3 types: integer, charstring and the MyRecord type.
<br>
101 The type MyFloat will not be a part of the anytype.
<br>
102 3 is assigned to the integer part of v_any making it hold an integer value.
<br>
103 "hello" is assigned to the charstring part of v_any making it hold a charstring value.
<br>
104 A record is assigned to the MyRecord part of v_any making it hold a MyRecord value.
<br>
105 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>
106 <hr align=
"left" width=
"25%">
107 <hr align=
"left" width=
"25%">
108 <p><a HREF=
"BNF.html#anytypekeyword">BNF definition
</a> of
<font face=
"Courier New">anytype
</font></p>