| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
<html> |
| 17 |
<head> |
| 18 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 19 |
<meta http-equiv="Content-Language" content="en-us"> |
| 20 |
<title>create</title> |
| 21 |
</head> |
| 22 |
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> |
| 23 |
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> |
| 24 |
<tr> |
| 25 |
<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> |
| 26 |
</tr> |
| 27 |
</table> |
| 28 |
<table border="0" align="right" cellpadding="0" cellspacing="0"> |
| 29 |
<tr> |
| 30 |
<td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> |
| 31 |
<td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> |
| 32 |
<td><a href="control.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> |
| 33 |
<td><a href="deactivate.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> |
| 34 |
</tr> |
| 35 |
</table> |
| 36 |
<p><br clear="all"> |
| 37 |
</p> |
| 38 |
<hr> |
| 39 |
<h1>create</h1> |
| 40 |
<hr align="left" width="75%"> |
| 41 |
<p>The operation is used to create a parallel test component at any point in a behavior description by any other (running) component. |
| 42 |
<ul> |
| 43 |
<li>A component is created with its full set of ports and empty input queues;</li> |
| 44 |
<li>all component variables and timers are reset to their initial values (if any);</li> |
| 45 |
<li>the component itself is not started (the operation <a href="start.html"><b><font face="Courier New" color="#003258" size="4">start</font></b></a> is used to do this); </li> |
| 46 |
<li>the operation returns the unique component reference of the newly created instance.</li> |
| 47 |
</ul> |
| 48 |
<p>The optional <b><font face="Courier New" color="#003258" size="4">alive</font></b> keyword can be used to establish an "alive" parallel test component. |
| 49 |
<p>Optionally, a name can be associated with the newly created component instance. Associated component names can be free-format character strings, which are not required to be unique. |
| 50 |
<p>The main difference between normal and alive parallel test components is that alive parallel test components can be started many times while normal parallel test components can only be started |
| 51 |
once. See also the <a href="start.html"><b><font face="Courier New" color="#003258" size="4">start</font></b></a> keyword! |
| 52 |
<p>Related keywords:</p> |
| 53 |
<ul> |
| 54 |
<li><a href="component.html"><b><font face="Courier New" color="#003258" size="4">component</font></b></a></li> |
| 55 |
<li><a href="start.html"><b><font face="Courier New" color="#003258" size="4">start</font></b></a></li> |
| 56 |
<li><a href="alive.html"><b><font face="Courier New" color="#003258" size="4">alive</font></b></a></li> |
| 57 |
<li><a href="running.html"><b><font face="Courier New" color="#003258" size="4">running</font></b></a></li> |
| 58 |
<li><a href="stop.html"><b><font face="Courier New" color="#003258" size="4">stop</font></b></a></li> |
| 59 |
<li><a href="kill.html"><b><font face="Courier New" color="#003258" size="4">kill</font></b></a></li> |
| 60 |
<li><a href="done.html"><b><font face="Courier New" color="#003258" size="4">done</font></b></a></li> |
| 61 |
<li><a href="killed.html"><b><font face="Courier New" color="#003258" size="4">killed</font></b></a></li> |
| 62 |
</ul> |
| 63 |
<hr align="left" width="50%"> |
| 64 |
<div align="center"> |
| 65 |
<center> |
| 66 |
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> |
| 67 |
<tr> |
| 68 |
<td width="100%"> |
| 69 |
<h3 align="center">[ <i>module_identifier</i><font face="Courier New" color="#003258" size="5"><b>.</b></font>] <i>component_identifier</i><font face="Courier New" color="#003258" size="5"><b>.create</b></font> |
| 70 |
[ <i>( component_name )</i> ] [ <font face="Courier New" color="#003258" size="5"><b>alive</b></font> ];</h3> |
| 71 |
</td> |
| 72 |
</tr> |
| 73 |
</table> |
| 74 |
</center> |
| 75 |
</div> |
| 76 |
<ul> |
| 77 |
<li> |
| 78 |
<p><i>component_identifier</i> is a reference to an already defined component type. </p> |
| 79 |
</li> |
| 80 |
<li> |
| 81 |
<p>It may be optionally preceded by a <i> module_identifier</i> referencing the module where the component is to be created. The module identifier and the component identifier are connected by a |
| 82 |
dot.</p> |
| 83 |
</li> |
| 84 |
<li> |
| 85 |
<p>The <b><font face="Courier New" color="#003258" size="4">create</font> </b> keyword is used to create a parallel test component.</p> |
| 86 |
</li> |
| 87 |
</ul> |
| 88 |
<hr align="left" width="50%"> |
| 89 |
<p>Example 1: |
| 90 |
<p><font face="Courier New">var CompType_CT vc_CompRef;<br> |
| 91 |
vc_CompRef := CompType_CT.create;</font> |
| 92 |
<p>The first line declares a variable having the same type (CompType_CT) as the component to be created. The second line creates the component and stores its reference in the variable vc_CompRef.</p> |
| 93 |
<hr align="left" width="25%"> |
| 94 |
<p>Example 2: |
| 95 |
<p><font face="Courier New">var CompType_CT vc_AliveCompRef;<br> |
| 96 |
vc_AliveCompRef := CompType_CT.create alive;</font> |
| 97 |
<p>The declared component reference (vc_AliveCompRef) will be used to store the reference of the newly created alive parallel test component.</p> |
| 98 |
<hr align="left" width="25%"> |
| 99 |
<p>Example 3: |
| 100 |
<p><font face="Courier New">var CompType_CT vc_AliveCompRef;<br> |
| 101 |
vc_AliveCompRef := CompType_CT.create("mycomp") alive;</font> |
| 102 |
<p>The component instance will have the name "mycomp".</p> |
| 103 |
<hr align="left" width="25%"> |
| 104 |
<p><a HREF="BNF.html#createop">BNF definition</a> of <font face="Courier New"> create</font></p> |
| 105 |
</body> |
| 106 |
</html> |