author | ohair |
Tue, 25 May 2010 15:52:11 -0700 | |
changeset 5555 | b2b5ed3f0d0d |
parent 2192 | 7e916cf3102a |
permissions | -rw-r--r-- |
4 | 1 |
/* |
5555 | 2 |
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. |
4 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5555 | 7 |
* published by the Free Software Foundation. Oracle designates this |
4 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5555 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
4 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5555 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
4 | 24 |
*/ |
25 |
||
26 |
// IDL |
|
27 |
// File: DynamicAny.idl |
|
28 |
||
29 |
#ifndef _DYNAMIC_ANY_IDL_ |
|
30 |
#define _DYNAMIC_ANY_IDL_ |
|
31 |
||
32 |
#pragma prefix "omg.org" |
|
33 |
#include <orb.idl> |
|
34 |
||
35 |
/** |
|
36 |
* An any can be passed to a program that doesn't have any static information for the |
|
37 |
type of the any (code generated for the type by an IDL compiler has not been |
|
38 |
compiled with the object implementation). As a result, the object receiving the any |
|
39 |
does not have a portable method of using it. |
|
40 |
<P>DynAnys enable traversal of the data value associated with an any at |
|
41 |
runtime and extraction of the primitive constituents of the data value. This is especially |
|
42 |
helpful for writing powerful generic servers (bridges, event channels supporting |
|
43 |
filtering). |
|
44 |
<P>Similarly, this facility enables the construction of an any at runtime, without having |
|
45 |
static knowledge of its type. This is especially helpful for writing generic clients |
|
46 |
(bridges, browsers, debuggers, user interface tools). |
|
47 |
*/ |
|
48 |
module DynamicAny { |
|
49 |
/** |
|
50 |
* Any values can be dynamically interpreted (traversed) and constructed through DynAny objects. |
|
51 |
* A DynAny object is associated with a data value which corresponds to a copy of the value |
|
52 |
* inserted into an any. |
|
53 |
* <P>A DynAny object may be viewed as an ordered collection of component DynAnys. |
|
54 |
* For DynAnys representing a basic type, such as long, or a type without components, |
|
55 |
* such as an empty exception, the ordered collection of components is empty. |
|
56 |
* Each DynAny object maintains the notion of a current position into its collection |
|
57 |
* of component DynAnys. The current position is identified by an index value that runs |
|
58 |
* from 0 to n-1, where n is the number of components. |
|
59 |
* The special index value -1 indicates a current position that points nowhere. |
|
60 |
* For values that cannot have a current position (such as an empty exception), |
|
61 |
* the index value is fixed at -1. |
|
62 |
* If a DynAny is initialized with a value that has components, the index is initialized to 0. |
|
63 |
* After creation of an uninitialized DynAny (that is, a DynAny that has no value but a TypeCode |
|
64 |
* that permits components), the current position depends on the type of value represented by |
|
65 |
* the DynAny. (The current position is set to 0 or -1, depending on whether the new DynAny |
|
66 |
* gets default values for its components.) |
|
67 |
* <P>The iteration operations rewind, seek, and next can be used to change the current position |
|
68 |
* and the current_component operation returns the component at the current position. |
|
69 |
* The component_count operation returns the number of components of a DynAny. |
|
70 |
* Collectively, these operations enable iteration over the components of a DynAny, for example, |
|
71 |
* to (recursively) examine its contents. |
|
72 |
* <P>A constructed DynAny object is a DynAny object associated with a constructed type. |
|
73 |
* There is a different interface, inheriting from the DynAny interface, associated with |
|
74 |
* each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array, |
|
75 |
* exception, and value type). |
|
76 |
* <P>A constructed DynAny object exports operations that enable the creation of new DynAny objects, |
|
77 |
* each of them associated with a component of the constructed data value. |
|
78 |
* As an example, a DynStruct is associated with a struct value. This means that the DynStruct |
|
79 |
* may be seen as owning an ordered collection of components, one for each structure member. |
|
80 |
* The DynStruct object exports operations that enable the creation of new DynAny objects, |
|
81 |
* each of them associated with a member of the struct. |
|
82 |
* <P>If a DynAny object has been obtained from another (constructed) DynAny object, |
|
83 |
* such as a DynAny representing a structure member that was created from a DynStruct, |
|
84 |
* the member DynAny is logically contained in the DynStruct. |
|
85 |
* Calling an insert or get operation leaves the current position unchanged. |
|
86 |
* Destroying a top-level DynAny object (one that was not obtained as a component of another DynAny) |
|
87 |
* also destroys any component DynAny objects obtained from it. |
|
88 |
* Destroying a non-top level DynAny object does nothing. |
|
89 |
* Invoking operations on a destroyed top-level DynAny or any of its descendants raises OBJECT_NOT_EXIST. |
|
90 |
* If the programmer wants to destroy a DynAny object but still wants to manipulate some component |
|
91 |
* of the data value associated with it, then he or she should first create a DynAny for the component |
|
92 |
* and, after that, make a copy of the created DynAny object. |
|
93 |
* <P>The behavior of DynAny objects has been defined in order to enable efficient implementations |
|
94 |
* in terms of allocated memory space and speed of access. DynAny objects are intended to be used |
|
95 |
* for traversing values extracted from anys or constructing values of anys at runtime. |
|
96 |
* Their use for other purposes is not recommended. |
|
97 |
* <P>Insert and get operations are necessary to handle basic DynAny objects |
|
98 |
* but are also helpful to handle constructed DynAny objects. |
|
99 |
* Inserting a basic data type value into a constructed DynAny object |
|
100 |
* implies initializing the current component of the constructed data value |
|
101 |
* associated with the DynAny object. For example, invoking insert_boolean on a |
|
102 |
* DynStruct implies inserting a boolean data value at the current position |
|
103 |
* of the associated struct data value. |
|
104 |
* A type is consistent for inserting or extracting a value if its TypeCode is equivalent to |
|
105 |
* the TypeCode contained in the DynAny or, if the DynAny has components, is equivalent to the TypeCode |
|
106 |
* of the DynAny at the current position. |
|
107 |
* <P>DynAny and DynAnyFactory objects are intended to be local to the process in which they are |
|
108 |
* created and used. This means that references to DynAny and DynAnyFactory objects cannot be exported |
|
109 |
* to other processes, or externalized with ORB.object_to_string(). |
|
110 |
* If any attempt is made to do so, the offending operation will raise a MARSHAL system exception. |
|
111 |
* Since their interfaces are specified in IDL, DynAny objects export operations defined in the standard |
|
112 |
* org.omg.CORBA.Object interface. However, any attempt to invoke operations exported through the Object |
|
113 |
* interface may raise the standard NO_IMPLEMENT exception. |
|
114 |
* An attempt to use a DynAny object with the DII may raise the NO_IMPLEMENT exception. |
|
115 |
*/ |
|
116 |
interface DynAny { |
|
117 |
#pragma sun_localservant DynAny "" |
|
118 |
exception InvalidValue {}; |
|
119 |
exception TypeMismatch {}; |
|
120 |
||
121 |
/** |
|
122 |
* Returns the TypeCode associated with this DynAny object. |
|
123 |
* A DynAny object is created with a TypeCode value assigned to it. |
|
124 |
* This TypeCode value determines the type of the value handled through the DynAny object. |
|
125 |
* Note that the TypeCode associated with a DynAny object is initialized at the time the |
|
126 |
* DynAny is created and cannot be changed during lifetime of the DynAny object. |
|
127 |
* |
|
128 |
* @return The TypeCode associated with this DynAny object |
|
129 |
*/ |
|
130 |
CORBA::TypeCode type(); |
|
131 |
||
132 |
/** |
|
133 |
* Initializes the value associated with a DynAny object with the value |
|
134 |
* associated with another DynAny object. |
|
135 |
* The current position of the target DynAny is set to zero for values that have components |
|
136 |
* and to -1 for values that do not have components. |
|
137 |
* |
|
138 |
* @param dyn_any |
|
139 |
* @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of target DynAny |
|
140 |
*/ |
|
141 |
void assign(in DynAny dyn_any) |
|
142 |
raises(TypeMismatch); |
|
143 |
||
144 |
/** |
|
145 |
* Initializes the value associated with a DynAny object with the value contained in an any. |
|
146 |
* The current position of the target DynAny is set to zero for values that have components |
|
147 |
* and to -1 for values that do not have components. |
|
148 |
* |
|
149 |
* @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target DynAny |
|
150 |
* @exception InvalidValue if the passed Any does not contain a legal value (such as a null string) |
|
151 |
*/ |
|
152 |
void from_any(in any value) |
|
153 |
raises(TypeMismatch, InvalidValue); |
|
154 |
||
155 |
/** |
|
156 |
* Creates an any value from a DynAny object. |
|
157 |
* A copy of the TypeCode associated with the DynAny object is assigned to the resulting any. |
|
158 |
* The value associated with the DynAny object is copied into the any. |
|
159 |
* |
|
160 |
* @return a new Any object with the same value and TypeCode |
|
161 |
*/ |
|
162 |
any to_any(); |
|
163 |
||
164 |
/** |
|
165 |
* Compares two DynAny values for equality. |
|
166 |
* Two DynAny values are equal if their TypeCodes are equivalent and, recursively, all component DynAnys |
|
167 |
* have equal values. |
|
168 |
* The current position of the two DynAnys being compared has no effect on the result of equal. |
|
169 |
* |
|
170 |
* @return true of the DynAnys are equal, false otherwise |
|
171 |
*/ |
|
172 |
boolean equal(in DynAny dyn_any); |
|
173 |
||
174 |
/** |
|
175 |
* Destroys a DynAny object. |
|
176 |
* This operation frees any resources used to represent the data value associated with a DynAny object. |
|
177 |
* It must be invoked on references obtained from one of the creation operations on the ORB interface |
|
178 |
* or on a reference returned by DynAny.copy() to avoid resource leaks. |
|
179 |
* Invoking destroy on component DynAny objects (for example, on objects returned by the |
|
180 |
* current_component operation) does nothing. |
|
181 |
* Destruction of a DynAny object implies destruction of all DynAny objects obtained from it. |
|
182 |
* That is, references to components of a destroyed DynAny become invalid. |
|
183 |
* Invocations on such references raise OBJECT_NOT_EXIST. |
|
184 |
* It is possible to manipulate a component of a DynAny beyond the life time of the DynAny |
|
185 |
* from which the component was obtained by making a copy of the component with the copy operation |
|
186 |
* before destroying the DynAny from which the component was obtained. |
|
187 |
*/ |
|
188 |
void destroy(); |
|
189 |
||
190 |
/** |
|
191 |
* Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked. |
|
192 |
* The operation is polymorphic, that is, invoking it on one of the types derived from DynAny, |
|
193 |
* such as DynStruct, creates the derived type but returns its reference as the DynAny base type. |
|
194 |
* |
|
195 |
* @return a deep copy of the DynAny object |
|
196 |
*/ |
|
197 |
DynAny copy(); |
|
198 |
||
199 |
/** |
|
200 |
* Inserts a boolean value into the DynAny. |
|
201 |
* |
|
202 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
203 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
204 |
*/ |
|
205 |
void insert_boolean(in boolean value) |
|
206 |
raises(TypeMismatch, InvalidValue); |
|
207 |
||
208 |
/** |
|
209 |
* Inserts a byte value into the DynAny. The IDL octet data type is mapped to the Java byte data type. |
|
210 |
* |
|
211 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
212 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
213 |
*/ |
|
214 |
void insert_octet(in octet value) |
|
215 |
raises(TypeMismatch, InvalidValue); |
|
216 |
||
217 |
/** |
|
218 |
* Inserts a char value into the DynAny. |
|
219 |
* |
|
220 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
221 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
222 |
*/ |
|
223 |
void insert_char(in char value) |
|
224 |
raises(TypeMismatch, InvalidValue); |
|
225 |
||
226 |
/** |
|
227 |
* Inserts a short value into the DynAny. |
|
228 |
* |
|
229 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
230 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
231 |
*/ |
|
232 |
void insert_short(in short value) |
|
233 |
raises(TypeMismatch, InvalidValue); |
|
234 |
||
235 |
/** |
|
236 |
* Inserts a short value into the DynAny. The IDL ushort data type is mapped to the Java short data type. |
|
237 |
* |
|
238 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
239 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
240 |
*/ |
|
241 |
void insert_ushort(in unsigned short value) |
|
242 |
raises(TypeMismatch, InvalidValue); |
|
243 |
||
244 |
/** |
|
245 |
* Inserts an integer value into the DynAny. The IDL long data type is mapped to the Java int data type. |
|
246 |
* |
|
247 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
248 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
249 |
*/ |
|
250 |
void insert_long(in long value) |
|
251 |
raises(TypeMismatch, InvalidValue); |
|
252 |
||
253 |
/** |
|
254 |
* Inserts an integer value into the DynAny. The IDL ulong data type is mapped to the Java int data type. |
|
255 |
* |
|
256 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
257 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
258 |
*/ |
|
259 |
void insert_ulong(in unsigned long value) |
|
260 |
raises(TypeMismatch, InvalidValue); |
|
261 |
||
262 |
/** |
|
263 |
* Inserts a float value into the DynAny. |
|
264 |
* |
|
265 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
266 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
267 |
*/ |
|
268 |
void insert_float(in float value) |
|
269 |
raises(TypeMismatch, InvalidValue); |
|
270 |
||
271 |
/** |
|
272 |
* Inserts a double value into the DynAny. |
|
273 |
* |
|
274 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
275 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
276 |
*/ |
|
277 |
void insert_double(in double value) |
|
278 |
raises(TypeMismatch, InvalidValue); |
|
279 |
||
280 |
/** |
|
281 |
* Inserts a string value into the DynAny. |
|
282 |
* Both bounded and unbounded strings are inserted using this method. |
|
283 |
* |
|
284 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
285 |
* @exception InvalidValue if the string inserted is longer than the bound of a bounded string |
|
286 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
287 |
*/ |
|
288 |
void insert_string(in string value) |
|
289 |
raises(TypeMismatch, InvalidValue); |
|
290 |
||
291 |
/** |
|
292 |
* Inserts a reference to a CORBA object into the DynAny. |
|
293 |
* |
|
294 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
295 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
296 |
*/ |
|
297 |
void insert_reference(in Object value) |
|
298 |
raises(TypeMismatch, InvalidValue); |
|
299 |
||
300 |
/** |
|
301 |
* Inserts a TypeCode object into the DynAny. |
|
302 |
* |
|
303 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
304 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
305 |
*/ |
|
306 |
void insert_typecode(in CORBA::TypeCode value) |
|
307 |
raises(TypeMismatch, InvalidValue); |
|
308 |
||
309 |
/** |
|
310 |
* Inserts a long value into the DynAny. The IDL long long data type is mapped to the Java long data type. |
|
311 |
* |
|
312 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
313 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
314 |
*/ |
|
315 |
void insert_longlong(in long long value) |
|
316 |
raises(TypeMismatch, InvalidValue); |
|
317 |
||
318 |
/** |
|
319 |
* Inserts a long value into the DynAny. |
|
320 |
* The IDL unsigned long long data type is mapped to the Java long data type. |
|
321 |
* |
|
322 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
323 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
324 |
*/ |
|
325 |
void insert_ulonglong(in unsigned long long value) |
|
326 |
raises(TypeMismatch, InvalidValue); |
|
327 |
||
328 |
// void insert_longdouble(in long double value) |
|
329 |
// raises(TypeMismatch, InvalidValue); |
|
330 |
||
331 |
/** |
|
332 |
* Inserts a char value into the DynAny. The IDL wchar data type is mapped to the Java char data type. |
|
333 |
* |
|
334 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
335 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
336 |
*/ |
|
337 |
void insert_wchar(in wchar value) |
|
338 |
raises(TypeMismatch, InvalidValue); |
|
339 |
||
340 |
/** |
|
341 |
* Inserts a string value into the DynAny. |
|
342 |
* Both bounded and unbounded strings are inserted using this method. |
|
343 |
* |
|
344 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
345 |
* @exception InvalidValue if the string inserted is longer than the bound of a bounded string |
|
346 |
*/ |
|
347 |
void insert_wstring(in wstring value) |
|
348 |
raises(TypeMismatch, InvalidValue); |
|
349 |
||
350 |
/** |
|
351 |
* Inserts an Any value into the Any represented by this DynAny. |
|
352 |
* |
|
353 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
354 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
355 |
*/ |
|
356 |
void insert_any(in any value) |
|
357 |
raises(TypeMismatch, InvalidValue); |
|
358 |
||
359 |
/** |
|
360 |
* Inserts the Any value contained in the parameter DynAny into the Any represented by this DynAny. |
|
361 |
* |
|
362 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
363 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
364 |
*/ |
|
365 |
void insert_dyn_any(in DynAny value) |
|
366 |
raises(TypeMismatch, InvalidValue); |
|
367 |
||
368 |
/** |
|
369 |
* Inserts a reference to a Serializable object into this DynAny. |
|
370 |
* The IDL ValueBase type is mapped to the Java Serializable type. |
|
371 |
* |
|
372 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
373 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
374 |
*/ |
|
375 |
void insert_val(in ValueBase value) |
|
376 |
raises(TypeMismatch, InvalidValue); |
|
377 |
||
378 |
/** |
|
379 |
* Extracts the boolean value from this DynAny. |
|
380 |
* |
|
381 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
382 |
* that is not equivalent to the requested type. |
|
383 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
384 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
385 |
*/ |
|
386 |
boolean get_boolean() |
|
387 |
raises(TypeMismatch, InvalidValue); |
|
388 |
||
389 |
/** |
|
390 |
* Extracts the byte value from this DynAny. The IDL octet data type is mapped to the Java byte data type. |
|
391 |
* |
|
392 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
393 |
* that is not equivalent to the requested type. |
|
394 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
395 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
396 |
*/ |
|
397 |
octet get_octet() |
|
398 |
raises(TypeMismatch, InvalidValue); |
|
399 |
||
400 |
/** |
|
401 |
* Extracts the char value from this DynAny. |
|
402 |
* |
|
403 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
404 |
* that is not equivalent to the requested type. |
|
405 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
406 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
407 |
*/ |
|
408 |
char get_char() |
|
409 |
raises(TypeMismatch, InvalidValue); |
|
410 |
||
411 |
/** |
|
412 |
* Extracts the short value from this DynAny. |
|
413 |
* |
|
414 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
415 |
* that is not equivalent to the requested type. |
|
416 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
417 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
418 |
*/ |
|
419 |
short get_short() |
|
420 |
raises(TypeMismatch, InvalidValue); |
|
421 |
||
422 |
/** |
|
423 |
* Extracts the short value from this DynAny. The IDL ushort data type is mapped to the Java short data type. |
|
424 |
* |
|
425 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
426 |
* that is not equivalent to the requested type. |
|
427 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
428 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
429 |
*/ |
|
430 |
unsigned short get_ushort() |
|
431 |
raises(TypeMismatch, InvalidValue); |
|
432 |
||
433 |
/** |
|
434 |
* Extracts the integer value from this DynAny. The IDL long data type is mapped to the Java int data type. |
|
435 |
* |
|
436 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
437 |
* that is not equivalent to the requested type. |
|
438 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
439 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
440 |
*/ |
|
441 |
long get_long() |
|
442 |
raises(TypeMismatch, InvalidValue); |
|
443 |
||
444 |
/** |
|
445 |
* Extracts the integer value from this DynAny. The IDL ulong data type is mapped to the Java int data type. |
|
446 |
* |
|
447 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
448 |
* that is not equivalent to the requested type. |
|
449 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
450 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
451 |
*/ |
|
452 |
unsigned long get_ulong() |
|
453 |
raises(TypeMismatch, InvalidValue); |
|
454 |
||
455 |
/** |
|
456 |
* Extracts the float value from this DynAny. |
|
457 |
* |
|
458 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
459 |
* that is not equivalent to the requested type. |
|
460 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
461 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
462 |
*/ |
|
463 |
float get_float() |
|
464 |
raises(TypeMismatch, InvalidValue); |
|
465 |
||
466 |
/** |
|
467 |
* Extracts the double value from this DynAny. |
|
468 |
* |
|
469 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
470 |
* that is not equivalent to the requested type. |
|
471 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
472 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
473 |
*/ |
|
474 |
double get_double() |
|
475 |
raises(TypeMismatch, InvalidValue); |
|
476 |
||
477 |
/** |
|
478 |
* Extracts the string value from this DynAny. |
|
479 |
* Both bounded and unbounded strings are extracted using this method. |
|
480 |
* |
|
481 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
482 |
* that is not equivalent to the requested type. |
|
483 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
484 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
485 |
*/ |
|
486 |
string get_string() |
|
487 |
raises(TypeMismatch, InvalidValue); |
|
488 |
||
489 |
/** |
|
490 |
* Extracts the reference to a CORBA Object from this DynAny. |
|
491 |
* |
|
492 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
493 |
* that is not equivalent to the requested type. |
|
494 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
495 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
496 |
*/ |
|
497 |
Object get_reference() |
|
498 |
raises(TypeMismatch, InvalidValue); |
|
499 |
||
500 |
/** |
|
501 |
* Extracts the TypeCode object from this DynAny. |
|
502 |
* |
|
503 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
504 |
* that is not equivalent to the requested type. |
|
505 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
506 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
507 |
*/ |
|
508 |
CORBA::TypeCode get_typecode() |
|
509 |
raises(TypeMismatch, InvalidValue); |
|
510 |
||
511 |
/** |
|
512 |
* Extracts the long value from this DynAny. The IDL long long data type is mapped to the Java long data type. |
|
513 |
* |
|
514 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
515 |
* that is not equivalent to the requested type. |
|
516 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
517 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
518 |
*/ |
|
519 |
long long get_longlong() |
|
520 |
raises(TypeMismatch, InvalidValue); |
|
521 |
||
522 |
/** |
|
523 |
* Extracts the long value from this DynAny. |
|
524 |
* The IDL unsigned long long data type is mapped to the Java long data type. |
|
525 |
* |
|
526 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
527 |
* that is not equivalent to the requested type. |
|
528 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
529 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
530 |
*/ |
|
531 |
unsigned long long get_ulonglong() |
|
532 |
raises(TypeMismatch, InvalidValue); |
|
533 |
// long double get_longdouble() |
|
534 |
// raises(TypeMismatch, InvalidValue); |
|
535 |
||
536 |
/** |
|
537 |
* Extracts the long value from this DynAny. The IDL wchar data type is mapped to the Java char data type. |
|
538 |
* |
|
539 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
540 |
* that is not equivalent to the requested type. |
|
541 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
542 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
543 |
*/ |
|
544 |
wchar get_wchar() |
|
545 |
raises(TypeMismatch, InvalidValue); |
|
546 |
||
547 |
/** |
|
548 |
* Extracts the string value from this DynAny. |
|
549 |
* Both bounded and unbounded strings are extracted using this method. |
|
550 |
* |
|
551 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
552 |
* that is not equivalent to the requested type. |
|
553 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
554 |
*/ |
|
555 |
wstring get_wstring() |
|
556 |
raises(TypeMismatch, InvalidValue); |
|
557 |
||
558 |
/** |
|
559 |
* Extracts an Any value contained in the Any represented by this DynAny. |
|
560 |
* |
|
561 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
562 |
* that is not equivalent to the requested type. |
|
563 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
564 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
565 |
*/ |
|
566 |
any get_any() |
|
567 |
raises(TypeMismatch, InvalidValue); |
|
568 |
||
569 |
/** |
|
570 |
* Extracts the Any value contained in the Any represented by this DynAny and returns it wrapped |
|
571 |
* into a new DynAny. |
|
572 |
* |
|
573 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
574 |
* that is not equivalent to the requested type. |
|
575 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
576 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
577 |
*/ |
|
578 |
DynAny get_dyn_any() |
|
579 |
raises(TypeMismatch, InvalidValue); |
|
580 |
||
581 |
/** |
|
582 |
* Extracts a Serializable object from this DynAny. |
|
583 |
* The IDL ValueBase type is mapped to the Java Serializable type. |
|
584 |
* |
|
585 |
* @exception TypeMismatch if the accessed component in the DynAny is of a type |
|
586 |
* that is not equivalent to the requested type. |
|
587 |
* @exception TypeMismatch if called on a DynAny whose current component itself has components |
|
588 |
* @exception InvalidValue if this DynAny has components but has a current position of -1 |
|
589 |
*/ |
|
590 |
ValueBase get_val() |
|
591 |
raises(TypeMismatch, InvalidValue); |
|
592 |
||
593 |
/** |
|
594 |
* Sets the current position to index. The current position is indexed 0 to n-1, that is, |
|
595 |
* index zero corresponds to the first component. The operation returns true if the resulting |
|
596 |
* current position indicates a component of the DynAny and false if index indicates |
|
597 |
* a position that does not correspond to a component. |
|
598 |
* Calling seek with a negative index is legal. It sets the current position to -1 to indicate |
|
599 |
* no component and returns false. Passing a non-negative index value for a DynAny that does not |
|
600 |
* have a component at the corresponding position sets the current position to -1 and returns false. |
|
601 |
*/ |
|
602 |
boolean seek(in long index); |
|
603 |
||
604 |
/** |
|
605 |
* Is equivalent to seek(0). |
|
606 |
*/ |
|
607 |
void rewind(); |
|
608 |
||
609 |
/** |
|
610 |
* Advances the current position to the next component. |
|
611 |
* The operation returns true while the resulting current position indicates a component, false otherwise. |
|
612 |
* A false return value leaves the current position at -1. |
|
613 |
* Invoking next on a DynAny without components leaves the current position at -1 and returns false. |
|
614 |
*/ |
|
615 |
boolean next(); |
|
616 |
||
617 |
/** |
|
618 |
* Returns the number of components of a DynAny. |
|
619 |
* For a DynAny without components, it returns zero. |
|
620 |
* The operation only counts the components at the top level. |
|
621 |
* For example, if component_count is invoked on a DynStruct with a single member, |
|
622 |
* the return value is 1, irrespective of the type of the member. |
|
623 |
* <UL> |
|
624 |
* <LI>For sequences, the operation returns the current number of elements. |
|
625 |
* <LI>For structures, exceptions, and value types, the operation returns the number of members. |
|
626 |
* <LI>For arrays, the operation returns the number of elements. |
|
627 |
* <LI>For unions, the operation returns 2 if the discriminator indicates that a named member is active, |
|
628 |
* otherwise, it returns 1. |
|
629 |
* <LI>For DynFixed and DynEnum, the operation returns zero. |
|
630 |
* </UL> |
|
631 |
*/ |
|
632 |
unsigned long component_count(); |
|
633 |
||
634 |
/** |
|
635 |
* Returns the DynAny for the component at the current position. |
|
636 |
* It does not advance the current position, so repeated calls to current_component |
|
637 |
* without an intervening call to rewind, next, or seek return the same component. |
|
638 |
* The returned DynAny object reference can be used to get/set the value of the current component. |
|
639 |
* If the current component represents a complex type, the returned reference can be narrowed |
|
640 |
* based on the TypeCode to get the interface corresponding to the to the complex type. |
|
641 |
* Calling current_component on a DynAny that cannot have components, |
|
642 |
* such as a DynEnum or an empty exception, raises TypeMismatch. |
|
643 |
* Calling current_component on a DynAny whose current position is -1 returns a nil reference. |
|
644 |
* The iteration operations, together with current_component, can be used |
|
645 |
* to dynamically compose an any value. After creating a dynamic any, such as a DynStruct, |
|
646 |
* current_component and next can be used to initialize all the components of the value. |
|
647 |
* Once the dynamic value is completely initialized, to_any creates the corresponding any value. |
|
648 |
* |
|
649 |
* @exception TypeMismatch If called on a DynAny that cannot have components, |
|
650 |
* such as a DynEnum or an empty exception |
|
651 |
*/ |
|
652 |
DynAny current_component() |
|
653 |
raises(TypeMismatch); |
|
654 |
}; |
|
655 |
||
656 |
/** |
|
657 |
* DynFixed objects support the manipulation of IDL fixed values. |
|
658 |
* Because IDL does not have a generic type that can represent fixed types with arbitrary |
|
659 |
* number of digits and arbitrary scale, the operations use the IDL string type. |
|
660 |
*/ |
|
661 |
interface DynFixed : DynAny { |
|
662 |
#pragma sun_localservant DynFixed "" |
|
663 |
||
664 |
/** |
|
665 |
* Returns the value of a DynFixed. |
|
666 |
*/ |
|
667 |
string get_value(); |
|
668 |
||
669 |
/** |
|
670 |
* Sets the value of the DynFixed. |
|
671 |
* The val string must contain a fixed string constant in the same format as used for IDL fixed-point literals. |
|
672 |
* However, the trailing d or D is optional. The return value is true if val can be represented as the DynFixed |
|
673 |
* without loss of precision. If val has more fractional digits than can be represented in the DynFixed, |
|
674 |
* fractional digits are truncated and the return value is false. |
|
675 |
* |
|
676 |
* @exception TypeMismatch If val does not contain a valid fixed-point literal or contains extraneous |
|
677 |
* characters other than leading or trailing white space |
|
678 |
* @exception InvalidValue If val contains a value whose scale exceeds that of the DynFixed |
|
679 |
* or is not initialized |
|
680 |
*/ |
|
681 |
boolean set_value(in string val) |
|
682 |
raises(TypeMismatch, InvalidValue); |
|
683 |
}; |
|
684 |
||
685 |
/** |
|
686 |
* DynEnum objects support the manipulation of IDL enumerated values. |
|
687 |
* The current position of a DynEnum is always -1. |
|
688 |
*/ |
|
689 |
interface DynEnum : DynAny { |
|
690 |
#pragma sun_localservant DynEnum "" |
|
691 |
||
692 |
/** |
|
693 |
* Returns the value of the DynEnum as an IDL identifier. |
|
694 |
*/ |
|
695 |
string get_as_string(); |
|
696 |
||
697 |
/** |
|
698 |
* Sets the value of the DynEnum to the enumerated value whose IDL identifier is passed in the value parameter. |
|
699 |
* |
|
700 |
* @exception InvalidValue If value contains a string that is not a valid IDL identifier |
|
701 |
* for the corresponding enumerated type |
|
702 |
*/ |
|
703 |
void set_as_string(in string value) |
|
704 |
raises(InvalidValue); |
|
705 |
||
706 |
/** |
|
707 |
* Returns the value of the DynEnum as the enumerated value's ordinal value. |
|
708 |
* Enumerators have ordinal values 0 to n-1, as they appear from left to right |
|
709 |
* in the corresponding IDL definition. |
|
710 |
*/ |
|
711 |
unsigned long get_as_ulong(); |
|
712 |
||
713 |
/** |
|
714 |
* Sets the value of the DynEnum as the enumerated value's ordinal value. |
|
715 |
* |
|
716 |
* @exception InvalidValue If value contains a value that is outside the range of ordinal values |
|
717 |
* for the corresponding enumerated type |
|
718 |
*/ |
|
719 |
void set_as_ulong(in unsigned long value) |
|
720 |
raises(InvalidValue); |
|
721 |
}; |
|
722 |
||
723 |
typedef string FieldName; |
|
724 |
||
725 |
/** |
|
726 |
* NameValuePairs associate a name with an Any object. |
|
727 |
*/ |
|
728 |
struct NameValuePair { |
|
729 |
/** |
|
730 |
* The name associated with the Any. |
|
731 |
*/ |
|
732 |
FieldName id; |
|
733 |
/** |
|
734 |
* The Any value associated with the name. |
|
735 |
*/ |
|
736 |
any value; |
|
737 |
}; |
|
738 |
typedef sequence<NameValuePair> NameValuePairSeq; |
|
739 |
||
740 |
/** |
|
741 |
* NameDynAnyPairs associate a name with an DynAny object. |
|
742 |
*/ |
|
743 |
struct NameDynAnyPair { |
|
744 |
/** |
|
745 |
* The name associated with the DynAny. |
|
746 |
*/ |
|
747 |
FieldName id; |
|
748 |
/** |
|
749 |
* The DynAny value associated with the name. |
|
750 |
*/ |
|
751 |
DynAny value; |
|
752 |
}; |
|
753 |
typedef sequence<NameDynAnyPair> NameDynAnyPairSeq; |
|
754 |
||
755 |
/** |
|
756 |
* DynStruct objects support the manipulation of IDL struct and exception values. |
|
757 |
* Members of the exceptions are handled in the same way as members of a struct. |
|
758 |
*/ |
|
759 |
interface DynStruct : DynAny { |
|
760 |
#pragma sun_localservant DynStruct "" |
|
761 |
||
762 |
/** |
|
763 |
* Returns the name of the member at the current position. |
|
764 |
* This operation may return an empty string since the TypeCode of the value being |
|
765 |
* manipulated may not contain the names of members. |
|
766 |
* |
|
767 |
* @exception TypeMismatch if the DynStruct represents an empty exception. |
|
768 |
* @exception InvalidValue if the current position does not indicate a member |
|
769 |
*/ |
|
770 |
FieldName current_member_name() |
|
771 |
raises(TypeMismatch, InvalidValue); |
|
772 |
||
773 |
/** |
|
774 |
* Returns the TCKind associated with the member at the current position. |
|
775 |
* |
|
776 |
* @exception TypeMismatch if the DynStruct represents an empty exception. |
|
777 |
* @exception InvalidValue if the current position does not indicate a member |
|
778 |
*/ |
|
779 |
CORBA::TCKind current_member_kind() |
|
780 |
raises(TypeMismatch, InvalidValue); |
|
781 |
||
782 |
/** |
|
783 |
* Returns a sequence of NameValuePairs describing the name and the value of each member |
|
784 |
* in the struct associated with a DynStruct object. |
|
785 |
* The sequence contains members in the same order as the declaration order of members |
|
786 |
* as indicated by the DynStruct's TypeCode. The current position is not affected. |
|
787 |
* The member names in the returned sequence will be empty strings if the DynStruct's TypeCode |
|
788 |
* does not contain member names. |
|
789 |
*/ |
|
790 |
NameValuePairSeq get_members(); |
|
791 |
||
792 |
/** |
|
793 |
* Initializes the struct data value associated with a DynStruct object from a sequence of NameValuePairs. |
|
794 |
* The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, |
|
795 |
* if an empty sequence is passed, the current position is set to -1. |
|
796 |
* <P>Members must appear in the NameValuePairs in the order in which they appear in the IDL specification |
|
797 |
* of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. |
|
798 |
* The operation makes no attempt to assign member values based on member names. |
|
799 |
* |
|
800 |
* @exception TypeMismatch if the member names supplied in the passed sequence do not match the |
|
801 |
* corresponding member name in the DynStruct's TypeCode and they are not empty strings |
|
802 |
* @exception InvalidValue if the passed sequence has a number of elements that disagrees |
|
803 |
* with the number of members as indicated by the DynStruct's TypeCode |
|
804 |
*/ |
|
805 |
void set_members(in NameValuePairSeq value) |
|
806 |
raises(TypeMismatch, InvalidValue); |
|
807 |
||
808 |
/** |
|
809 |
* Returns a sequence of NameDynAnyPairs describing the name and the value of each member |
|
810 |
* in the struct associated with a DynStruct object. |
|
811 |
* The sequence contains members in the same order as the declaration order of members |
|
812 |
* as indicated by the DynStruct's TypeCode. The current position is not affected. |
|
813 |
* The member names in the returned sequence will be empty strings if the DynStruct's TypeCode |
|
814 |
* does not contain member names. |
|
815 |
*/ |
|
816 |
NameDynAnyPairSeq get_members_as_dyn_any(); |
|
817 |
||
818 |
/** |
|
819 |
* Initializes the struct data value associated with a DynStruct object from a sequence of NameDynAnyPairs. |
|
820 |
* The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, |
|
821 |
* if an empty sequence is passed, the current position is set to -1. |
|
822 |
* <P>Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification |
|
823 |
* of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. |
|
824 |
* The operation makes no attempt to assign member values based on member names. |
|
825 |
* |
|
826 |
* @exception TypeMismatch if the member names supplied in the passed sequence do not match the |
|
827 |
* corresponding member name in the DynStruct's TypeCode and they are not empty strings |
|
828 |
* @exception InvalidValue if the passed sequence has a number of elements that disagrees |
|
829 |
* with the number of members as indicated by the DynStruct's TypeCode |
|
830 |
*/ |
|
831 |
void set_members_as_dyn_any(in NameDynAnyPairSeq value) |
|
832 |
raises(TypeMismatch, InvalidValue); |
|
833 |
}; |
|
834 |
||
835 |
/** |
|
836 |
* DynUnion objects support the manipulation of IDL unions. |
|
837 |
* A union can have only two valid current positions: |
|
838 |
* <UL> |
|
839 |
* <LI>zero, which denotes the discriminator |
|
840 |
* <LI>one, which denotes the active member |
|
841 |
* </UL> |
|
842 |
* The component_count value for a union depends on the current discriminator: |
|
843 |
* it is 2 for a union whose discriminator indicates a named member, and 1 otherwise. |
|
844 |
*/ |
|
845 |
interface DynUnion : DynAny { |
|
846 |
#pragma sun_localservant DynUnion "" |
|
847 |
||
848 |
/** |
|
849 |
* Returns the current discriminator value. |
|
850 |
*/ |
|
851 |
DynAny get_discriminator(); |
|
852 |
||
853 |
/** |
|
854 |
* Sets the discriminator of the DynUnion to the specified value. |
|
855 |
* Setting the discriminator to a value that is consistent with the currently active union member |
|
856 |
* does not affect the currently active member. Setting the discriminator to a value that is inconsistent |
|
857 |
* with the currently active member deactivates the member and activates the member that is consistent |
|
858 |
* with the new discriminator value (if there is a member for that value) by initializing the member |
|
859 |
* to its default value. |
|
860 |
* Setting the discriminator of a union sets the current position to 0 if the discriminator value |
|
861 |
* indicates a non-existent union member (has_no_active_member returns true in this case). |
|
862 |
* Otherwise, if the discriminator value indicates a named union member, the current position is set to 1 |
|
863 |
* (has_no_active_member returns false and component_count returns 2 in this case). |
|
864 |
* |
|
865 |
* @exception TypeMismatch if the TypeCode of the parameter is not equivalent to the TypeCode |
|
866 |
* of the union's discriminator |
|
867 |
*/ |
|
868 |
void set_discriminator(in DynAny d) |
|
869 |
raises(TypeMismatch); |
|
870 |
||
871 |
/** |
|
872 |
* Sets the discriminator to a value that is consistent with the value of the default case of a union. |
|
873 |
* It sets the current position to zero and causes component_count to return 2. |
|
874 |
* |
|
875 |
* @exception TypeMismatch if the union does not have an explicit default case |
|
876 |
*/ |
|
877 |
void set_to_default_member() |
|
878 |
raises(TypeMismatch); |
|
879 |
||
880 |
/** |
|
881 |
* Sets the discriminator to a value that does not correspond to any of the unions case labels. |
|
882 |
* It sets the current position to zero and causes component_count to return 1. |
|
883 |
* |
|
884 |
* @exception TypeMismatch if the union has an explicit default case or if it uses the entire range |
|
885 |
* of discriminator values for explicit case labels |
|
886 |
*/ |
|
887 |
void set_to_no_active_member() |
|
888 |
raises(TypeMismatch); |
|
889 |
||
890 |
/** |
|
891 |
* Returns true if the union has no active member, that is, the unions value consists solely |
|
892 |
* of its discriminator because the discriminator has a value that is not listed as an explicit case label. |
|
893 |
* Calling this operation on a union that has a default case returns false. |
|
894 |
* Calling this operation on a union that uses the entire range of discriminator values |
|
895 |
* for explicit case labels returns false. |
|
896 |
*/ |
|
897 |
boolean has_no_active_member(); |
|
898 |
||
899 |
/** |
|
900 |
* Returns the TCKind value of the discriminators TypeCode. |
|
901 |
*/ |
|
902 |
CORBA::TCKind discriminator_kind(); |
|
903 |
||
904 |
/** |
|
905 |
* Returns the TCKind value of the currently active members TypeCode. |
|
906 |
* |
|
907 |
* @exception InvalidValue if the union does not have a currently active member |
|
908 |
*/ |
|
909 |
CORBA::TCKind member_kind() |
|
910 |
raises(InvalidValue); |
|
911 |
||
912 |
/** |
|
913 |
* Returns the currently active member. Note that the returned reference remains valid only |
|
914 |
* for as long as the currently active member does not change. Using the returned reference |
|
915 |
* beyond the life time of the currently active member raises OBJECT_NOT_EXIST. |
|
916 |
* |
|
917 |
* @exception InvalidValue if the union has no active member |
|
918 |
*/ |
|
919 |
DynAny member() |
|
920 |
raises(InvalidValue); |
|
921 |
||
922 |
/** |
|
923 |
* Returns the name of the currently active member. If the unions TypeCode does not contain |
|
924 |
* a member name for the currently active member, the operation returns an empty string. |
|
925 |
* |
|
926 |
* @exception InvalidValue if the union has no active member |
|
927 |
*/ |
|
928 |
FieldName member_name() |
|
929 |
raises(InvalidValue); |
|
930 |
}; |
|
931 |
||
932 |
typedef sequence<any> AnySeq; |
|
933 |
typedef sequence<DynAny> DynAnySeq; |
|
934 |
||
935 |
/** |
|
936 |
* DynSequence objects support the manipulation of IDL sequences. |
|
937 |
*/ |
|
938 |
interface DynSequence : DynAny { |
|
939 |
#pragma sun_localservant DynSequence "" |
|
940 |
||
941 |
/** |
|
942 |
* Returns the current length of the sequence. |
|
943 |
*/ |
|
944 |
unsigned long get_length(); |
|
945 |
||
946 |
/** |
|
947 |
* Sets the length of the sequence. |
|
948 |
* Increasing the length of a sequence adds new elements at the tail without affecting the values |
|
949 |
* of already existing elements. Newly added elements are default-initialized. |
|
950 |
* Increasing the length of a sequence sets the current position to the first newly-added element |
|
951 |
* if the previous current position was -1. Otherwise, if the previous current position was not -1, |
|
952 |
* the current position is not affected. |
|
953 |
* Decreasing the length of a sequence removes elements from the tail without affecting the value |
|
954 |
* of those elements that remain. The new current position after decreasing the length of a sequence |
|
955 |
* is determined as follows: |
|
956 |
* <UL> |
|
957 |
* <LI>If the length of the sequence is set to zero, the current position is set to -1. |
|
958 |
* <LI>If the current position is -1 before decreasing the length, it remains at -1. |
|
959 |
* <LI>If the current position indicates a valid element and that element is not removed when the length |
|
960 |
* is decreased, the current position remains unaffected. |
|
961 |
* <LI>If the current position indicates a valid element and that element is removed, |
|
962 |
* the current position is set to -1. |
|
963 |
* </UL> |
|
964 |
* |
|
965 |
* @exception InvalidValue if this is a bounded sequence and len is larger than the bound |
|
966 |
*/ |
|
967 |
void set_length(in unsigned long len) |
|
968 |
raises(InvalidValue); |
|
969 |
||
970 |
/** |
|
971 |
* Returns the elements of the sequence. |
|
972 |
*/ |
|
973 |
AnySeq get_elements(); |
|
974 |
||
975 |
/** |
|
976 |
* Sets the elements of a sequence. |
|
977 |
* The length of the DynSequence is set to the length of value. The current position is set to zero |
|
978 |
* if value has non-zero length and to -1 if value is a zero-length sequence. |
|
979 |
* |
|
980 |
* @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent |
|
981 |
* to the element TypeCode of the DynSequence |
|
982 |
* @exception InvalidValue if the length of value exceeds the bound of a bounded sequence |
|
983 |
*/ |
|
984 |
void set_elements(in AnySeq value) |
|
985 |
raises(TypeMismatch, InvalidValue); |
|
986 |
||
987 |
/** |
|
988 |
* Returns the DynAnys representing the elements of the sequence. |
|
989 |
*/ |
|
990 |
DynAnySeq get_elements_as_dyn_any(); |
|
991 |
||
992 |
/** |
|
993 |
* Sets the elements of a sequence using DynAnys. |
|
994 |
* The length of the DynSequence is set to the length of value. The current position is set to zero |
|
995 |
* if value has non-zero length and to -1 if value is a zero-length sequence. |
|
996 |
* |
|
997 |
* @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent |
|
998 |
* to the element TypeCode of the DynSequence |
|
999 |
* @exception InvalidValue if the length of value exceeds the bound of a bounded sequence |
|
1000 |
*/ |
|
1001 |
void set_elements_as_dyn_any(in DynAnySeq value) |
|
1002 |
raises(TypeMismatch, InvalidValue); |
|
1003 |
}; |
|
1004 |
||
1005 |
/** |
|
1006 |
* DynArray objects support the manipulation of IDL arrays. |
|
1007 |
* Note that the dimension of the array is contained in the TypeCode which is accessible |
|
1008 |
* through the type attribute. It can also be obtained by calling the component_count operation. |
|
1009 |
*/ |
|
1010 |
interface DynArray : DynAny { |
|
1011 |
#pragma sun_localservant DynArray "" |
|
1012 |
||
1013 |
/** |
|
1014 |
* Returns the elements of the DynArray. |
|
1015 |
*/ |
|
1016 |
AnySeq get_elements(); |
|
1017 |
||
1018 |
/** |
|
1019 |
* Sets the DynArray to contain the passed elements. |
|
1020 |
* |
|
1021 |
* @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode |
|
1022 |
* @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension |
|
1023 |
*/ |
|
1024 |
void set_elements(in AnySeq value) |
|
1025 |
raises(TypeMismatch, InvalidValue); |
|
1026 |
||
1027 |
/** |
|
1028 |
* Returns the elements of the DynArray as DynAnys. |
|
1029 |
*/ |
|
1030 |
DynAnySeq get_elements_as_dyn_any(); |
|
1031 |
||
1032 |
/** |
|
1033 |
* Sets the DynArray to contain the passed elements. |
|
1034 |
* |
|
1035 |
* @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode |
|
1036 |
* @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension |
|
1037 |
*/ |
|
1038 |
void set_elements_as_dyn_any(in DynAnySeq value) |
|
1039 |
raises(TypeMismatch, InvalidValue); |
|
1040 |
}; |
|
1041 |
||
1042 |
/** |
|
1043 |
* DynValueCommon provides operations supported by both the DynValue and DynValueBox interfaces. |
|
1044 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1045 |
interface DynValueCommon : DynAny { |
4 | 1046 |
/** |
1047 |
* Returns true if the DynValueCommon represents a null value type. |
|
1048 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1049 |
boolean is_null(); |
4 | 1050 |
|
1051 |
/** |
|
1052 |
* Changes the representation of a DynValueCommon to a null value type. |
|
1053 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1054 |
void set_to_null(); |
4 | 1055 |
|
1056 |
/** |
|
1057 |
* Replaces a null value type with a newly constructed value. Its components are initialized |
|
1058 |
* to default values as in DynAnyFactory.create_dyn_any_from_type_code. |
|
1059 |
* If the DynValueCommon represents a non-null value type, then this operation has no effect. |
|
1060 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1061 |
void set_to_value(); |
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1062 |
}; |
4 | 1063 |
|
1064 |
/** |
|
1065 |
* DynValue objects support the manipulation of IDL non-boxed value types. |
|
1066 |
* The DynValue interface can represent both null and non-null value types. |
|
1067 |
* For a DynValue representing a non-null value type, the DynValue's components comprise |
|
1068 |
* the public and private members of the value type, including those inherited from concrete base value types, |
|
1069 |
* in the order of definition. A DynValue representing a null value type has no components |
|
1070 |
* and a current position of -1. |
|
1071 |
* <P>Warning: Indiscriminantly changing the contents of private value type members can cause the value type |
|
1072 |
* implementation to break by violating internal constraints. Access to private members is provided to support |
|
1073 |
* such activities as ORB bridging and debugging and should not be used to arbitrarily violate |
|
1074 |
* the encapsulation of the value type. |
|
1075 |
*/ |
|
1076 |
interface DynValue : DynValueCommon { |
|
1077 |
#pragma sun_localservant DynValue "" |
|
1078 |
||
1079 |
/** |
|
1080 |
* Returns the name of the member at the current position. |
|
1081 |
* This operation may return an empty string since the TypeCode of the value being |
|
1082 |
* manipulated may not contain the names of members. |
|
1083 |
* |
|
1084 |
* @exception TypeMismatch if the DynValue represents a null value type. |
|
1085 |
* @exception InvalidValue if the current position does not indicate a member |
|
1086 |
*/ |
|
1087 |
FieldName current_member_name() |
|
1088 |
raises(TypeMismatch, InvalidValue); |
|
1089 |
||
1090 |
/** |
|
1091 |
* Returns the TCKind associated with the member at the current position. |
|
1092 |
* |
|
1093 |
* @exception TypeMismatch if the DynValue represents a null value type. |
|
1094 |
* @exception InvalidValue if the current position does not indicate a member |
|
1095 |
*/ |
|
1096 |
CORBA::TCKind current_member_kind() |
|
1097 |
raises(TypeMismatch, InvalidValue); |
|
1098 |
||
1099 |
/** |
|
1100 |
* Returns a sequence of NameValuePairs describing the name and the value of each member |
|
1101 |
* in the value type. |
|
1102 |
* The sequence contains members in the same order as the declaration order of members |
|
1103 |
* as indicated by the DynValue's TypeCode. The current position is not affected. |
|
1104 |
* The member names in the returned sequence will be empty strings if the DynValue's TypeCode |
|
1105 |
* does not contain member names. |
|
1106 |
* |
|
1107 |
* @exception InvalidValue if this object represents a null value type |
|
1108 |
*/ |
|
1109 |
NameValuePairSeq get_members() |
|
1110 |
raises(InvalidValue); |
|
1111 |
||
1112 |
/** |
|
1113 |
* Initializes the value type's members from a sequence of NameValuePairs. |
|
1114 |
* The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, |
|
1115 |
* if an empty sequence is passed, the current position is set to -1. |
|
1116 |
* A null value type can be initialized to a non-null value type using this method. |
|
1117 |
* <P>Members must appear in the NameValuePairs in the order in which they appear in the IDL specification |
|
1118 |
* of the value type as indicated by the DynValue's TypeCode or they must be empty strings. |
|
1119 |
* The operation makes no attempt to assign member values based on member names. |
|
1120 |
* |
|
1121 |
* @exception TypeMismatch if the member names supplied in the passed sequence do not match the |
|
1122 |
* corresponding member name in the DynValue's TypeCode and they are not empty strings |
|
1123 |
* @exception InvalidValue if the passed sequence has a number of elements that disagrees |
|
1124 |
* with the number of members as indicated by the DynValue's TypeCode |
|
1125 |
*/ |
|
1126 |
void set_members(in NameValuePairSeq value) |
|
1127 |
raises(TypeMismatch, InvalidValue); |
|
1128 |
||
1129 |
/** |
|
1130 |
* Returns a sequence of NameDynAnyPairs describing the name and the value of each member |
|
1131 |
* in the value type. |
|
1132 |
* The sequence contains members in the same order as the declaration order of members |
|
1133 |
* as indicated by the DynValue's TypeCode. The current position is not affected. |
|
1134 |
* The member names in the returned sequence will be empty strings if the DynValue's TypeCode |
|
1135 |
* does not contain member names. |
|
1136 |
* |
|
1137 |
* @exception InvalidValue if this object represents a null value type |
|
1138 |
*/ |
|
1139 |
NameDynAnyPairSeq get_members_as_dyn_any() |
|
1140 |
raises(InvalidValue); |
|
1141 |
||
1142 |
/** |
|
1143 |
* Initializes the value type's members from a sequence of NameDynAnyPairs. |
|
1144 |
* The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, |
|
1145 |
* if an empty sequence is passed, the current position is set to -1. |
|
1146 |
* A null value type can be initialized to a non-null value type using this method. |
|
1147 |
* <P>Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification |
|
1148 |
* of the value type as indicated by the DynValue's TypeCode or they must be empty strings. |
|
1149 |
* The operation makes no attempt to assign member values based on member names. |
|
1150 |
* |
|
1151 |
* @exception TypeMismatch if the member names supplied in the passed sequence do not match the |
|
1152 |
* corresponding member name in the DynValue's TypeCode and they are not empty strings |
|
1153 |
* @exception InvalidValue if the passed sequence has a number of elements that disagrees |
|
1154 |
* with the number of members as indicated by the DynValue's TypeCode |
|
1155 |
*/ |
|
1156 |
void set_members_as_dyn_any(in NameDynAnyPairSeq value) |
|
1157 |
raises(TypeMismatch, InvalidValue); |
|
1158 |
}; |
|
1159 |
||
1160 |
/** |
|
1161 |
* DynValueBox objects support the manipulation of IDL boxed value types. |
|
1162 |
* The DynValueBox interface can represent both null and non-null value types. |
|
1163 |
* For a DynValueBox representing a non-null value type, the DynValueBox has a single component |
|
1164 |
* of the boxed type. A DynValueBox representing a null value type has no components |
|
1165 |
* and a current position of -1. |
|
1166 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1167 |
interface DynValueBox : DynValueCommon { |
4 | 1168 |
|
1169 |
/** |
|
1170 |
* Returns the boxed value as an Any. |
|
1171 |
* |
|
1172 |
* @exception InvalidValue if this object represents a null value box type |
|
1173 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1174 |
any get_boxed_value() |
4 | 1175 |
raises(InvalidValue); |
1176 |
||
1177 |
/** |
|
1178 |
* Replaces the boxed value with the specified value. |
|
1179 |
* If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. |
|
1180 |
* |
|
1181 |
* @exception TypeMismatch if this object represents a non-null value box type and the type |
|
1182 |
* of the parameter is not matching the current boxed value type. |
|
1183 |
*/ |
|
1184 |
void set_boxed_value(in any boxed) |
|
1185 |
raises(TypeMismatch); |
|
1186 |
||
1187 |
/** |
|
1188 |
* Returns the boxed value as a DynAny. |
|
1189 |
* |
|
1190 |
* @exception InvalidValue if this object represents a null value box type |
|
1191 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1192 |
DynAny get_boxed_value_as_dyn_any() |
4 | 1193 |
raises(InvalidValue); |
1194 |
||
1195 |
/** |
|
1196 |
* Replaces the boxed value with the value contained in the parameter. |
|
1197 |
* If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. |
|
1198 |
* |
|
1199 |
* @exception TypeMismatch if this object represents a non-null value box type and the type |
|
1200 |
* of the parameter is not matching the current boxed value type. |
|
1201 |
*/ |
|
149
4e9d88727ae3
6627817: Remove ^M characters in all files (Makefiles too)
ohair
parents:
4
diff
changeset
|
1202 |
void set_boxed_value_as_dyn_any(in DynAny boxed) |
4 | 1203 |
raises(TypeMismatch); |
1204 |
}; |
|
1205 |
||
1206 |
/** |
|
1207 |
* DynAny objects can be created by invoking operations on the DynAnyFactory object. |
|
1208 |
* Generally there are only two ways to create a DynAny object: |
|
1209 |
* <UL> |
|
1210 |
* <LI>invoking an operation on an existing DynAny object |
|
1211 |
* <LI>invoking an operation on a DynAnyFactory object |
|
1212 |
* </UL> |
|
1213 |
* A constructed DynAny object supports operations that enable the creation of new DynAny |
|
1214 |
* objects encapsulating access to the value of some constituent. |
|
1215 |
* DynAny objects also support the copy operation for creating new DynAny objects. |
|
1216 |
* A reference to the DynAnyFactory object is obtained by calling ORB.resolve_initial_references() |
|
1217 |
* with the identifier parameter set to the string constant "DynAnyFactory". |
|
1218 |
* <P>Dynamic interpretation of an any usually involves creating a DynAny object using create_dyn_any() |
|
1219 |
* as the first step. Depending on the type of the any, the resulting DynAny object reference can be narrowed |
|
1220 |
* to a DynFixed, DynStruct, DynSequence, DynArray, DynUnion, DynEnum, or DynValue object reference. |
|
1221 |
* <P>Dynamic creation of an any involves creating a DynAny object using create_dyn_any_from_type_code(), |
|
1222 |
* passing the TypeCode associated with the value to be created. The returned reference is narrowed to one of |
|
1223 |
* the complex types, such as DynStruct, if appropriate. Then, the value can be initialized by means of |
|
1224 |
* invoking operations on the resulting object. Finally, the to_any operation can be invoked |
|
1225 |
* to create an any value from the constructed DynAny. |
|
1226 |
*/ |
|
1227 |
interface DynAnyFactory { |
|
1228 |
#pragma sun_localservant DynAnyFactory "" |
|
1229 |
exception InconsistentTypeCode {}; |
|
1230 |
||
1231 |
/** |
|
1232 |
* Creates a new DynAny object from an any value. |
|
1233 |
* A copy of the TypeCode associated with the any value is assigned to the resulting DynAny object. |
|
1234 |
* The value associated with the DynAny object is a copy of the value in the original any. |
|
1235 |
* The current position of the created DynAny is set to zero if the passed value has components, |
|
1236 |
* to -1 otherwise |
|
1237 |
* |
|
1238 |
* @exception InconsistentTypeCode if value has a TypeCode with a TCKind of tk_Principal, |
|
1239 |
* tk_native, or tk_abstract_interface |
|
1240 |
*/ |
|
1241 |
DynAny create_dyn_any(in any value) |
|
1242 |
raises(InconsistentTypeCode); |
|
1243 |
||
1244 |
/** |
|
1245 |
* Creates a DynAny from a TypeCode. Depending on the TypeCode, the created object may be of type DynAny, |
|
1246 |
* or one of its derived types, such as DynStruct. The returned reference can be narrowed to the derived type. |
|
1247 |
* In all cases, a DynAny constructed from a TypeCode has an initial default value. |
|
1248 |
* The default values of basic types are: |
|
1249 |
* <UL> |
|
1250 |
* <LI>false for boolean |
|
1251 |
* <LI>zero for numeric types |
|
1252 |
* <LI>zero for types octet, char, and wchar |
|
1253 |
* <LI>the empty string for string and wstring |
|
1254 |
* <LI>null for object references |
|
1255 |
* <LI>a type code with a TCKind value of tk_null for type codes |
|
1256 |
* <LI>for any values, an any containing a type code with a TCKind value of tk_null type and no value |
|
1257 |
* </UL> |
|
1258 |
* For complex types, creation of the corresponding DynAny assigns a default value as follows: |
|
1259 |
* <UL> |
|
1260 |
* <LI>For DynSequence it sets the current position to -1 and creates an empty sequence. |
|
1261 |
* <LI>For DynEnum it sets the current position to -1 and sets the value of the enumerator |
|
1262 |
* to the first enumerator value indicated by the TypeCode. |
|
1263 |
* <LI>For DynFixed it sets the current position to -1 and sets the value zero. |
|
1264 |
* <LI>For DynStruct it sets the current position to -1 for empty exceptions |
|
1265 |
* and to zero for all other TypeCodes. The members (if any) are (recursively) initialized |
|
1266 |
* to their default values. |
|
1267 |
* <LI>For DynArray sets the current position to zero and (recursively) initializes elements |
|
1268 |
* to their default value. |
|
1269 |
* <LI>For DynUnion sets the current position to zero. The discriminator value is set |
|
1270 |
* to a value consistent with the first named member of the union. That member is activated and (recursively) |
|
1271 |
* initialized to its default value. |
|
1272 |
* <LI>For DynValue and DynValueBox it initializes to a null value. |
|
1273 |
* </UL> |
|
1274 |
*/ |
|
1275 |
DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) |
|
1276 |
raises(InconsistentTypeCode); |
|
1277 |
}; |
|
1278 |
}; // module DynamicAny |
|
1279 |
||
1280 |
#endif // _DYNAMIC_ANY_IDL_ |