summaryrefslogtreecommitdiff
path: root/TAO/tests/Cubit/TAO/IDL_Cubit/cubit.idl
blob: 9ddc2d8954faee7522d533781ca9d3228bb4c693 (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
// $Id$

interface Cubit
  // = TITLE
  //    Defines an interface that encapsulates operations that cube
  //    numbers.
  //
  // = DESCRIPTION
  //    This interface encapsulates operations that cube
  //    octets, shorts, longs, structs and unions.

{
  octet	cube_octet (in octet o);
  // cube an octet

  short	cube_short (in short s);
  // cube a short

  long	cube_long (in long l);
  // cube a long

  struct Many
  {
    octet o;		// + 3 bytes padding (normally) ...
    long l;
    short s;		// + 2 bytes padding (normally) ...
  };

  Many cube_struct (in Many values);
  // Cube a struct

  enum discrim
  {
    e_0th,
    e_1st,
    e_2nd,
    e_3rd
  };
  // Enumeration of the different elements in a union.

  union oneof switch (discrim)
    {
      // this is an easy union to interpret; no padding
      // is needed between discriminant and value.
    case e_0th:
      octet o;
    case e_1st:
      short s;
    case e_2nd:
      long l;
    case e_3rd:
      Many cm;

      // default:
      // Many cm;
    };
  // Union of different types.

  oneof	cube_union (in oneof values);
  // cube a union.

  oneway void please_exit ();
  // shutdown the application.
};

interface Cubit_Factory
  // = TITLE
  //    Creates Cubit objects
{
  Cubit make_cubit (in string key);
};