aboutsummaryrefslogtreecommitdiffstats
path: root/lib/orber/test/orber_test_server.idl
blob: f274baed24f3a82046d42425ef354a5859ae8fe4 (plain) (blame)
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
167
168
169
170
171
172
173
174
175
176
177
//
// %CopyrightBegin%
//
// Copyright Ericsson AB 1999-2016. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// %CopyrightEnd%
//

#ifndef _ORBER_TEST_SERVER_IDL
#define _ORBER_TEST_SERVER_IDL
#pragma prefix "omg.org"

module orber_parent {
  interface inherrit {
    void print();
  };
};

module orber_test { 

  // interface server
  interface server : orber_parent::inherrit {
    typedef string array[2];
    typedef sequence <long, 3> seq;
    typedef wstring<6> WstrLength6;
    typedef string<6> StrLength6;

    struct  struc {long a; short b;};
    union uni switch(long) {
    case 1: long a;}; 
      
    union uni_d switch(long) {
    case 1: long a;
    default: boolean b;
    }; 
    enum enumerant {one, two};

    exception UserDefinedException {};

    typedef sequence<struc> StrucSeq;
    typedef sequence<uni> UniSeq;
    exception ComplexUserDefinedException { StrucSeq strseq; };

    // Testing fixed
    const fixed val1 = 3.14D;
    const fixed val2 = 003.14D;
    const fixed val3 = 003.1400D;
    const fixed val4 = 3.1400D;
    const fixed val5 = .1400D;
    const fixed val6 = 3.D;
    const fixed val7 = -.1400D;
    const fixed val8 = -3.D;
    const fixed val9 = val4+val5;
    const fixed val10 = val4*val5;
    const fixed val11 = val4/val5;
    const fixed val12 = 123.140001D;
    const fixed val13 = 12314000.1D;
    const fixed val14 = val12-val13;
    const fixed val15 = val12+val13;
    const fixed val16 = val12*val13;
    const fixed val17 = 2.01D+2.01D;
    const fixed val18 = 2.01D*2.01D;
    const fixed val19 = 200D;
    const fixed val20 = 9999999999999999999999999999999D+9999999999999999999999999999999D;
    const fixed val21 = 9999999999999999999999999999999D-9999999999999999999999999999999D;
    const fixed val22 = 9999999999999999999999999999999D*9999999999999999999999999999999D;
    const fixed val23 = 9999999999999999999999999999999D/9999999999999999999999999999999D;
    const fixed val24 = 9999D+9999D;
    const fixed val25 = 400D/10D;
    const fixed val26 = 9999999999999999999999999999999D;


    typedef fixed<5,2> fixed52;
    const fixed52 fixed52const1 = 123.45d;
    const fixed52 fixed52const2 = 123.00d;
    const fixed52 fixed52const3 = 023.00d;
    const fixed52 fixed52negconst1 = -123.45d;
    const fixed52 fixed52negconst2 = -123.00d;
    const fixed52 fixed52negconst3 = -023.00d;

    struct rec_struct; // Forward declaration
    typedef sequence<rec_struct> rec_struct_seq;
    struct rec_struct {
	rec_struct_seq chain;
    };
    
    
    union rec_union; // Forward declaration
    typedef sequence<rec_union>rec_union_seq;
    
    enum MyEnum {RecursiveType, NameType};
    
    union rec_union switch (MyEnum) {
    case RecursiveType : rec_union_seq chain;
    case NameType :  string aName;
    };
    
    void stop_normal();

    void stop_brutal();

    // Testing encode and decode
    void testing_iiop_float(inout  float          Fl);
    void testing_iiop_double(inout double         Do);
    void testing_iiop_short(inout  short          Sh);
    void testing_iiop_ushort(inout unsigned short Us);
    void testing_iiop_long(inout   long           Lo);
    void testing_iiop_longlong(inout long long   LLo);
    void testing_iiop_ulong(inout  unsigned long  Ulo);
    void testing_iiop_ulonglong(inout unsigned long long LLo);
    void testing_iiop_char(inout   char           Ch);
    void testing_iiop_wchar(inout   wchar         WCh);
    void testing_iiop_bool(inout   boolean        Bool);
    void testing_iiop_octet(inout  octet          Oct);
    void testing_iiop_any(inout    any            AnyType);
    void testing_iiop_obj(inout    Object         Obj);
    void testing_iiop_string(inout StrLength6     Str);
    void testing_iiop_wstring(inout WstrLength6   WStr);
    void testing_iiop_struct(inout struc          Stru);
    void testing_iiop_union(inout  uni            Uni);
    void testing_iiop_union_d(inout  uni_d        Uni);
    void testing_iiop_enum(inout   enumerant      Enumerant);
    void testing_iiop_seq(inout    seq            Seq);
    void testing_iiop_uni_seq(inout    UniSeq     USeq);
    void testing_iiop_struc_seq(inout  StrucSeq   SSeq);
    void testing_iiop_array(inout  array          Arr);
    void testing_iiop_fixed(inout  fixed52        MyFixed);
    void testing_iiop_void();
    void testing_iiop_context();
    void testing_iiop_server_marshal(inout StrLength6 Str);

    // Recursive types
    any testing_iiop_rec_any(in any RecType);
    rec_struct testing_iiop_rec_struct(in rec_struct RecS);
    rec_union testing_iiop_rec_union(in rec_union RecU);


    oneway void testing_iiop_oneway_delay(in long Time);
    void testing_iiop_twoway_delay(in long Time);

    // Testing relay calls/casts to, for example, test that sending implicit
    // Contexts works.
    void relay_call(in Object Target);
    oneway void relay_cast(in Object Target);

    // Testing pseudo calls/casts
    void pseudo_call();
    oneway void pseudo_cast();
    void pseudo_call_delay(inout    long           Lo);
    oneway void pseudo_cast_delay(in long         Lo);
    void pseudo_call_raise_exc(in  long           Lo);
    void raise_local_exception() 
      raises(UserDefinedException);
    void raise_complex_local_exception() 
      raises(ComplexUserDefinedException);
  };
 
  interface timeout_server {
    oneway void oneway_function(in long time);
    void twoway_function(in long time);
  };
 
}; 
 
#endif