summaryrefslogtreecommitdiff
path: root/modules/CIAO/tools/IDL3_to_IDL2/README
blob: b0732e2c304191b1f97906ad5f011f658756bce9 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

                  IDL3 To IDL2 Converter

A pluggable back end used with the IDL compiler parser
and command line processor, this tool converts CCM-related
IDL constructs into their corresponding IDL2 equivalents,
in a new IDL file. For more information about CIAO, please see

$CIAO_ROOT/docs/releasenotes/index.html

COMPILING:

Use the provided .mpc file to generate a project or makefile to
compile the pluggable back end library and the executable.
Make sure the TAO IDL compiler front end is already built.

EXECUTABLE NAME:

tao_idl3_to_idl2

COMMAND LINE OPTIONS:

All the usual front-end command line options that apply to the IDL compiler
(such as path includes) work with this tool as well, since the IDL compiler
front end is simply reused. The options -? or -h will display a usage
message, including both front end and back end options. For a complete
list of IDL compiler command line options and a description of each, see
TAO/docs/compiler.html.

BACKEND OPTIONS:

-o <path> Also works the same as with the IDL compiler, setting the
output directory, overriding the default, which is the directory of
execution.

-e Generates a file foo_IDL2.idl from foo.idl that simply includes
foo.idl instead of generating its IDL declarations. Note that this
option takes effect only if foo.idl contains no 'IDL3' declarations,
otherwise it's a no-op.

Note that the original -x <filename> option (which manually excludes
an included IDL file from being transformed to an include of the 
'_IDL2' decorated corresponding file) has been eliminated. This
option was intended for included IDL files that contained no IDL3
constructs, and therefore didn't need processing by this tool.
Detection of such included files is now automatic, and the processed
include filename will appear accordingly.

CAVEAT:

When using the TAO IDL compiler on files that are generated by this tool,
use the command line option -Sm on the IDL compiler, which will disable
the internal generation of equivalent IDL nodes in the AST. You'll notice
from the example below that the only ones that remain are eventtypes.
The -Sm option will prevent the IDL compiler from trying to create the
corresponding xxxConsumer interface, which now already exists explicitly
in IDL.

EXAMPLE CONVERSION:


// test.idl

#include <Components.idl>

interface Foo {};

eventtype Ev {};

component Bar
{
  uses multiple Foo needs_foo;
  publishes Ev ev_pub;
};

home BarHome manages Bar
{
};


Typing

tao_idl3_to_idl2 -I<CIAO_ROOT>/ciao -I<TAO_ROOT> test.idl

will generate



// test_IDL2.idl

#include "Components.idl"

interface Foo {};

eventtype Ev {};

interface EvConsumer : Components::EventConsumerBase
{
  void push_Ev (in Ev the_Ev);
};

interface Bar : Components::CCMObject
{
  struct needs_fooConnection
  {
    Foo objref;
    Components::Cookie ck;
  };
  
  typedef sequence<needs_fooConnection> needs_fooConnections;
  
  Components::Cookie connect_needs_foo (in Foo connection)
    raises (Components::ExceededConnectionLimit, Components::InvalidConnection);
  
  Foo disconnect_needs_foo (in Components::Cookie ck)
    raises (Components::InvalidConnection);
  
  needs_fooConnections get_connections_needs_foo ();
  
  Components::Cookie subscribe_ev_pub (in EvConsumer consumer)
    raises (Components::ExceededConnectionLimit);
  
  EvConsumer unsubscribe_ev_pub (in Components::Cookie ck)
    raises (Components::InvalidConnection);
};

interface BarHomeExplicit : Components::CCMHome
{
};

interface BarHomeImplicit : Components::KeylessCCMHome
{
  Bar create ()
    raises (Components::CreateFailure);
};

interface BarHome : BarHomeExplicit, BarHomeImplicit 
{
};