1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#pragma once
6
7module Test
8{
9
10class SBase
11{
12    string sb;
13}
14
15class SBSKnownDerived extends SBase
16{
17    string sbskd;
18}
19
20class B
21{
22    string sb;
23    B pb;
24}
25
26class D1 extends B
27{
28    string sd1;
29    B pd1;
30}
31
32sequence<B> BSeq;
33
34class SS1
35{
36    BSeq s;
37}
38
39class SS2
40{
41    BSeq s;
42}
43
44struct SS3
45{
46    SS1 c1;
47    SS2 c2;
48}
49
50dictionary<int, B> BDict;
51
52exception BaseException
53{
54    string sbe;
55    B pb;
56}
57
58exception DerivedException extends BaseException
59{
60    string sde;
61    D1 pd1;
62}
63
64class Forward;
65
66class PBase
67{
68    int pi;
69}
70
71sequence<PBase> PBaseSeq;
72
73["preserve-slice"]
74class Preserved extends PBase
75{
76    string ps;
77}
78
79class PDerived extends Preserved
80{
81    PBase pb;
82}
83
84["preserve-slice"]
85class PNode
86{
87    PNode next;
88}
89
90["preserve-slice"]
91exception PreservedException
92{
93}
94
95["amd", "format:sliced"]
96interface TestIntf
97{
98    Object SBaseAsObject();
99    SBase SBaseAsSBase();
100    SBase SBSKnownDerivedAsSBase();
101    SBSKnownDerived SBSKnownDerivedAsSBSKnownDerived();
102
103    SBase SBSUnknownDerivedAsSBase();
104
105    ["format:compact"] SBase SBSUnknownDerivedAsSBaseCompact();
106
107    Object SUnknownAsObject();
108    void checkSUnknown(Object o);
109
110    B oneElementCycle();
111    B twoElementCycle();
112    B D1AsB();
113    D1 D1AsD1();
114    B D2AsB();
115
116    void paramTest1(out B p1, out B p2);
117    void paramTest2(out B p2, out B p1);
118    B paramTest3(out B p1, out B p2);
119    B paramTest4(out B p);
120
121    B returnTest1(out B p1, out B p2);
122    B returnTest2(out B p2, out B p1);
123    B returnTest3(B p1, B p2);
124
125    SS3 sequenceTest(SS1 p1, SS2 p2);
126
127    BDict dictionaryTest(BDict bin, out BDict bout);
128
129    PBase exchangePBase(PBase pb);
130
131    Preserved PBSUnknownAsPreserved();
132    void checkPBSUnknown(Preserved p);
133
134    Preserved PBSUnknownAsPreservedWithGraph();
135    void checkPBSUnknownWithGraph(Preserved p);
136
137    Preserved PBSUnknown2AsPreservedWithGraph();
138    void checkPBSUnknown2WithGraph(Preserved p);
139
140    PNode exchangePNode(PNode pn);
141
142    void throwBaseAsBase() throws BaseException;
143    void throwDerivedAsBase() throws BaseException;
144    void throwDerivedAsDerived() throws DerivedException;
145    void throwUnknownDerivedAsBase() throws BaseException;
146    void throwPreservedException() throws PreservedException;
147
148    void useForward(out Forward f); /* Use of forward-declared class to verify that code is generated correctly. */
149
150    void shutdown();
151}
152
153class Hidden
154{
155    Forward f;
156}
157
158class Forward
159{
160    Hidden h;
161}
162
163}
164