summaryrefslogtreecommitdiff
path: root/TAO/tests/IDL_Test/valuetype.idl
blob: 206422bc5943c9df55f5d0b3df157f703d8d38b5 (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
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/tests/IDL_Test
//
// = FILENAME
//    valuetype.idl
//
// = DESCRIPTION
//    This file contains examples of IDL code that has
//    caused problems in the past for the TAO IDL
//    compiler. This test is to make sure the problems
//    stay fixed.
//
// = AUTHORS
//    Gary Duzan <gduzan@bbn.com>
//    Jeff Parsons <j.parsons@vanderbilt.edu>
//
// ============================================================================

#ifndef IDL_TEST_VALUETYPE_IDL
#define IDL_TEST_VALUETYPE_IDL

#include "included.idl"

// A valuetype factory can have exceptions, so the declaration must pull in
// an #include of SystemException.h.
valuetype MyValueType
{
  public string my_string_value;
  factory make_one ();
};

enum ValueSort2 {
  SYMBOL_TYPE2
};

union MyValueTypeUnion switch (ValueSort2) {
  case SYMBOL_TYPE2:
    MyValueType symbol_val;
};

// The original bug was caused by the default factory visitor
// constructing a temporary arg of this field type. When the
// arg was then destroyed, it called its base destroyer
// AST_Field::destroy() which in turn destroyed the member
// because it was anonymous. This declaration was copied from
// an unautomated TAO/tests directory and authored by Simon McQueen
// <sm@prismtechnologies>.
valuetype RecValueType
{
  private sequence<RecValueType> rec_value_types;
};

// Inherits an anonymous sequence member, which was not named
// correctly in the original bug when used in the arglist for
// this valuetype's constructor from values.
valuetype GetsDeprecatedMember : IncludedBase
{
  public string StringMember;
};

valuetype Recursive2;
typedef sequence<Recursive2> Recursive2Seq2;

valuetype Recursive2
{
  public struct Innerstruct3a
  {
    Recursive2Seq2 recursive_unions;
  } insa;
  public short a;
  public struct Innerstruct3b
  {
    Recursive2Seq2 recursive_second;
  } insb;
};

valuetype Recursive3;
typedef sequence<Recursive3> RecursiveSeq3;

valuetype Recursive3
{
  public RecursiveSeq3 seq1;
  public short a;
  public RecursiveSeq3 seq2;
};

#endif /* IDL_TEST_VALUETYPE_IDL */