summaryrefslogtreecommitdiff
path: root/modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl
blob: 2addbda8afb10fc56518289cdd88846a04a1bf8f (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// $Id$
/**
 * @file KitchenSink.idl
 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
 *
 * Tests TAO_IDL generation of CIAO servant, executor IDL
 * and executor implementation stencil for a variety of
 * IDL3+ constructs.
 */

#include <Components.idl>

module mod
{
  valuetype future_key : Components::PrimaryKeyBase
  {
    public string info;
  };
};

interface iface
{
  exception iface_excep {};
};

typedef sequence<iface> ifaceSeq;

eventtype ev
{
};

module GlobalTyped<typename A, typename B>
{
  typedef short x;
};

module A
{
  local interface C
  {
  };

  module Nested<typename T, sequence <T> TSeq>
  {
    typedef short y;

    interface XX
    {
    };

    // A regular module may be nested inside a template module,
    // but another template module may not.
    module GoodNested
    {
      typedef long Lo;
    };
/*
    module BadNested<typename S>
    {
      typedef S S_Tdef;
    };
*/
  };

  module Nested<iface, ifaceSeq> Nested_Inst;
};

module second<exception X, typename W>
{
  typedef short sho;

  valuetype pkey : Components::PrimaryKeyBase
  {
    public long id_key;
  };
};

module B
{
  module second_B<typename T, sequence <T> TSeq>
  {
    alias A::Nested<T, TSeq> NestedA;

    interface do : NestedA::XX
    {
    };
  };
};

module Ast<typename T,
           eventtype E,
           exception S,
           valuetype V,
           sequence<T> TSeq,
           const unsigned long M>
{
  interface Foo : T
  {
    attribute T Foo_Attr;

    void Foo_Op (in TSeq inarg) raises (S);
  };

  alias second<T, S> second_ref;

  valuetype VT_T : V supports T
  {
  };

  porttype PT_T
  {
    provides iface iface_facet;
    uses multiple T T_Recep;
  };

  component Comp_T
  {
    uses multiple T Comp_T_Recep;
    mirrorport PT_T Comp_T_Mirror_Port;
    provides T Comp_T_Facet;
    emits E Comp_T_Emit;

    // Tests unique lookup mechanism for types referenced
    // from an aliased template module.
    attribute second_ref::sho sho_attr;
  };

  home Comp_T_Home manages Comp_T primarykey second_ref::pkey
  {
    factory create_Comp_T (in TSeq inarg);
    finder find_Comp_T (in T inarg);
  };

  // TAO IDL compiler uses the same code for both component
  // and home 'supports' constructs, so we test it here
  // where there is no conflict with the port interfaces.
  home Comp_T_Home_2 supports T manages Comp_T primarykey V
  {
  };

  connector Conn_T
  {
    port PT_T Conn_T_Port;
    provides T Conn_T_Facet;
  };

  const unsigned long Ast_Const = M;
  const unsigned long LC = 7;
  typedef sequence<T, M> AnotherTSeq;

  struct boo
  {
    T T_field;
  };

  typedef T T_array[M][Ast_Const][LC];
};

module Ast<iface,
           ev,
           iface::iface_excep,
           mod::future_key,
           ifaceSeq,
           101>
  Ast_Inst;