summaryrefslogtreecommitdiff
path: root/TAO/CIAO/docs/value_factory_registration.html
blob: 66a4804cdada24701061c158e694ef27cf9704a2 (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
        <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
        <html>
                <head>
                                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                                                <meta name="Author" content="Jeff Parsons">
                                                                <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
                                                                                <title>Registration of Valuetype Factories for Event Sinks</title>
                                                                                                <!-- $Id$ -->
                                                                                                        </head>
                                                                                                                <body>
                                                                                                                        <h3>Registration of Valuetype Factories for Event Sinks</h3>
                                                                                                                                        <p>Components with one or more event sink (consumer) ports will need to have a
                                                                                                                                                                valuetype factory registered with the underlying ORB in order to correctly
                                                                                                                                                                                        demarshal the state of eventtypes it receives over the wire.</p>
                                                                                                                                                                                                        <p>For the common case (eventtypes that contain only one or more state members),
                                                                                                                                                                                                                                the IDL compiler generates a concrete class with a name constructed from the
                                                                                                                                                                                                                                                        valuetype name and an '_init' suffix, and the CIDL compiler generates a macro
                                                                                                                                                                                                                                                                                in the servant constructor that registers this factory with the container's
                                                                                                                                                                                                                                                                                                        ORB. However, an eventtype, like any valuetype, may also contain operation
                                                                                                                                                                                                                                                                                                                                and/or factory declarations. In these cases things are not so simple. For
                                                                                                                                                                                                                                                                                                                                                        example a factory declaration in an IDL valuetype or eventtype will generate a
                                                                                                                                                                                                                                                                                                                                                                                pure virtual function of the same name in the associated _init class, meaning
                                                                                                                                                                                                                                                                                                                                                                                                        that ORB factory registration for this type must be with a derived factory
                                                                                                                                                                                                                                                                                                                                                                                                                                class written by the application developer. The table below shows all possible
                                                                                                                                                                                                                                                                                                                                                                                                                                                        cases of IDL compiler factory generation.</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <TABLE BORDER="4" CELLSPACING="4" CELLPADDING="4" ID="Table1">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <TR>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <TD></TD>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <TD><b>Has Operation</b></TD>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <TD><b>Has No Operation</b></TD>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </TR>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td><b>Has Factory</b></td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td>ABSTRACT FACTORY</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td>ABSTRACT FACTORY</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td><b>Has No Factory</b></td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td>NO FACTORY</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <td>CONCRETE FACTORY</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </TABLE>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <p>The CIAO CIDL compiler will generate a macro to register the factory with the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                container's ORB only in the case where a concrete factory is generated by the
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        IDL compiler, and thus no subclassing is necessary. There is also a command
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                line option for the CIDL compiler, <tt>--suppress-register-factory</tt>,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        that turns off generation of the macro in all cases.</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </body>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </html>