summaryrefslogtreecommitdiff
path: root/CIAO/connectors/ami4ccm/tutorials/Hello/Tutorial/02_idl.html
blob: adcf4f116f0fb07e3d6ea620dd67f05b14faee80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE>AMI4CCM Tutorial Hello - IDL</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Win32)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGEDBY" CONTENT="Marijke Hengstmengel">
	<META NAME="CHANGED" CONTENT="20100628;14101200">
	<META NAME="CHANGEDBY" CONTENT="Marijke Hengstmengel">
	<!--//$Id$  -->
	<STYLE TYPE="text/css">
	<!--
		H2.cjk { font-family: "SimSun" }
		CODE.cjk { font-family: "NSimSun", monospace }
	-->
	</STYLE>
</HEAD>
<BODY LANG="nl-NL" DIR="ltr">
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=2 CELLSPACING=2 STYLE="PAGE-BREAK-BEFORE: always">
	<TR>
		<TD>
			<P ALIGN=left><A href="01_general.html">Previous</A></P></TD>
		<TD>
			<P ALIGN=center><IMG border=0 name=graphics1 align=bottom src="images/images.png" width="4%" height="5%" ></P></TD>
		<TD>
			<P ALIGN=right><A href="03_executors.html">Next</A></P></TD></TR></TABLE>
<HR>
<H1 STYLE="MARGIN-LEFT: 0cm">IDL files</H1>
<P>The IDL files are generated by the modelling tools. To 
understand this example better, it'll give an overview of which IDL files are 
generated. </P>
<H2 CLASS="western">Common IDL files</H2>
<P>Below an simplied represenation of the common IDL files. 
Use the links to view the file itself. The following IDL files can be found in 
Hello_asm/ports: </P>
<UL>
	<LI><P STYLE="MARGIN-BOTTOM: 0cm"><A href="../Hello_asm/ports/Hello_Common_defn.idl">Hello_Common_defn.idl</A>
	: <BR>for common includes and IDL defenitions. 
</P></LI></UL>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 2cm"><CODE CLASS="western"><FONT COLOR="#0000ff"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>module</FONT></FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"><FONT SIZE=2> </FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>Hello</FONT></FONT></FONT></CODE><FONT COLOR="#000000"><FONT SIZE=2>{ </FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>exception 
InternalError { </FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2>long</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#0000ff"><FONT SIZE=2>id</FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>; </FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2>string</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>error_string; }; };</FONT></FONT><CODE CLASS="western"> </CODE></P>
<UL>
	<LI><P STYLE="MARGIN-BOTTOM: 0cm"><A href="../Hello_asm/ports/Hello_MyFoo_obj.idl">Hello_MyFoo_obj.idl</A>
	: <BR>for IDL interfaces. This IDL contains the #pragma's 
  for enabling AMI4CCM , needed by the TAO_IDL compiler: </P>
	<UL>
					
				<LI><P STYLE="MARGIN-BOTTOM: 0cm"><CODE CLASS="western"><FONT COLOR="#0000ff"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>#pragma</FONT></FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"> 
    </FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>ciao lem 
    </FONT></FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#a31515"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>"Hello_MyFoo_objE.idl", 
</FONT></FONT></FONT></CODE></P>
				<LI><P STYLE="MARGIN-BOTTOM: 0cm"><CODE CLASS="western"><FONT COLOR="#0000ff"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>#pragma</FONT></FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"> 
    </FONT></CODE><CODE CLASS="western"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>ciao lem 
    </FONT></FONT></FONT></CODE><CODE CLASS="western"><FONT COLOR="#a31515"><FONT FACE="Times New Roman, serif"><FONT SIZE=2>"Hello_MyFoo_objAE.idl"</FONT></FONT></FONT></CODE></P>
				<LI><P STYLE="MARGIN-BOTTOM: 0cm"><FONT COLOR="#0000ff"><FONT SIZE=2>#pragma</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>ciao ami4ccm </FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2>interface</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#a31515"><FONT SIZE=2>"Hello::MyFoo_obj" /</FONT></FONT><FONT COLOR="#33cc66"><FONT SIZE=2>//</FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2>this is needed per 
    interface</FONT></FONT></P>
				<LI><P STYLE="MARGIN-BOTTOM: 0cm"><FONT COLOR="#0000ff"><FONT SIZE=2>#pragma</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>ciao ami4ccm idl </FONT></FONT><FONT COLOR="#a31515"><FONT SIZE=2>"Hello_MyFoo_objA.idl" </FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2>//needed for 'uses multiple', not used in this example 
    </FONT></FONT></P></LI></UL></LI></UL>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 1cm"><FONT COLOR="#000000"><FONT SIZE=3>Also this 
IDL contains the interface between Sender and Receiver</FONT></FONT></P>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 2cm"><FONT SIZE=2><FONT COLOR="#0000ff">interface</FONT><FONT COLOR="#000000"> 
MyFoo_obj<BR></FONT></FONT><FONT SIZE=2>{<BR></FONT><FONT SIZE=2><FONT COLOR="#0000ff">&nbsp;&nbsp;long</FONT><FONT COLOR="#000000"> foo (</FONT><FONT COLOR="#0000ff">in</FONT><FONT COLOR="#000000"> 
</FONT><FONT COLOR="#0000ff">string</FONT><FONT COLOR="#000000"> in_str, </FONT><FONT COLOR="#0000ff">out</FONT><FONT COLOR="#000000"> 
</FONT><FONT COLOR="#0000ff">string</FONT><FONT COLOR="#000000"> 
answer)<BR></FONT></FONT><FONT SIZE=2><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT>raises 
(InternalError);</FONT></P>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 2cm"><FONT SIZE=2><FONT COLOR="#0000ff">&nbsp;&nbsp;void</FONT><FONT COLOR="#000000"> hello (</FONT><FONT COLOR="#0000ff">out</FONT><FONT COLOR="#000000"> 
</FONT><FONT COLOR="#0000ff">long</FONT><FONT COLOR="#000000"> answer)<BR></FONT></FONT><FONT SIZE=2><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT>raises 
(InternalError);</FONT><BR></P>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 2cm"><FONT SIZE=2><FONT COLOR="#000000"><FONT 
color=#0000ff>&nbsp;&nbsp;</FONT>attribute </FONT><FONT COLOR="#0000ff">short</FONT><FONT COLOR="#000000"> rw_attrib<BR></FONT></FONT><FONT SIZE=2><FONT 
color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT>getraises (InternalError)<BR></FONT><FONT SIZE=2><FONT 
color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT>setraises 
(InternalError);</FONT></P>
<P STYLE="MARGIN-BOTTOM: 0cm; MARGIN-LEFT: 2cm"><FONT SIZE=2><FONT COLOR="#0000ff">&nbsp;&nbsp;readonly</FONT><FONT COLOR="#000000"> attribute </FONT><FONT COLOR="#0000ff">short</FONT><FONT COLOR="#000000"> 
ro_attrib<BR></FONT></FONT><FONT SIZE=2><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;</FONT>raises 
(InternalError);<BR></FONT><FONT COLOR="#000000"><FONT SIZE=2>};</FONT></FONT><CODE CLASS="western"> </CODE></P>
<H2 CLASS="western">Component IDL files:</H2>
<H2 CLASS="western"><FONT SIZE=4 STYLE="FONT-SIZE: 16pt">Sender component IDL file</FONT></H2>
<P>The <A href="../Hello_asm/Sender_comp/src/Hello_Sender_comp.idl">Hello_Sender_comp.idl</A>
file in the Sender_comp/src directory defines the asynchronous and
synchronous connections. <FONT COLOR="#000000"><FONT SIZE=3>For synchronous invocations, the Sender component uses the 
MyFoo_obj interface (which the Receiver provides). </FONT></FONT><FONT COLOR="#a31515"><FONT SIZE=2>component 
Sender</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>{ 
</FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2>/// For synchronous invocation</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>uses MyFoo run_my_foo; }; 
</FONT></FONT></P>
<P><FONT COLOR="#000000"><FONT SIZE=3>For asynchronous invocations, the Sender component uses the 
AMI_MyFoo_obj interface of the AMI component and provides the 
AMI_MyFoo_objReplyHandler interface to the AMI component. This is indicated with 
</FONT></FONT><FONT COLOR="#0000ff"><FONT SIZE=2>#pragma</FONT></FONT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT SIZE=2>ciao ami4ccm receptacle </FONT></FONT><FONT COLOR="#a31515"><FONT SIZE=2>"Hello::Sender_comp::run_my_foo" </FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>.</FONT></FONT></P>
<H2 CLASS="western"><FONT SIZE=4 STYLE="FONT-SIZE: 16pt">Receiver component IDL file</FONT></H2>
<P>The <A href="../Hello_asm/Receiver_comp/src/Hello_Receiver_comp.idl">Hello_Receiver_comp.idl</A>
file in the Receiver_comp/src directory indicates the port the
receiver provide<FONT COLOR="#000000"><FONT SIZE=2>.</FONT></FONT></P>
<P STYLE="MARGIN-BOTTOM: 0cm"><FONT COLOR="#000000"><FONT SIZE=2>component 
Receiver<BR></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>{<BR></FONT></FONT><FONT COLOR="#008000"><FONT SIZE=2>&nbsp;&nbsp;&nbsp;// 
Provides<BR></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>&nbsp;&nbsp;provides MyFoo_obj 
do_my_foo;<BR></FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2>};</FONT></FONT></P>
<P STYLE="MARGIN-BOTTOM: 0cm"><CODE CLASS="western">
<FONT COLOR="#000000"><FONT FACE="Times New Roman"><FONT SIZE=3>The receiver isn't aware of the calls are a- or 
synchronously.</FONT></FONT></FONT></CODE></P>
<P><BR><BR></P>
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD>
			<P ALIGN=left><A href="01_general.html">Previous</A></P></TD>
		<TD>
			<P ALIGN=center><IMG border=0 name=graphics2 align=bottom src="images/images.png" width="4%" height="5%" ></P></TD>
		<TD>
			<P ALIGN=right><A href="03_executors.html">Next</A></P></TD></TR></TABLE>
<P><BR><BR></P>
</BODY>
</HTML>