summaryrefslogtreecommitdiff
path: root/TAO/tao/DynamicAny/DynamicAny.pidl
blob: a8d9aaaa2434abe63a2e0f55a1a7b71ea3fc7715 (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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
// -*- IDL -*-

/**
 * @file DynamicAny.pidl
 *
 * $Id$
 *
 * @brief IDL source for the DynamicAny module.
 *
 * This file is used to generate the code in DynamicAnyC.{h,cpp}, it
 * was obtained from the OMG website as part of the full CORBA IDL,
 * the document reference number is: formal/04-03-01, or use the
 * following URL:
 * http://www.omg.org/technology/documents/formal/corba_omg_idl_text_file.htm
 *
 * We couldn't find a copyright notice in the document, but it is safe
 * to assume that it is Copyright (C) 2004, OMG.
 *
 */

#ifndef _DYNAMIC_ANY_IDL_
#define _DYNAMIC_ANY_IDL_

#include "tao/Typecode_types.pidl"
#include "tao/BooleanSeq.pidl"
#include "tao/CharSeq.pidl"
#include "tao/DoubleSeq.pidl"
#include "tao/FloatSeq.pidl"
#include "tao/LongDoubleSeq.pidl"
#include "tao/LongLongSeq.pidl"
#include "tao/LongSeq.pidl"
#include "tao/OctetSeq.pidl"
#include "tao/BooleanSeq.pidl"
#include "tao/ShortSeq.pidl"
#include "tao/ULongLongSeq.pidl"
#include "tao/ULongSeq.pidl"
#include "tao/UShortSeq.pidl"
#include "tao/WCharSeq.pidl"

module DynamicAny
{
  typeprefix DynamicAny "omg.org";

  local interface DynAny
  {
    exception InvalidValue {};
    exception TypeMismatch {};

    CORBA::TypeCode type ();

    void assign (in DynAny dyn_any)
      raises (TypeMismatch);
      
    void from_any (in any value)
      raises (TypeMismatch, InvalidValue);
      
    any to_any ();
    
    boolean equal (in DynAny dyn_any);
    
    void destroy ();
    
    DynAny copy ();
    
    void insert_boolean (in boolean value)
      raises (TypeMismatch, InvalidValue);
    void insert_octet (in octet value)
      raises (TypeMismatch, InvalidValue);
    void insert_char (in char value)
      raises (TypeMismatch, InvalidValue);
    void insert_short (in short value)
      raises (TypeMismatch, InvalidValue);
    void insert_ushort (in unsigned short value)
      raises (TypeMismatch, InvalidValue);
    void insert_long (in long value)
      raises (TypeMismatch, InvalidValue);
    void insert_ulong (in unsigned long value)
      raises (TypeMismatch, InvalidValue);
    void insert_float (in float value)
      raises (TypeMismatch, InvalidValue);
    void insert_double (in double value)
      raises (TypeMismatch, InvalidValue);
    void insert_string (in string value)
      raises (TypeMismatch, InvalidValue);
    void insert_reference (in Object value)
      raises (TypeMismatch, InvalidValue);
    void insert_typecode (in CORBA::TypeCode value)
      raises (TypeMismatch, InvalidValue);
    void insert_longlong (in long long value)
      raises (TypeMismatch, InvalidValue);
    void insert_ulonglong (in unsigned long long value)
      raises (TypeMismatch, InvalidValue);
    void insert_longdouble (in long double value)
      raises (TypeMismatch, InvalidValue);
    void insert_wchar (in wchar value)
      raises (TypeMismatch, InvalidValue);
    void insert_wstring (in wstring value)
      raises (TypeMismatch, InvalidValue);
    void insert_any (in any value)
      raises (TypeMismatch, InvalidValue);
    void insert_dyn_any (in DynAny value)
      raises (TypeMismatch, InvalidValue);
    void insert_val (in ValueBase value)
      raises (TypeMismatch, InvalidValue);

    boolean get_boolean ()
      raises (TypeMismatch, InvalidValue);
    octet get_octet ()
      raises (TypeMismatch, InvalidValue);
    char get_char ()
      raises (TypeMismatch, InvalidValue);
    short get_short ()
      raises (TypeMismatch, InvalidValue);
    unsigned short get_ushort ()
      raises (TypeMismatch, InvalidValue);
    long get_long ()
      raises (TypeMismatch, InvalidValue);
    unsigned long get_ulong ()
      raises (TypeMismatch, InvalidValue);
    float get_float ()
      raises (TypeMismatch, InvalidValue);
    double get_double ()
      raises (TypeMismatch, InvalidValue);
    string get_string ()
      raises (TypeMismatch, InvalidValue);
    Object get_reference ()
      raises (TypeMismatch, InvalidValue);
    CORBA::TypeCode get_typecode ()
      raises (TypeMismatch, InvalidValue);
    long long get_longlong ()
      raises (TypeMismatch, InvalidValue);
    unsigned long long get_ulonglong ()
      raises (TypeMismatch, InvalidValue);
    long double get_longdouble ()
      raises (TypeMismatch, InvalidValue);
    wchar get_wchar ()
      raises (TypeMismatch, InvalidValue);
    wstring get_wstring ()
      raises (TypeMismatch, InvalidValue);
    any get_any ()
      raises (TypeMismatch, InvalidValue);
    DynAny get_dyn_any ()
      raises (TypeMismatch, InvalidValue);
    ValueBase get_val ()
      raises (TypeMismatch, InvalidValue);

    boolean seek (in long index);
    
    void rewind ();
    
    boolean next ();
    
    unsigned long component_count ();
    
    DynAny current_component ()
      raises (TypeMismatch);
    
    void insert_abstract (in CORBA::AbstractBase value)
      raises (TypeMismatch, InvalidValue);
      
    CORBA::AbstractBase get_abstract ()
      raises (TypeMismatch, InvalidValue);

    void insert_boolean_seq (in CORBA::BooleanSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_octet_seq (in CORBA::OctetSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_char_seq (in CORBA::CharSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_short_seq (in CORBA::ShortSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_ushort_seq (in CORBA::UShortSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_long_seq (in CORBA::LongSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_ulong_seq (in CORBA::ULongSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_float_seq (in CORBA::FloatSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_double_seq (in CORBA::DoubleSeq value)
      raises (TypeMismatch, InvalidValue);  
    void insert_longlong_seq (in CORBA::LongLongSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_ulonglong_seq (in CORBA::ULongLongSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_longdouble_seq (in CORBA::LongDoubleSeq value)
      raises (TypeMismatch, InvalidValue);
    void insert_wchar_seq (in CORBA::WCharSeq value)
      raises (TypeMismatch, InvalidValue);
      
    CORBA::BooleanSeq get_boolean_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::OctetSeq get_octet_seq()
      raises (TypeMismatch, InvalidValue);
    CORBA::CharSeq get_char_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::ShortSeq get_short_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::UShortSeq get_ushort_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::LongSeq get_long_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::ULongSeq get_ulong_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::FloatSeq get_float_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::DoubleSeq get_double_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::LongLongSeq get_longlong_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::ULongLongSeq get_ulonglong_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::LongDoubleSeq get_longdouble_seq ()
      raises (TypeMismatch, InvalidValue);
    CORBA::WCharSeq get_wchar_seq ()
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynFixed : DynAny
  {
    string get_value ();
    
    boolean set_value (in string val)
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynEnum : DynAny
  {
    string get_as_string ();
    
    void set_as_string (in string value)
      raises (InvalidValue);
      
    unsigned long get_as_ulong ();
    
    void set_as_ulong (in unsigned long value)
      raises (InvalidValue);
  };
  
  typedef string FieldName;
  
  struct NameValuePair
  {
    FieldName id;
    any value;
  };

  typedef sequence<NameValuePair> NameValuePairSeq;
  
  struct NameDynAnyPair
  {
    FieldName id;
    DynAny value;
  };

  typedef sequence<NameDynAnyPair> NameDynAnyPairSeq;
  
  local interface DynStruct : DynAny
  {
    FieldName current_member_name ()
      raises (TypeMismatch, InvalidValue);
      
    CORBA::TCKind current_member_kind ()
      raises (TypeMismatch, InvalidValue);
      
    NameValuePairSeq get_members ();
    
    void set_members (in NameValuePairSeq value)
      raises (TypeMismatch, InvalidValue);
      
    NameDynAnyPairSeq get_members_as_dyn_any ();
    
    void set_members_as_dyn_any (in NameDynAnyPairSeq value)
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynUnion : DynAny
  {
    DynAny get_discriminator ();
    
    void set_discriminator (in DynAny d)
      raises (TypeMismatch);
    
    void set_to_default_member ()
      raises (TypeMismatch);
      
    void set_to_no_active_member ()
      raises (TypeMismatch);
      
    boolean has_no_active_member ();
    
    CORBA::TCKind discriminator_kind ();
    
    DynAny member () raises (InvalidValue);
    
    FieldName member_name ()
      raises (InvalidValue);
      
    CORBA::TCKind member_kind ()
      raises (InvalidValue);
  };

  typedef sequence<any> AnySeq;
  typedef sequence<DynAny> DynAnySeq;
  
  local interface DynSequence : DynAny
  {
    unsigned long get_length ();
    
    void set_length (in unsigned long len)
      raises (InvalidValue);
      
    AnySeq get_elements ();
    
    void set_elements (in AnySeq value)
      raises (TypeMismatch, InvalidValue);
      
    DynAnySeq get_elements_as_dyn_any ();
    
    void set_elements_as_dyn_any (in DynAnySeq value)
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynArray : DynAny
  {
    AnySeq get_elements ();
    
    void set_elements (in AnySeq value)
      raises (TypeMismatch, InvalidValue);
      
    DynAnySeq get_elements_as_dyn_any ();
    
    void set_elements_as_dyn_any (in DynAnySeq value)
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynValueCommon : DynAny
  {
    boolean is_null ();
    
    void set_to_null ();
    
    void set_to_value ();
  };

  local interface DynValue : DynValueCommon
  {
    FieldName current_member_name ()
      raises (TypeMismatch, InvalidValue);
      
    CORBA::TCKind current_member_kind ()
      raises (TypeMismatch, InvalidValue);
      
    NameValuePairSeq get_members ();
    
    void set_members (in NameValuePairSeq value)
      raises (TypeMismatch, InvalidValue);
      
    NameDynAnyPairSeq get_members_as_dyn_any ();
    
    void set_members_as_dyn_any (in NameDynAnyPairSeq value)
      raises (TypeMismatch, InvalidValue);
  };

  local interface DynValueBox : DynValueCommon
  {
    any get_boxed_value ()
      raises (InvalidValue);
      
    void set_boxed_value (in any boxed)
      raises (TypeMismatch, InvalidValue);
      
    DynAny get_boxed_value_as_dyn_any ()
      raises (InvalidValue);
      
    void set_boxed_value_as_dyn_any (in DynAny boxed)
      raises (TypeMismatch);
  };
  
  exception MustTruncate {};

  local interface DynAnyFactory
  {
    exception InconsistentTypeCode {};
    
    DynAny create_dyn_any (in any value)
      raises (InconsistentTypeCode);
    DynAny create_dyn_any_from_type_code (in CORBA::TypeCode type)
      raises (InconsistentTypeCode);
      
    DynAny create_dyn_any_without_truncation (in any value)
      raises (InconsistentTypeCode, MustTruncate);
      
    DynAnySeq create_multiple_dyn_anys (in AnySeq values,
                                        in boolean allow_truncate)
      raises (InconsistentTypeCode, MustTruncate);
      
    AnySeq create_multiple_anys (in DynAnySeq values);
  };
}; // module DynamicAny

#endif // _DYNAMIC_ANY_IDL_