1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/org/omg/DynamicAny/DynamicAny.idl Wed Apr 27 01:21:28 2016 +0800 1.3 @@ -0,0 +1,1280 @@ 1.4 +/* 1.5 + * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +// IDL 1.30 +// File: DynamicAny.idl 1.31 + 1.32 +#ifndef _DYNAMIC_ANY_IDL_ 1.33 +#define _DYNAMIC_ANY_IDL_ 1.34 + 1.35 +#pragma prefix "omg.org" 1.36 +#include <orb.idl> 1.37 + 1.38 +/** 1.39 +* An any can be passed to a program that doesn't have any static information for the 1.40 +type of the any (code generated for the type by an IDL compiler has not been 1.41 +compiled with the object implementation). As a result, the object receiving the any 1.42 +does not have a portable method of using it. 1.43 +<P>DynAnys enable traversal of the data value associated with an any at 1.44 +runtime and extraction of the primitive constituents of the data value. This is especially 1.45 +helpful for writing powerful generic servers (bridges, event channels supporting 1.46 +filtering). 1.47 +<P>Similarly, this facility enables the construction of an any at runtime, without having 1.48 +static knowledge of its type. This is especially helpful for writing generic clients 1.49 +(bridges, browsers, debuggers, user interface tools). 1.50 +*/ 1.51 +module DynamicAny { 1.52 + /** 1.53 + * Any values can be dynamically interpreted (traversed) and constructed through DynAny objects. 1.54 + * A DynAny object is associated with a data value which corresponds to a copy of the value 1.55 + * inserted into an any. 1.56 + * <P>A DynAny object may be viewed as an ordered collection of component DynAnys. 1.57 + * For DynAnys representing a basic type, such as long, or a type without components, 1.58 + * such as an empty exception, the ordered collection of components is empty. 1.59 + * Each DynAny object maintains the notion of a current position into its collection 1.60 + * of component DynAnys. The current position is identified by an index value that runs 1.61 + * from 0 to n-1, where n is the number of components. 1.62 + * The special index value -1 indicates a current position that points nowhere. 1.63 + * For values that cannot have a current position (such as an empty exception), 1.64 + * the index value is fixed at -1. 1.65 + * If a DynAny is initialized with a value that has components, the index is initialized to 0. 1.66 + * After creation of an uninitialized DynAny (that is, a DynAny that has no value but a TypeCode 1.67 + * that permits components), the current position depends on the type of value represented by 1.68 + * the DynAny. (The current position is set to 0 or -1, depending on whether the new DynAny 1.69 + * gets default values for its components.) 1.70 + * <P>The iteration operations rewind, seek, and next can be used to change the current position 1.71 + * and the current_component operation returns the component at the current position. 1.72 + * The component_count operation returns the number of components of a DynAny. 1.73 + * Collectively, these operations enable iteration over the components of a DynAny, for example, 1.74 + * to (recursively) examine its contents. 1.75 + * <P>A constructed DynAny object is a DynAny object associated with a constructed type. 1.76 + * There is a different interface, inheriting from the DynAny interface, associated with 1.77 + * each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array, 1.78 + * exception, and value type). 1.79 + * <P>A constructed DynAny object exports operations that enable the creation of new DynAny objects, 1.80 + * each of them associated with a component of the constructed data value. 1.81 + * As an example, a DynStruct is associated with a struct value. This means that the DynStruct 1.82 + * may be seen as owning an ordered collection of components, one for each structure member. 1.83 + * The DynStruct object exports operations that enable the creation of new DynAny objects, 1.84 + * each of them associated with a member of the struct. 1.85 + * <P>If a DynAny object has been obtained from another (constructed) DynAny object, 1.86 + * such as a DynAny representing a structure member that was created from a DynStruct, 1.87 + * the member DynAny is logically contained in the DynStruct. 1.88 + * Calling an insert or get operation leaves the current position unchanged. 1.89 + * Destroying a top-level DynAny object (one that was not obtained as a component of another DynAny) 1.90 + * also destroys any component DynAny objects obtained from it. 1.91 + * Destroying a non-top level DynAny object does nothing. 1.92 + * Invoking operations on a destroyed top-level DynAny or any of its descendants raises OBJECT_NOT_EXIST. 1.93 + * If the programmer wants to destroy a DynAny object but still wants to manipulate some component 1.94 + * of the data value associated with it, then he or she should first create a DynAny for the component 1.95 + * and, after that, make a copy of the created DynAny object. 1.96 + * <P>The behavior of DynAny objects has been defined in order to enable efficient implementations 1.97 + * in terms of allocated memory space and speed of access. DynAny objects are intended to be used 1.98 + * for traversing values extracted from anys or constructing values of anys at runtime. 1.99 + * Their use for other purposes is not recommended. 1.100 + * <P>Insert and get operations are necessary to handle basic DynAny objects 1.101 + * but are also helpful to handle constructed DynAny objects. 1.102 + * Inserting a basic data type value into a constructed DynAny object 1.103 + * implies initializing the current component of the constructed data value 1.104 + * associated with the DynAny object. For example, invoking insert_boolean on a 1.105 + * DynStruct implies inserting a boolean data value at the current position 1.106 + * of the associated struct data value. 1.107 + * A type is consistent for inserting or extracting a value if its TypeCode is equivalent to 1.108 + * the TypeCode contained in the DynAny or, if the DynAny has components, is equivalent to the TypeCode 1.109 + * of the DynAny at the current position. 1.110 + * <P>DynAny and DynAnyFactory objects are intended to be local to the process in which they are 1.111 + * created and used. This means that references to DynAny and DynAnyFactory objects cannot be exported 1.112 + * to other processes, or externalized with ORB.object_to_string(). 1.113 + * If any attempt is made to do so, the offending operation will raise a MARSHAL system exception. 1.114 + * Since their interfaces are specified in IDL, DynAny objects export operations defined in the standard 1.115 + * org.omg.CORBA.Object interface. However, any attempt to invoke operations exported through the Object 1.116 + * interface may raise the standard NO_IMPLEMENT exception. 1.117 + * An attempt to use a DynAny object with the DII may raise the NO_IMPLEMENT exception. 1.118 + */ 1.119 + interface DynAny { 1.120 + #pragma sun_localservant DynAny "" 1.121 + exception InvalidValue {}; 1.122 + exception TypeMismatch {}; 1.123 + 1.124 + /** 1.125 + * Returns the TypeCode associated with this DynAny object. 1.126 + * A DynAny object is created with a TypeCode value assigned to it. 1.127 + * This TypeCode value determines the type of the value handled through the DynAny object. 1.128 + * Note that the TypeCode associated with a DynAny object is initialized at the time the 1.129 + * DynAny is created and cannot be changed during lifetime of the DynAny object. 1.130 + * 1.131 + * @return The TypeCode associated with this DynAny object 1.132 + */ 1.133 + CORBA::TypeCode type(); 1.134 + 1.135 + /** 1.136 + * Initializes the value associated with a DynAny object with the value 1.137 + * associated with another DynAny object. 1.138 + * The current position of the target DynAny is set to zero for values that have components 1.139 + * and to -1 for values that do not have components. 1.140 + * 1.141 + * @param dyn_any 1.142 + * @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of target DynAny 1.143 + */ 1.144 + void assign(in DynAny dyn_any) 1.145 + raises(TypeMismatch); 1.146 + 1.147 + /** 1.148 + * Initializes the value associated with a DynAny object with the value contained in an any. 1.149 + * The current position of the target DynAny is set to zero for values that have components 1.150 + * and to -1 for values that do not have components. 1.151 + * 1.152 + * @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target DynAny 1.153 + * @exception InvalidValue if the passed Any does not contain a legal value (such as a null string) 1.154 + */ 1.155 + void from_any(in any value) 1.156 + raises(TypeMismatch, InvalidValue); 1.157 + 1.158 + /** 1.159 + * Creates an any value from a DynAny object. 1.160 + * A copy of the TypeCode associated with the DynAny object is assigned to the resulting any. 1.161 + * The value associated with the DynAny object is copied into the any. 1.162 + * 1.163 + * @return a new Any object with the same value and TypeCode 1.164 + */ 1.165 + any to_any(); 1.166 + 1.167 + /** 1.168 + * Compares two DynAny values for equality. 1.169 + * Two DynAny values are equal if their TypeCodes are equivalent and, recursively, all component DynAnys 1.170 + * have equal values. 1.171 + * The current position of the two DynAnys being compared has no effect on the result of equal. 1.172 + * 1.173 + * @return true of the DynAnys are equal, false otherwise 1.174 + */ 1.175 + boolean equal(in DynAny dyn_any); 1.176 + 1.177 + /** 1.178 + * Destroys a DynAny object. 1.179 + * This operation frees any resources used to represent the data value associated with a DynAny object. 1.180 + * It must be invoked on references obtained from one of the creation operations on the ORB interface 1.181 + * or on a reference returned by DynAny.copy() to avoid resource leaks. 1.182 + * Invoking destroy on component DynAny objects (for example, on objects returned by the 1.183 + * current_component operation) does nothing. 1.184 + * Destruction of a DynAny object implies destruction of all DynAny objects obtained from it. 1.185 + * That is, references to components of a destroyed DynAny become invalid. 1.186 + * Invocations on such references raise OBJECT_NOT_EXIST. 1.187 + * It is possible to manipulate a component of a DynAny beyond the life time of the DynAny 1.188 + * from which the component was obtained by making a copy of the component with the copy operation 1.189 + * before destroying the DynAny from which the component was obtained. 1.190 + */ 1.191 + void destroy(); 1.192 + 1.193 + /** 1.194 + * Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked. 1.195 + * The operation is polymorphic, that is, invoking it on one of the types derived from DynAny, 1.196 + * such as DynStruct, creates the derived type but returns its reference as the DynAny base type. 1.197 + * 1.198 + * @return a deep copy of the DynAny object 1.199 + */ 1.200 + DynAny copy(); 1.201 + 1.202 + /** 1.203 + * Inserts a boolean value into the DynAny. 1.204 + * 1.205 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.206 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.207 + */ 1.208 + void insert_boolean(in boolean value) 1.209 + raises(TypeMismatch, InvalidValue); 1.210 + 1.211 + /** 1.212 + * Inserts a byte value into the DynAny. The IDL octet data type is mapped to the Java byte data type. 1.213 + * 1.214 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.215 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.216 + */ 1.217 + void insert_octet(in octet value) 1.218 + raises(TypeMismatch, InvalidValue); 1.219 + 1.220 + /** 1.221 + * Inserts a char value into the DynAny. 1.222 + * 1.223 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.224 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.225 + */ 1.226 + void insert_char(in char value) 1.227 + raises(TypeMismatch, InvalidValue); 1.228 + 1.229 + /** 1.230 + * Inserts a short value into the DynAny. 1.231 + * 1.232 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.233 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.234 + */ 1.235 + void insert_short(in short value) 1.236 + raises(TypeMismatch, InvalidValue); 1.237 + 1.238 + /** 1.239 + * Inserts a short value into the DynAny. The IDL ushort data type is mapped to the Java short data type. 1.240 + * 1.241 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.242 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.243 + */ 1.244 + void insert_ushort(in unsigned short value) 1.245 + raises(TypeMismatch, InvalidValue); 1.246 + 1.247 + /** 1.248 + * Inserts an integer value into the DynAny. The IDL long data type is mapped to the Java int data type. 1.249 + * 1.250 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.251 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.252 + */ 1.253 + void insert_long(in long value) 1.254 + raises(TypeMismatch, InvalidValue); 1.255 + 1.256 + /** 1.257 + * Inserts an integer value into the DynAny. The IDL ulong data type is mapped to the Java int data type. 1.258 + * 1.259 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.260 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.261 + */ 1.262 + void insert_ulong(in unsigned long value) 1.263 + raises(TypeMismatch, InvalidValue); 1.264 + 1.265 + /** 1.266 + * Inserts a float value into the DynAny. 1.267 + * 1.268 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.269 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.270 + */ 1.271 + void insert_float(in float value) 1.272 + raises(TypeMismatch, InvalidValue); 1.273 + 1.274 + /** 1.275 + * Inserts a double value into the DynAny. 1.276 + * 1.277 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.278 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.279 + */ 1.280 + void insert_double(in double value) 1.281 + raises(TypeMismatch, InvalidValue); 1.282 + 1.283 + /** 1.284 + * Inserts a string value into the DynAny. 1.285 + * Both bounded and unbounded strings are inserted using this method. 1.286 + * 1.287 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.288 + * @exception InvalidValue if the string inserted is longer than the bound of a bounded string 1.289 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.290 + */ 1.291 + void insert_string(in string value) 1.292 + raises(TypeMismatch, InvalidValue); 1.293 + 1.294 + /** 1.295 + * Inserts a reference to a CORBA object into the DynAny. 1.296 + * 1.297 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.298 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.299 + */ 1.300 + void insert_reference(in Object value) 1.301 + raises(TypeMismatch, InvalidValue); 1.302 + 1.303 + /** 1.304 + * Inserts a TypeCode object into the DynAny. 1.305 + * 1.306 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.307 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.308 + */ 1.309 + void insert_typecode(in CORBA::TypeCode value) 1.310 + raises(TypeMismatch, InvalidValue); 1.311 + 1.312 + /** 1.313 + * Inserts a long value into the DynAny. The IDL long long data type is mapped to the Java long data type. 1.314 + * 1.315 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.316 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.317 + */ 1.318 + void insert_longlong(in long long value) 1.319 + raises(TypeMismatch, InvalidValue); 1.320 + 1.321 + /** 1.322 + * Inserts a long value into the DynAny. 1.323 + * The IDL unsigned long long data type is mapped to the Java long data type. 1.324 + * 1.325 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.326 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.327 + */ 1.328 + void insert_ulonglong(in unsigned long long value) 1.329 + raises(TypeMismatch, InvalidValue); 1.330 + 1.331 +// void insert_longdouble(in long double value) 1.332 +// raises(TypeMismatch, InvalidValue); 1.333 + 1.334 + /** 1.335 + * Inserts a char value into the DynAny. The IDL wchar data type is mapped to the Java char data type. 1.336 + * 1.337 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.338 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.339 + */ 1.340 + void insert_wchar(in wchar value) 1.341 + raises(TypeMismatch, InvalidValue); 1.342 + 1.343 + /** 1.344 + * Inserts a string value into the DynAny. 1.345 + * Both bounded and unbounded strings are inserted using this method. 1.346 + * 1.347 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.348 + * @exception InvalidValue if the string inserted is longer than the bound of a bounded string 1.349 + */ 1.350 + void insert_wstring(in wstring value) 1.351 + raises(TypeMismatch, InvalidValue); 1.352 + 1.353 + /** 1.354 + * Inserts an Any value into the Any represented by this DynAny. 1.355 + * 1.356 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.357 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.358 + */ 1.359 + void insert_any(in any value) 1.360 + raises(TypeMismatch, InvalidValue); 1.361 + 1.362 + /** 1.363 + * Inserts the Any value contained in the parameter DynAny into the Any represented by this DynAny. 1.364 + * 1.365 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.366 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.367 + */ 1.368 + void insert_dyn_any(in DynAny value) 1.369 + raises(TypeMismatch, InvalidValue); 1.370 + 1.371 + /** 1.372 + * Inserts a reference to a Serializable object into this DynAny. 1.373 + * The IDL ValueBase type is mapped to the Java Serializable type. 1.374 + * 1.375 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.376 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.377 + */ 1.378 + void insert_val(in ValueBase value) 1.379 + raises(TypeMismatch, InvalidValue); 1.380 + 1.381 + /** 1.382 + * Extracts the boolean value from this DynAny. 1.383 + * 1.384 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.385 + * that is not equivalent to the requested type. 1.386 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.387 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.388 + */ 1.389 + boolean get_boolean() 1.390 + raises(TypeMismatch, InvalidValue); 1.391 + 1.392 + /** 1.393 + * Extracts the byte value from this DynAny. The IDL octet data type is mapped to the Java byte data type. 1.394 + * 1.395 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.396 + * that is not equivalent to the requested type. 1.397 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.398 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.399 + */ 1.400 + octet get_octet() 1.401 + raises(TypeMismatch, InvalidValue); 1.402 + 1.403 + /** 1.404 + * Extracts the char value from this DynAny. 1.405 + * 1.406 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.407 + * that is not equivalent to the requested type. 1.408 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.409 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.410 + */ 1.411 + char get_char() 1.412 + raises(TypeMismatch, InvalidValue); 1.413 + 1.414 + /** 1.415 + * Extracts the short value from this DynAny. 1.416 + * 1.417 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.418 + * that is not equivalent to the requested type. 1.419 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.420 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.421 + */ 1.422 + short get_short() 1.423 + raises(TypeMismatch, InvalidValue); 1.424 + 1.425 + /** 1.426 + * Extracts the short value from this DynAny. The IDL ushort data type is mapped to the Java short data type. 1.427 + * 1.428 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.429 + * that is not equivalent to the requested type. 1.430 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.431 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.432 + */ 1.433 + unsigned short get_ushort() 1.434 + raises(TypeMismatch, InvalidValue); 1.435 + 1.436 + /** 1.437 + * Extracts the integer value from this DynAny. The IDL long data type is mapped to the Java int data type. 1.438 + * 1.439 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.440 + * that is not equivalent to the requested type. 1.441 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.442 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.443 + */ 1.444 + long get_long() 1.445 + raises(TypeMismatch, InvalidValue); 1.446 + 1.447 + /** 1.448 + * Extracts the integer value from this DynAny. The IDL ulong data type is mapped to the Java int data type. 1.449 + * 1.450 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.451 + * that is not equivalent to the requested type. 1.452 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.453 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.454 + */ 1.455 + unsigned long get_ulong() 1.456 + raises(TypeMismatch, InvalidValue); 1.457 + 1.458 + /** 1.459 + * Extracts the float value from this DynAny. 1.460 + * 1.461 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.462 + * that is not equivalent to the requested type. 1.463 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.464 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.465 + */ 1.466 + float get_float() 1.467 + raises(TypeMismatch, InvalidValue); 1.468 + 1.469 + /** 1.470 + * Extracts the double value from this DynAny. 1.471 + * 1.472 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.473 + * that is not equivalent to the requested type. 1.474 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.475 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.476 + */ 1.477 + double get_double() 1.478 + raises(TypeMismatch, InvalidValue); 1.479 + 1.480 + /** 1.481 + * Extracts the string value from this DynAny. 1.482 + * Both bounded and unbounded strings are extracted using this method. 1.483 + * 1.484 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.485 + * that is not equivalent to the requested type. 1.486 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.487 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.488 + */ 1.489 + string get_string() 1.490 + raises(TypeMismatch, InvalidValue); 1.491 + 1.492 + /** 1.493 + * Extracts the reference to a CORBA Object from this DynAny. 1.494 + * 1.495 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.496 + * that is not equivalent to the requested type. 1.497 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.498 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.499 + */ 1.500 + Object get_reference() 1.501 + raises(TypeMismatch, InvalidValue); 1.502 + 1.503 + /** 1.504 + * Extracts the TypeCode object from this DynAny. 1.505 + * 1.506 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.507 + * that is not equivalent to the requested type. 1.508 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.509 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.510 + */ 1.511 + CORBA::TypeCode get_typecode() 1.512 + raises(TypeMismatch, InvalidValue); 1.513 + 1.514 + /** 1.515 + * Extracts the long value from this DynAny. The IDL long long data type is mapped to the Java long data type. 1.516 + * 1.517 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.518 + * that is not equivalent to the requested type. 1.519 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.520 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.521 + */ 1.522 + long long get_longlong() 1.523 + raises(TypeMismatch, InvalidValue); 1.524 + 1.525 + /** 1.526 + * Extracts the long value from this DynAny. 1.527 + * The IDL unsigned long long data type is mapped to the Java long data type. 1.528 + * 1.529 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.530 + * that is not equivalent to the requested type. 1.531 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.532 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.533 + */ 1.534 + unsigned long long get_ulonglong() 1.535 + raises(TypeMismatch, InvalidValue); 1.536 +// long double get_longdouble() 1.537 +// raises(TypeMismatch, InvalidValue); 1.538 + 1.539 + /** 1.540 + * Extracts the long value from this DynAny. The IDL wchar data type is mapped to the Java char data type. 1.541 + * 1.542 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.543 + * that is not equivalent to the requested type. 1.544 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.545 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.546 + */ 1.547 + wchar get_wchar() 1.548 + raises(TypeMismatch, InvalidValue); 1.549 + 1.550 + /** 1.551 + * Extracts the string value from this DynAny. 1.552 + * Both bounded and unbounded strings are extracted using this method. 1.553 + * 1.554 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.555 + * that is not equivalent to the requested type. 1.556 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.557 + */ 1.558 + wstring get_wstring() 1.559 + raises(TypeMismatch, InvalidValue); 1.560 + 1.561 + /** 1.562 + * Extracts an Any value contained in the Any represented by this DynAny. 1.563 + * 1.564 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.565 + * that is not equivalent to the requested type. 1.566 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.567 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.568 + */ 1.569 + any get_any() 1.570 + raises(TypeMismatch, InvalidValue); 1.571 + 1.572 + /** 1.573 + * Extracts the Any value contained in the Any represented by this DynAny and returns it wrapped 1.574 + * into a new DynAny. 1.575 + * 1.576 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.577 + * that is not equivalent to the requested type. 1.578 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.579 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.580 + */ 1.581 + DynAny get_dyn_any() 1.582 + raises(TypeMismatch, InvalidValue); 1.583 + 1.584 + /** 1.585 + * Extracts a Serializable object from this DynAny. 1.586 + * The IDL ValueBase type is mapped to the Java Serializable type. 1.587 + * 1.588 + * @exception TypeMismatch if the accessed component in the DynAny is of a type 1.589 + * that is not equivalent to the requested type. 1.590 + * @exception TypeMismatch if called on a DynAny whose current component itself has components 1.591 + * @exception InvalidValue if this DynAny has components but has a current position of -1 1.592 + */ 1.593 + ValueBase get_val() 1.594 + raises(TypeMismatch, InvalidValue); 1.595 + 1.596 + /** 1.597 + * Sets the current position to index. The current position is indexed 0 to n-1, that is, 1.598 + * index zero corresponds to the first component. The operation returns true if the resulting 1.599 + * current position indicates a component of the DynAny and false if index indicates 1.600 + * a position that does not correspond to a component. 1.601 + * Calling seek with a negative index is legal. It sets the current position to -1 to indicate 1.602 + * no component and returns false. Passing a non-negative index value for a DynAny that does not 1.603 + * have a component at the corresponding position sets the current position to -1 and returns false. 1.604 + */ 1.605 + boolean seek(in long index); 1.606 + 1.607 + /** 1.608 + * Is equivalent to seek(0). 1.609 + */ 1.610 + void rewind(); 1.611 + 1.612 + /** 1.613 + * Advances the current position to the next component. 1.614 + * The operation returns true while the resulting current position indicates a component, false otherwise. 1.615 + * A false return value leaves the current position at -1. 1.616 + * Invoking next on a DynAny without components leaves the current position at -1 and returns false. 1.617 + */ 1.618 + boolean next(); 1.619 + 1.620 + /** 1.621 + * Returns the number of components of a DynAny. 1.622 + * For a DynAny without components, it returns zero. 1.623 + * The operation only counts the components at the top level. 1.624 + * For example, if component_count is invoked on a DynStruct with a single member, 1.625 + * the return value is 1, irrespective of the type of the member. 1.626 + * <UL> 1.627 + * <LI>For sequences, the operation returns the current number of elements. 1.628 + * <LI>For structures, exceptions, and value types, the operation returns the number of members. 1.629 + * <LI>For arrays, the operation returns the number of elements. 1.630 + * <LI>For unions, the operation returns 2 if the discriminator indicates that a named member is active, 1.631 + * otherwise, it returns 1. 1.632 + * <LI>For DynFixed and DynEnum, the operation returns zero. 1.633 + * </UL> 1.634 + */ 1.635 + unsigned long component_count(); 1.636 + 1.637 + /** 1.638 + * Returns the DynAny for the component at the current position. 1.639 + * It does not advance the current position, so repeated calls to current_component 1.640 + * without an intervening call to rewind, next, or seek return the same component. 1.641 + * The returned DynAny object reference can be used to get/set the value of the current component. 1.642 + * If the current component represents a complex type, the returned reference can be narrowed 1.643 + * based on the TypeCode to get the interface corresponding to the to the complex type. 1.644 + * Calling current_component on a DynAny that cannot have components, 1.645 + * such as a DynEnum or an empty exception, raises TypeMismatch. 1.646 + * Calling current_component on a DynAny whose current position is -1 returns a nil reference. 1.647 + * The iteration operations, together with current_component, can be used 1.648 + * to dynamically compose an any value. After creating a dynamic any, such as a DynStruct, 1.649 + * current_component and next can be used to initialize all the components of the value. 1.650 + * Once the dynamic value is completely initialized, to_any creates the corresponding any value. 1.651 + * 1.652 + * @exception TypeMismatch If called on a DynAny that cannot have components, 1.653 + * such as a DynEnum or an empty exception 1.654 + */ 1.655 + DynAny current_component() 1.656 + raises(TypeMismatch); 1.657 + }; 1.658 + 1.659 + /** 1.660 + * DynFixed objects support the manipulation of IDL fixed values. 1.661 + * Because IDL does not have a generic type that can represent fixed types with arbitrary 1.662 + * number of digits and arbitrary scale, the operations use the IDL string type. 1.663 + */ 1.664 + interface DynFixed : DynAny { 1.665 + #pragma sun_localservant DynFixed "" 1.666 + 1.667 + /** 1.668 + * Returns the value of a DynFixed. 1.669 + */ 1.670 + string get_value(); 1.671 + 1.672 + /** 1.673 + * Sets the value of the DynFixed. 1.674 + * The val string must contain a fixed string constant in the same format as used for IDL fixed-point literals. 1.675 + * However, the trailing d or D is optional. The return value is true if val can be represented as the DynFixed 1.676 + * without loss of precision. If val has more fractional digits than can be represented in the DynFixed, 1.677 + * fractional digits are truncated and the return value is false. 1.678 + * 1.679 + * @exception TypeMismatch If val does not contain a valid fixed-point literal or contains extraneous 1.680 + * characters other than leading or trailing white space 1.681 + * @exception InvalidValue If val contains a value whose scale exceeds that of the DynFixed 1.682 + * or is not initialized 1.683 + */ 1.684 + boolean set_value(in string val) 1.685 + raises(TypeMismatch, InvalidValue); 1.686 + }; 1.687 + 1.688 + /** 1.689 + * DynEnum objects support the manipulation of IDL enumerated values. 1.690 + * The current position of a DynEnum is always -1. 1.691 + */ 1.692 + interface DynEnum : DynAny { 1.693 + #pragma sun_localservant DynEnum "" 1.694 + 1.695 + /** 1.696 + * Returns the value of the DynEnum as an IDL identifier. 1.697 + */ 1.698 + string get_as_string(); 1.699 + 1.700 + /** 1.701 + * Sets the value of the DynEnum to the enumerated value whose IDL identifier is passed in the value parameter. 1.702 + * 1.703 + * @exception InvalidValue If value contains a string that is not a valid IDL identifier 1.704 + * for the corresponding enumerated type 1.705 + */ 1.706 + void set_as_string(in string value) 1.707 + raises(InvalidValue); 1.708 + 1.709 + /** 1.710 + * Returns the value of the DynEnum as the enumerated value's ordinal value. 1.711 + * Enumerators have ordinal values 0 to n-1, as they appear from left to right 1.712 + * in the corresponding IDL definition. 1.713 + */ 1.714 + unsigned long get_as_ulong(); 1.715 + 1.716 + /** 1.717 + * Sets the value of the DynEnum as the enumerated value's ordinal value. 1.718 + * 1.719 + * @exception InvalidValue If value contains a value that is outside the range of ordinal values 1.720 + * for the corresponding enumerated type 1.721 + */ 1.722 + void set_as_ulong(in unsigned long value) 1.723 + raises(InvalidValue); 1.724 + }; 1.725 + 1.726 + typedef string FieldName; 1.727 + 1.728 + /** 1.729 + * NameValuePairs associate a name with an Any object. 1.730 + */ 1.731 + struct NameValuePair { 1.732 + /** 1.733 + * The name associated with the Any. 1.734 + */ 1.735 + FieldName id; 1.736 + /** 1.737 + * The Any value associated with the name. 1.738 + */ 1.739 + any value; 1.740 + }; 1.741 + typedef sequence<NameValuePair> NameValuePairSeq; 1.742 + 1.743 + /** 1.744 + * NameDynAnyPairs associate a name with an DynAny object. 1.745 + */ 1.746 + struct NameDynAnyPair { 1.747 + /** 1.748 + * The name associated with the DynAny. 1.749 + */ 1.750 + FieldName id; 1.751 + /** 1.752 + * The DynAny value associated with the name. 1.753 + */ 1.754 + DynAny value; 1.755 + }; 1.756 + typedef sequence<NameDynAnyPair> NameDynAnyPairSeq; 1.757 + 1.758 + /** 1.759 + * DynStruct objects support the manipulation of IDL struct and exception values. 1.760 + * Members of the exceptions are handled in the same way as members of a struct. 1.761 + */ 1.762 + interface DynStruct : DynAny { 1.763 + #pragma sun_localservant DynStruct "" 1.764 + 1.765 + /** 1.766 + * Returns the name of the member at the current position. 1.767 + * This operation may return an empty string since the TypeCode of the value being 1.768 + * manipulated may not contain the names of members. 1.769 + * 1.770 + * @exception TypeMismatch if the DynStruct represents an empty exception. 1.771 + * @exception InvalidValue if the current position does not indicate a member 1.772 + */ 1.773 + FieldName current_member_name() 1.774 + raises(TypeMismatch, InvalidValue); 1.775 + 1.776 + /** 1.777 + * Returns the TCKind associated with the member at the current position. 1.778 + * 1.779 + * @exception TypeMismatch if the DynStruct represents an empty exception. 1.780 + * @exception InvalidValue if the current position does not indicate a member 1.781 + */ 1.782 + CORBA::TCKind current_member_kind() 1.783 + raises(TypeMismatch, InvalidValue); 1.784 + 1.785 + /** 1.786 + * Returns a sequence of NameValuePairs describing the name and the value of each member 1.787 + * in the struct associated with a DynStruct object. 1.788 + * The sequence contains members in the same order as the declaration order of members 1.789 + * as indicated by the DynStruct's TypeCode. The current position is not affected. 1.790 + * The member names in the returned sequence will be empty strings if the DynStruct's TypeCode 1.791 + * does not contain member names. 1.792 + */ 1.793 + NameValuePairSeq get_members(); 1.794 + 1.795 + /** 1.796 + * Initializes the struct data value associated with a DynStruct object from a sequence of NameValuePairs. 1.797 + * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, 1.798 + * if an empty sequence is passed, the current position is set to -1. 1.799 + * <P>Members must appear in the NameValuePairs in the order in which they appear in the IDL specification 1.800 + * of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. 1.801 + * The operation makes no attempt to assign member values based on member names. 1.802 + * 1.803 + * @exception TypeMismatch if the member names supplied in the passed sequence do not match the 1.804 + * corresponding member name in the DynStruct's TypeCode and they are not empty strings 1.805 + * @exception InvalidValue if the passed sequence has a number of elements that disagrees 1.806 + * with the number of members as indicated by the DynStruct's TypeCode 1.807 + */ 1.808 + void set_members(in NameValuePairSeq value) 1.809 + raises(TypeMismatch, InvalidValue); 1.810 + 1.811 + /** 1.812 + * Returns a sequence of NameDynAnyPairs describing the name and the value of each member 1.813 + * in the struct associated with a DynStruct object. 1.814 + * The sequence contains members in the same order as the declaration order of members 1.815 + * as indicated by the DynStruct's TypeCode. The current position is not affected. 1.816 + * The member names in the returned sequence will be empty strings if the DynStruct's TypeCode 1.817 + * does not contain member names. 1.818 + */ 1.819 + NameDynAnyPairSeq get_members_as_dyn_any(); 1.820 + 1.821 + /** 1.822 + * Initializes the struct data value associated with a DynStruct object from a sequence of NameDynAnyPairs. 1.823 + * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, 1.824 + * if an empty sequence is passed, the current position is set to -1. 1.825 + * <P>Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification 1.826 + * of the struct as indicated by the DynStruct's TypeCode or they must be empty strings. 1.827 + * The operation makes no attempt to assign member values based on member names. 1.828 + * 1.829 + * @exception TypeMismatch if the member names supplied in the passed sequence do not match the 1.830 + * corresponding member name in the DynStruct's TypeCode and they are not empty strings 1.831 + * @exception InvalidValue if the passed sequence has a number of elements that disagrees 1.832 + * with the number of members as indicated by the DynStruct's TypeCode 1.833 + */ 1.834 + void set_members_as_dyn_any(in NameDynAnyPairSeq value) 1.835 + raises(TypeMismatch, InvalidValue); 1.836 + }; 1.837 + 1.838 + /** 1.839 + * DynUnion objects support the manipulation of IDL unions. 1.840 + * A union can have only two valid current positions: 1.841 + * <UL> 1.842 + * <LI>zero, which denotes the discriminator 1.843 + * <LI>one, which denotes the active member 1.844 + * </UL> 1.845 + * The component_count value for a union depends on the current discriminator: 1.846 + * it is 2 for a union whose discriminator indicates a named member, and 1 otherwise. 1.847 + */ 1.848 + interface DynUnion : DynAny { 1.849 + #pragma sun_localservant DynUnion "" 1.850 + 1.851 + /** 1.852 + * Returns the current discriminator value. 1.853 + */ 1.854 + DynAny get_discriminator(); 1.855 + 1.856 + /** 1.857 + * Sets the discriminator of the DynUnion to the specified value. 1.858 + * Setting the discriminator to a value that is consistent with the currently active union member 1.859 + * does not affect the currently active member. Setting the discriminator to a value that is inconsistent 1.860 + * with the currently active member deactivates the member and activates the member that is consistent 1.861 + * with the new discriminator value (if there is a member for that value) by initializing the member 1.862 + * to its default value. 1.863 + * Setting the discriminator of a union sets the current position to 0 if the discriminator value 1.864 + * indicates a non-existent union member (has_no_active_member returns true in this case). 1.865 + * Otherwise, if the discriminator value indicates a named union member, the current position is set to 1 1.866 + * (has_no_active_member returns false and component_count returns 2 in this case). 1.867 + * 1.868 + * @exception TypeMismatch if the TypeCode of the parameter is not equivalent to the TypeCode 1.869 + * of the union's discriminator 1.870 + */ 1.871 + void set_discriminator(in DynAny d) 1.872 + raises(TypeMismatch); 1.873 + 1.874 + /** 1.875 + * Sets the discriminator to a value that is consistent with the value of the default case of a union. 1.876 + * It sets the current position to zero and causes component_count to return 2. 1.877 + * 1.878 + * @exception TypeMismatch if the union does not have an explicit default case 1.879 + */ 1.880 + void set_to_default_member() 1.881 + raises(TypeMismatch); 1.882 + 1.883 + /** 1.884 + * Sets the discriminator to a value that does not correspond to any of the unions case labels. 1.885 + * It sets the current position to zero and causes component_count to return 1. 1.886 + * 1.887 + * @exception TypeMismatch if the union has an explicit default case or if it uses the entire range 1.888 + * of discriminator values for explicit case labels 1.889 + */ 1.890 + void set_to_no_active_member() 1.891 + raises(TypeMismatch); 1.892 + 1.893 + /** 1.894 + * Returns true if the union has no active member, that is, the unions value consists solely 1.895 + * of its discriminator because the discriminator has a value that is not listed as an explicit case label. 1.896 + * Calling this operation on a union that has a default case returns false. 1.897 + * Calling this operation on a union that uses the entire range of discriminator values 1.898 + * for explicit case labels returns false. 1.899 + */ 1.900 + boolean has_no_active_member(); 1.901 + 1.902 + /** 1.903 + * Returns the TCKind value of the discriminators TypeCode. 1.904 + */ 1.905 + CORBA::TCKind discriminator_kind(); 1.906 + 1.907 + /** 1.908 + * Returns the TCKind value of the currently active members TypeCode. 1.909 + * 1.910 + * @exception InvalidValue if the union does not have a currently active member 1.911 + */ 1.912 + CORBA::TCKind member_kind() 1.913 + raises(InvalidValue); 1.914 + 1.915 + /** 1.916 + * Returns the currently active member. Note that the returned reference remains valid only 1.917 + * for as long as the currently active member does not change. Using the returned reference 1.918 + * beyond the life time of the currently active member raises OBJECT_NOT_EXIST. 1.919 + * 1.920 + * @exception InvalidValue if the union has no active member 1.921 + */ 1.922 + DynAny member() 1.923 + raises(InvalidValue); 1.924 + 1.925 + /** 1.926 + * Returns the name of the currently active member. If the unions TypeCode does not contain 1.927 + * a member name for the currently active member, the operation returns an empty string. 1.928 + * 1.929 + * @exception InvalidValue if the union has no active member 1.930 + */ 1.931 + FieldName member_name() 1.932 + raises(InvalidValue); 1.933 + }; 1.934 + 1.935 + typedef sequence<any> AnySeq; 1.936 + typedef sequence<DynAny> DynAnySeq; 1.937 + 1.938 + /** 1.939 + * DynSequence objects support the manipulation of IDL sequences. 1.940 + */ 1.941 + interface DynSequence : DynAny { 1.942 + #pragma sun_localservant DynSequence "" 1.943 + 1.944 + /** 1.945 + * Returns the current length of the sequence. 1.946 + */ 1.947 + unsigned long get_length(); 1.948 + 1.949 + /** 1.950 + * Sets the length of the sequence. 1.951 + * Increasing the length of a sequence adds new elements at the tail without affecting the values 1.952 + * of already existing elements. Newly added elements are default-initialized. 1.953 + * Increasing the length of a sequence sets the current position to the first newly-added element 1.954 + * if the previous current position was -1. Otherwise, if the previous current position was not -1, 1.955 + * the current position is not affected. 1.956 + * Decreasing the length of a sequence removes elements from the tail without affecting the value 1.957 + * of those elements that remain. The new current position after decreasing the length of a sequence 1.958 + * is determined as follows: 1.959 + * <UL> 1.960 + * <LI>If the length of the sequence is set to zero, the current position is set to -1. 1.961 + * <LI>If the current position is -1 before decreasing the length, it remains at -1. 1.962 + * <LI>If the current position indicates a valid element and that element is not removed when the length 1.963 + * is decreased, the current position remains unaffected. 1.964 + * <LI>If the current position indicates a valid element and that element is removed, 1.965 + * the current position is set to -1. 1.966 + * </UL> 1.967 + * 1.968 + * @exception InvalidValue if this is a bounded sequence and len is larger than the bound 1.969 + */ 1.970 + void set_length(in unsigned long len) 1.971 + raises(InvalidValue); 1.972 + 1.973 + /** 1.974 + * Returns the elements of the sequence. 1.975 + */ 1.976 + AnySeq get_elements(); 1.977 + 1.978 + /** 1.979 + * Sets the elements of a sequence. 1.980 + * The length of the DynSequence is set to the length of value. The current position is set to zero 1.981 + * if value has non-zero length and to -1 if value is a zero-length sequence. 1.982 + * 1.983 + * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent 1.984 + * to the element TypeCode of the DynSequence 1.985 + * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence 1.986 + */ 1.987 + void set_elements(in AnySeq value) 1.988 + raises(TypeMismatch, InvalidValue); 1.989 + 1.990 + /** 1.991 + * Returns the DynAnys representing the elements of the sequence. 1.992 + */ 1.993 + DynAnySeq get_elements_as_dyn_any(); 1.994 + 1.995 + /** 1.996 + * Sets the elements of a sequence using DynAnys. 1.997 + * The length of the DynSequence is set to the length of value. The current position is set to zero 1.998 + * if value has non-zero length and to -1 if value is a zero-length sequence. 1.999 + * 1.1000 + * @exception TypeMismatch if value contains one or more elements whose TypeCode is not equivalent 1.1001 + * to the element TypeCode of the DynSequence 1.1002 + * @exception InvalidValue if the length of value exceeds the bound of a bounded sequence 1.1003 + */ 1.1004 + void set_elements_as_dyn_any(in DynAnySeq value) 1.1005 + raises(TypeMismatch, InvalidValue); 1.1006 + }; 1.1007 + 1.1008 + /** 1.1009 + * DynArray objects support the manipulation of IDL arrays. 1.1010 + * Note that the dimension of the array is contained in the TypeCode which is accessible 1.1011 + * through the type attribute. It can also be obtained by calling the component_count operation. 1.1012 + */ 1.1013 + interface DynArray : DynAny { 1.1014 + #pragma sun_localservant DynArray "" 1.1015 + 1.1016 + /** 1.1017 + * Returns the elements of the DynArray. 1.1018 + */ 1.1019 + AnySeq get_elements(); 1.1020 + 1.1021 + /** 1.1022 + * Sets the DynArray to contain the passed elements. 1.1023 + * 1.1024 + * @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode 1.1025 + * @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension 1.1026 + */ 1.1027 + void set_elements(in AnySeq value) 1.1028 + raises(TypeMismatch, InvalidValue); 1.1029 + 1.1030 + /** 1.1031 + * Returns the elements of the DynArray as DynAnys. 1.1032 + */ 1.1033 + DynAnySeq get_elements_as_dyn_any(); 1.1034 + 1.1035 + /** 1.1036 + * Sets the DynArray to contain the passed elements. 1.1037 + * 1.1038 + * @exception TypeMismatch if one or more elements have a type that is inconsistent with the DynArrays TypeCode 1.1039 + * @exception InvalidValue if the sequence does not contain the same number of elements as the array dimension 1.1040 + */ 1.1041 + void set_elements_as_dyn_any(in DynAnySeq value) 1.1042 + raises(TypeMismatch, InvalidValue); 1.1043 + }; 1.1044 + 1.1045 + /** 1.1046 + * DynValueCommon provides operations supported by both the DynValue and DynValueBox interfaces. 1.1047 + */ 1.1048 + interface DynValueCommon : DynAny { 1.1049 + /** 1.1050 + * Returns true if the DynValueCommon represents a null value type. 1.1051 + */ 1.1052 + boolean is_null(); 1.1053 + 1.1054 + /** 1.1055 + * Changes the representation of a DynValueCommon to a null value type. 1.1056 + */ 1.1057 + void set_to_null(); 1.1058 + 1.1059 + /** 1.1060 + * Replaces a null value type with a newly constructed value. Its components are initialized 1.1061 + * to default values as in DynAnyFactory.create_dyn_any_from_type_code. 1.1062 + * If the DynValueCommon represents a non-null value type, then this operation has no effect. 1.1063 + */ 1.1064 + void set_to_value(); 1.1065 + }; 1.1066 + 1.1067 + /** 1.1068 + * DynValue objects support the manipulation of IDL non-boxed value types. 1.1069 + * The DynValue interface can represent both null and non-null value types. 1.1070 + * For a DynValue representing a non-null value type, the DynValue's components comprise 1.1071 + * the public and private members of the value type, including those inherited from concrete base value types, 1.1072 + * in the order of definition. A DynValue representing a null value type has no components 1.1073 + * and a current position of -1. 1.1074 + * <P>Warning: Indiscriminantly changing the contents of private value type members can cause the value type 1.1075 + * implementation to break by violating internal constraints. Access to private members is provided to support 1.1076 + * such activities as ORB bridging and debugging and should not be used to arbitrarily violate 1.1077 + * the encapsulation of the value type. 1.1078 + */ 1.1079 + interface DynValue : DynValueCommon { 1.1080 + #pragma sun_localservant DynValue "" 1.1081 + 1.1082 + /** 1.1083 + * Returns the name of the member at the current position. 1.1084 + * This operation may return an empty string since the TypeCode of the value being 1.1085 + * manipulated may not contain the names of members. 1.1086 + * 1.1087 + * @exception TypeMismatch if the DynValue represents a null value type. 1.1088 + * @exception InvalidValue if the current position does not indicate a member 1.1089 + */ 1.1090 + FieldName current_member_name() 1.1091 + raises(TypeMismatch, InvalidValue); 1.1092 + 1.1093 + /** 1.1094 + * Returns the TCKind associated with the member at the current position. 1.1095 + * 1.1096 + * @exception TypeMismatch if the DynValue represents a null value type. 1.1097 + * @exception InvalidValue if the current position does not indicate a member 1.1098 + */ 1.1099 + CORBA::TCKind current_member_kind() 1.1100 + raises(TypeMismatch, InvalidValue); 1.1101 + 1.1102 + /** 1.1103 + * Returns a sequence of NameValuePairs describing the name and the value of each member 1.1104 + * in the value type. 1.1105 + * The sequence contains members in the same order as the declaration order of members 1.1106 + * as indicated by the DynValue's TypeCode. The current position is not affected. 1.1107 + * The member names in the returned sequence will be empty strings if the DynValue's TypeCode 1.1108 + * does not contain member names. 1.1109 + * 1.1110 + * @exception InvalidValue if this object represents a null value type 1.1111 + */ 1.1112 + NameValuePairSeq get_members() 1.1113 + raises(InvalidValue); 1.1114 + 1.1115 + /** 1.1116 + * Initializes the value type's members from a sequence of NameValuePairs. 1.1117 + * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, 1.1118 + * if an empty sequence is passed, the current position is set to -1. 1.1119 + * A null value type can be initialized to a non-null value type using this method. 1.1120 + * <P>Members must appear in the NameValuePairs in the order in which they appear in the IDL specification 1.1121 + * of the value type as indicated by the DynValue's TypeCode or they must be empty strings. 1.1122 + * The operation makes no attempt to assign member values based on member names. 1.1123 + * 1.1124 + * @exception TypeMismatch if the member names supplied in the passed sequence do not match the 1.1125 + * corresponding member name in the DynValue's TypeCode and they are not empty strings 1.1126 + * @exception InvalidValue if the passed sequence has a number of elements that disagrees 1.1127 + * with the number of members as indicated by the DynValue's TypeCode 1.1128 + */ 1.1129 + void set_members(in NameValuePairSeq value) 1.1130 + raises(TypeMismatch, InvalidValue); 1.1131 + 1.1132 + /** 1.1133 + * Returns a sequence of NameDynAnyPairs describing the name and the value of each member 1.1134 + * in the value type. 1.1135 + * The sequence contains members in the same order as the declaration order of members 1.1136 + * as indicated by the DynValue's TypeCode. The current position is not affected. 1.1137 + * The member names in the returned sequence will be empty strings if the DynValue's TypeCode 1.1138 + * does not contain member names. 1.1139 + * 1.1140 + * @exception InvalidValue if this object represents a null value type 1.1141 + */ 1.1142 + NameDynAnyPairSeq get_members_as_dyn_any() 1.1143 + raises(InvalidValue); 1.1144 + 1.1145 + /** 1.1146 + * Initializes the value type's members from a sequence of NameDynAnyPairs. 1.1147 + * The operation sets the current position to zero if the passed sequences has non-zero length. Otherwise, 1.1148 + * if an empty sequence is passed, the current position is set to -1. 1.1149 + * A null value type can be initialized to a non-null value type using this method. 1.1150 + * <P>Members must appear in the NameDynAnyPairs in the order in which they appear in the IDL specification 1.1151 + * of the value type as indicated by the DynValue's TypeCode or they must be empty strings. 1.1152 + * The operation makes no attempt to assign member values based on member names. 1.1153 + * 1.1154 + * @exception TypeMismatch if the member names supplied in the passed sequence do not match the 1.1155 + * corresponding member name in the DynValue's TypeCode and they are not empty strings 1.1156 + * @exception InvalidValue if the passed sequence has a number of elements that disagrees 1.1157 + * with the number of members as indicated by the DynValue's TypeCode 1.1158 + */ 1.1159 + void set_members_as_dyn_any(in NameDynAnyPairSeq value) 1.1160 + raises(TypeMismatch, InvalidValue); 1.1161 + }; 1.1162 + 1.1163 + /** 1.1164 + * DynValueBox objects support the manipulation of IDL boxed value types. 1.1165 + * The DynValueBox interface can represent both null and non-null value types. 1.1166 + * For a DynValueBox representing a non-null value type, the DynValueBox has a single component 1.1167 + * of the boxed type. A DynValueBox representing a null value type has no components 1.1168 + * and a current position of -1. 1.1169 + */ 1.1170 + interface DynValueBox : DynValueCommon { 1.1171 + 1.1172 + /** 1.1173 + * Returns the boxed value as an Any. 1.1174 + * 1.1175 + * @exception InvalidValue if this object represents a null value box type 1.1176 + */ 1.1177 + any get_boxed_value() 1.1178 + raises(InvalidValue); 1.1179 + 1.1180 + /** 1.1181 + * Replaces the boxed value with the specified value. 1.1182 + * If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. 1.1183 + * 1.1184 + * @exception TypeMismatch if this object represents a non-null value box type and the type 1.1185 + * of the parameter is not matching the current boxed value type. 1.1186 + */ 1.1187 + void set_boxed_value(in any boxed) 1.1188 + raises(TypeMismatch); 1.1189 + 1.1190 + /** 1.1191 + * Returns the boxed value as a DynAny. 1.1192 + * 1.1193 + * @exception InvalidValue if this object represents a null value box type 1.1194 + */ 1.1195 + DynAny get_boxed_value_as_dyn_any() 1.1196 + raises(InvalidValue); 1.1197 + 1.1198 + /** 1.1199 + * Replaces the boxed value with the value contained in the parameter. 1.1200 + * If the DynBoxedValue represents a null valuetype, it is converted to a non-null value. 1.1201 + * 1.1202 + * @exception TypeMismatch if this object represents a non-null value box type and the type 1.1203 + * of the parameter is not matching the current boxed value type. 1.1204 + */ 1.1205 + void set_boxed_value_as_dyn_any(in DynAny boxed) 1.1206 + raises(TypeMismatch); 1.1207 + }; 1.1208 + 1.1209 + /** 1.1210 + * DynAny objects can be created by invoking operations on the DynAnyFactory object. 1.1211 + * Generally there are only two ways to create a DynAny object: 1.1212 + * <UL> 1.1213 + * <LI>invoking an operation on an existing DynAny object 1.1214 + * <LI>invoking an operation on a DynAnyFactory object 1.1215 + * </UL> 1.1216 + * A constructed DynAny object supports operations that enable the creation of new DynAny 1.1217 + * objects encapsulating access to the value of some constituent. 1.1218 + * DynAny objects also support the copy operation for creating new DynAny objects. 1.1219 + * A reference to the DynAnyFactory object is obtained by calling ORB.resolve_initial_references() 1.1220 + * with the identifier parameter set to the string constant "DynAnyFactory". 1.1221 + * <P>Dynamic interpretation of an any usually involves creating a DynAny object using create_dyn_any() 1.1222 + * as the first step. Depending on the type of the any, the resulting DynAny object reference can be narrowed 1.1223 + * to a DynFixed, DynStruct, DynSequence, DynArray, DynUnion, DynEnum, or DynValue object reference. 1.1224 + * <P>Dynamic creation of an any involves creating a DynAny object using create_dyn_any_from_type_code(), 1.1225 + * passing the TypeCode associated with the value to be created. The returned reference is narrowed to one of 1.1226 + * the complex types, such as DynStruct, if appropriate. Then, the value can be initialized by means of 1.1227 + * invoking operations on the resulting object. Finally, the to_any operation can be invoked 1.1228 + * to create an any value from the constructed DynAny. 1.1229 + */ 1.1230 + interface DynAnyFactory { 1.1231 + #pragma sun_localservant DynAnyFactory "" 1.1232 + exception InconsistentTypeCode {}; 1.1233 + 1.1234 + /** 1.1235 + * Creates a new DynAny object from an any value. 1.1236 + * A copy of the TypeCode associated with the any value is assigned to the resulting DynAny object. 1.1237 + * The value associated with the DynAny object is a copy of the value in the original any. 1.1238 + * The current position of the created DynAny is set to zero if the passed value has components, 1.1239 + * to -1 otherwise 1.1240 + * 1.1241 + * @exception InconsistentTypeCode if value has a TypeCode with a TCKind of tk_Principal, 1.1242 + * tk_native, or tk_abstract_interface 1.1243 + */ 1.1244 + DynAny create_dyn_any(in any value) 1.1245 + raises(InconsistentTypeCode); 1.1246 + 1.1247 + /** 1.1248 + * Creates a DynAny from a TypeCode. Depending on the TypeCode, the created object may be of type DynAny, 1.1249 + * or one of its derived types, such as DynStruct. The returned reference can be narrowed to the derived type. 1.1250 + * In all cases, a DynAny constructed from a TypeCode has an initial default value. 1.1251 + * The default values of basic types are: 1.1252 + * <UL> 1.1253 + * <LI>false for boolean 1.1254 + * <LI>zero for numeric types 1.1255 + * <LI>zero for types octet, char, and wchar 1.1256 + * <LI>the empty string for string and wstring 1.1257 + * <LI>null for object references 1.1258 + * <LI>a type code with a TCKind value of tk_null for type codes 1.1259 + * <LI>for any values, an any containing a type code with a TCKind value of tk_null type and no value 1.1260 + * </UL> 1.1261 + * For complex types, creation of the corresponding DynAny assigns a default value as follows: 1.1262 + * <UL> 1.1263 + * <LI>For DynSequence it sets the current position to -1 and creates an empty sequence. 1.1264 + * <LI>For DynEnum it sets the current position to -1 and sets the value of the enumerator 1.1265 + * to the first enumerator value indicated by the TypeCode. 1.1266 + * <LI>For DynFixed it sets the current position to -1 and sets the value zero. 1.1267 + * <LI>For DynStruct it sets the current position to -1 for empty exceptions 1.1268 + * and to zero for all other TypeCodes. The members (if any) are (recursively) initialized 1.1269 + * to their default values. 1.1270 + * <LI>For DynArray sets the current position to zero and (recursively) initializes elements 1.1271 + * to their default value. 1.1272 + * <LI>For DynUnion sets the current position to zero. The discriminator value is set 1.1273 + * to a value consistent with the first named member of the union. That member is activated and (recursively) 1.1274 + * initialized to its default value. 1.1275 + * <LI>For DynValue and DynValueBox it initializes to a null value. 1.1276 + * </UL> 1.1277 + */ 1.1278 + DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) 1.1279 + raises(InconsistentTypeCode); 1.1280 + }; 1.1281 +}; // module DynamicAny 1.1282 + 1.1283 +#endif // _DYNAMIC_ANY_IDL_