URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [org/] [omg/] [DynamicAny/] [package.html] - Rev 775
Compare with Previous | Blame | View Log
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- package.html - Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. --> <html> <head><title>GNU Classpath - org.omg.DynamicAny</title></head> <body> <p>DynAny's allow to work with data structures, exact content of those is not known at the time of compilation. In this way, the conception of DynAny remebers the java reflection mechanism. DynAny usually obtain the value from the {@link org.omg.CORBA.Any} that, if needed, can carry highly nested data structures (like array of sequences of unions). DynAny's allow to see/modify all parts of such structures. This is especially helpful for writing generic servers (bridges, event channels supporting, filtering and so on). Similarly, DynAny's can create an Any at runtime, without having static knowledge of its type. This is helpful for writing generic clients like browsers, debuggers or user interface tools. </p><p> The API clearly states that DynAny and DynAnyFactory objects are local and cannot be transferred to remote server or client. While such methods are formally defined in the corresponding helpers, they simply always throw MARSHAL. </p><p> DynAny's are created by {@link DynAnyFactory}. The factory is obtaines by {@link org.omg.CORBA.ORB#resolve_initial_references): <code> ORB orb = ORB.init(new String[0], null); DynAnyFactory f = DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory")); </code> DynAny's are also returned by some methods, invoked on another DynAny. </p><p> The primitive types like string or char are wrapped into an ordinary DynAny. It has multiple methods for setting/getting the content like {@link DynAnyOperations#get_string()} or {@link DynAnyOperations#insert_string(String)}. The more complex types like sequences or structures are wrapped into specialised DynAny's, providing means to access the enclosed members. In this case, the DynAny has the "internal cursor", normally pointing at one of the members in the data structure. The "internal cursor" can be set to the needed position {@link DynAnyOperations#seek(int)} or advanced forward ({@link DynAnyOperations#next()}. The member under cursor is returned by {@link DynAnyOperations#current_component()}. For composite DynAnys the methods like {@link DynAnyOperations#get_string()} or {@link DynAnyOperations#insert_string(String)} apply to the selected member, not to the complex DynAny in general. </p><p> DynAnys are created and optimized for traversing values extracted from anys or constructing values of anys at runtime. OMG does not recommend to use them for other purposes. </p><p> @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) </body> </html>