1// 2// %CopyrightBegin% 3// 4// Copyright Ericsson AB 1999-2016. All Rights Reserved. 5// 6// Licensed under the Apache License, Version 2.0 (the "License"); 7// you may not use this file except in compliance with the License. 8// You may obtain a copy of the License at 9// 10// http://www.apache.org/licenses/LICENSE-2.0 11// 12// Unless required by applicable law or agreed to in writing, software 13// distributed under the License is distributed on an "AS IS" BASIS, 14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15// See the License for the specific language governing permissions and 16// limitations under the License. 17// 18// %CopyrightEnd% 19// 20 21#ifndef _ORBER_TEST_SERVER_IDL 22#define _ORBER_TEST_SERVER_IDL 23#pragma prefix "omg.org" 24 25module orber_parent { 26 interface inherrit { 27 void print(); 28 }; 29}; 30 31module orber_test { 32 33 // interface server 34 interface server : orber_parent::inherrit { 35 typedef string array[2]; 36 typedef sequence <long, 3> seq; 37 typedef wstring<6> WstrLength6; 38 typedef string<6> StrLength6; 39 40 struct struc {long a; short b;}; 41 union uni switch(long) { 42 case 1: long a;}; 43 44 union uni_d switch(long) { 45 case 1: long a; 46 default: boolean b; 47 }; 48 enum enumerant {one, two}; 49 50 exception UserDefinedException {}; 51 52 typedef sequence<struc> StrucSeq; 53 typedef sequence<uni> UniSeq; 54 exception ComplexUserDefinedException { StrucSeq strseq; }; 55 56 // Testing fixed 57 const fixed val1 = 3.14D; 58 const fixed val2 = 003.14D; 59 const fixed val3 = 003.1400D; 60 const fixed val4 = 3.1400D; 61 const fixed val5 = .1400D; 62 const fixed val6 = 3.D; 63 const fixed val7 = -.1400D; 64 const fixed val8 = -3.D; 65 const fixed val9 = val4+val5; 66 const fixed val10 = val4*val5; 67 const fixed val11 = val4/val5; 68 const fixed val12 = 123.140001D; 69 const fixed val13 = 12314000.1D; 70 const fixed val14 = val12-val13; 71 const fixed val15 = val12+val13; 72 const fixed val16 = val12*val13; 73 const fixed val17 = 2.01D+2.01D; 74 const fixed val18 = 2.01D*2.01D; 75 const fixed val19 = 200D; 76 const fixed val20 = 9999999999999999999999999999999D+9999999999999999999999999999999D; 77 const fixed val21 = 9999999999999999999999999999999D-9999999999999999999999999999999D; 78 const fixed val22 = 9999999999999999999999999999999D*9999999999999999999999999999999D; 79 const fixed val23 = 9999999999999999999999999999999D/9999999999999999999999999999999D; 80 const fixed val24 = 9999D+9999D; 81 const fixed val25 = 400D/10D; 82 const fixed val26 = 9999999999999999999999999999999D; 83 84 85 typedef fixed<5,2> fixed52; 86 const fixed52 fixed52const1 = 123.45d; 87 const fixed52 fixed52const2 = 123.00d; 88 const fixed52 fixed52const3 = 023.00d; 89 const fixed52 fixed52negconst1 = -123.45d; 90 const fixed52 fixed52negconst2 = -123.00d; 91 const fixed52 fixed52negconst3 = -023.00d; 92 93 struct rec_struct; // Forward declaration 94 typedef sequence<rec_struct> rec_struct_seq; 95 struct rec_struct { 96 rec_struct_seq chain; 97 }; 98 99 100 union rec_union; // Forward declaration 101 typedef sequence<rec_union>rec_union_seq; 102 103 enum MyEnum {RecursiveType, NameType}; 104 105 union rec_union switch (MyEnum) { 106 case RecursiveType : rec_union_seq chain; 107 case NameType : string aName; 108 }; 109 110 void stop_normal(); 111 112 void stop_brutal(); 113 114 // Testing encode and decode 115 void testing_iiop_float(inout float Fl); 116 void testing_iiop_double(inout double Do); 117 void testing_iiop_short(inout short Sh); 118 void testing_iiop_ushort(inout unsigned short Us); 119 void testing_iiop_long(inout long Lo); 120 void testing_iiop_longlong(inout long long LLo); 121 void testing_iiop_ulong(inout unsigned long Ulo); 122 void testing_iiop_ulonglong(inout unsigned long long LLo); 123 void testing_iiop_char(inout char Ch); 124 void testing_iiop_wchar(inout wchar WCh); 125 void testing_iiop_bool(inout boolean Bool); 126 void testing_iiop_octet(inout octet Oct); 127 void testing_iiop_any(inout any AnyType); 128 void testing_iiop_obj(inout Object Obj); 129 void testing_iiop_string(inout StrLength6 Str); 130 void testing_iiop_wstring(inout WstrLength6 WStr); 131 void testing_iiop_struct(inout struc Stru); 132 void testing_iiop_union(inout uni Uni); 133 void testing_iiop_union_d(inout uni_d Uni); 134 void testing_iiop_enum(inout enumerant Enumerant); 135 void testing_iiop_seq(inout seq Seq); 136 void testing_iiop_uni_seq(inout UniSeq USeq); 137 void testing_iiop_struc_seq(inout StrucSeq SSeq); 138 void testing_iiop_array(inout array Arr); 139 void testing_iiop_fixed(inout fixed52 MyFixed); 140 void testing_iiop_void(); 141 void testing_iiop_context(); 142 void testing_iiop_server_marshal(inout StrLength6 Str); 143 144 // Recursive types 145 any testing_iiop_rec_any(in any RecType); 146 rec_struct testing_iiop_rec_struct(in rec_struct RecS); 147 rec_union testing_iiop_rec_union(in rec_union RecU); 148 149 150 oneway void testing_iiop_oneway_delay(in long Time); 151 void testing_iiop_twoway_delay(in long Time); 152 153 // Testing relay calls/casts to, for example, test that sending implicit 154 // Contexts works. 155 void relay_call(in Object Target); 156 oneway void relay_cast(in Object Target); 157 158 // Testing pseudo calls/casts 159 void pseudo_call(); 160 oneway void pseudo_cast(); 161 void pseudo_call_delay(inout long Lo); 162 oneway void pseudo_cast_delay(in long Lo); 163 void pseudo_call_raise_exc(in long Lo); 164 void raise_local_exception() 165 raises(UserDefinedException); 166 void raise_complex_local_exception() 167 raises(ComplexUserDefinedException); 168 }; 169 170 interface timeout_server { 171 oneway void oneway_function(in long time); 172 void twoway_function(in long time); 173 }; 174 175}; 176 177#endif 178