tests/libjava-mauve/src/gnu/testlet/org/omg/CORBA/ORB/RF11/G_structHelper.java
branchjk_new_structure
changeset 1541 75c2e24dea9a
parent 1540 92ac284961c1
child 1542 be11db817bcf
equal deleted inserted replaced
1540:92ac284961c1 1541:75c2e24dea9a
     1 // Tags: not-a-test
       
     2 // Copyright (c) 2000, 2001 NEC Corporation.
       
     3 
       
     4 // Adapted for Mauve by Audrius Meskauskas <audriusa@bluewin.ch>
       
     5 
       
     6 // This file is part of Mauve.
       
     7 
       
     8 // Mauve is free software; you can redistribute it and/or modify
       
     9 // it under the terms of the GNU General Public License as published by
       
    10 // the Free Software Foundation; either version 2, or (at your option)
       
    11 // any later version.
       
    12 
       
    13 // Mauve is distributed in the hope that it will be useful,
       
    14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    16 // GNU General Public License for more details.
       
    17 
       
    18 // You should have received a copy of the GNU General Public License
       
    19 // along with Mauve; see the file COPYING.  If not, write to
       
    20 // the Free Software Foundation, 59 Temple Place - Suite 330,
       
    21 // Boston, MA 02111-1307, USA.
       
    22 
       
    23 /*
       
    24 This code originally came from the OMG's CORBA Open Source Testing project,
       
    25 which lived at cost.omg.org. That site no longer exists.
       
    26 
       
    27 All the contributing companies agreed to release their tests under the
       
    28 terms of the GNU Lesser General Public License, available in the file
       
    29 COPYING.LIB.
       
    30 
       
    31 The code has been modified integrating into Mauve test environment and
       
    32 removing tests that are not yet supported by Suns jre 1.4. Hence the license
       
    33 is now GPL.
       
    34 
       
    35 We downloaded the code from http://sourceforge.net/projects/corba-cost/,
       
    36 administrated by Duncan Grisby.
       
    37 */
       
    38 
       
    39 // G
       
    40 package gnu.testlet.org.omg.CORBA.ORB.RF11;
       
    41 
       
    42 public abstract class G_structHelper
       
    43 {
       
    44   private static String _id = "IDL:gnu/testlet/org/omg/CORBA/ORB/RF11/G_struct:1.0";
       
    45 
       
    46   public static void insert(org.omg.CORBA.Any a, G_struct that)
       
    47   {
       
    48     org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
       
    49     a.type(type());
       
    50     write(out, that);
       
    51     a.read_value(out.create_input_stream(), type());
       
    52   }
       
    53 
       
    54   public static G_struct extract(org.omg.CORBA.Any a)
       
    55   {
       
    56     return read(a.create_input_stream());
       
    57   }
       
    58 
       
    59   private static org.omg.CORBA.TypeCode __typeCode = null;
       
    60   private static boolean __active = false;
       
    61 
       
    62   public static synchronized org.omg.CORBA.TypeCode type()
       
    63   {
       
    64     if (__typeCode == null)
       
    65       {
       
    66         synchronized (org.omg.CORBA.TypeCode.class)
       
    67           {
       
    68             if (__typeCode == null)
       
    69               {
       
    70                 if (__active)
       
    71                   {
       
    72                     return org.omg.CORBA.ORB.init().create_recursive_tc(_id);
       
    73                   }
       
    74                 __active = true;
       
    75 
       
    76                 org.omg.CORBA.StructMember[] _members0 =
       
    77                   new org.omg.CORBA.StructMember[ 4 ];
       
    78                 org.omg.CORBA.TypeCode _tcOf_members0 = null;
       
    79                 _tcOf_members0 = E_structHelper.type();
       
    80                 _members0 [ 0 ] =
       
    81                   new org.omg.CORBA.StructMember("e_e_struct", _tcOf_members0,
       
    82                                                  null
       
    83                                                 );
       
    84                 _tcOf_members0 = E_unionHelper.type();
       
    85                 _members0 [ 1 ] =
       
    86                   new org.omg.CORBA.StructMember("e_e_union", _tcOf_members0,
       
    87                                                  null
       
    88                                                 );
       
    89                 _tcOf_members0 = BHelper.type();
       
    90                 _tcOf_members0 =
       
    91                   org.omg.CORBA.ORB.init().create_sequence_tc(0, _tcOf_members0);
       
    92                 _tcOf_members0 =
       
    93                   org.omg.CORBA.ORB.init().create_alias_tc(E_sequenceHelper.id(),
       
    94                                                            "E_sequence",
       
    95                                                            _tcOf_members0
       
    96                                                           );
       
    97                 _members0 [ 2 ] =
       
    98                   new org.omg.CORBA.StructMember("e_e_sequence",
       
    99                                                  _tcOf_members0, null
       
   100                                                 );
       
   101                 _tcOf_members0 = BHelper.type();
       
   102                 _tcOf_members0 =
       
   103                   org.omg.CORBA.ORB.init().create_array_tc(2, _tcOf_members0);
       
   104                 _tcOf_members0 =
       
   105                   org.omg.CORBA.ORB.init().create_alias_tc(E_arrayHelper.id(),
       
   106                                                            "E_array",
       
   107                                                            _tcOf_members0
       
   108                                                           );
       
   109                 _members0 [ 3 ] =
       
   110                   new org.omg.CORBA.StructMember("e_e_array", _tcOf_members0,
       
   111                                                  null
       
   112                                                 );
       
   113                 __typeCode =
       
   114                   org.omg.CORBA.ORB.init().create_struct_tc(G_structHelper.id(),
       
   115                                                             "G_struct",
       
   116                                                             _members0
       
   117                                                            );
       
   118                 __active = false;
       
   119               }
       
   120           }
       
   121       }
       
   122     return __typeCode;
       
   123   }
       
   124 
       
   125   public static String id()
       
   126   {
       
   127     return _id;
       
   128   }
       
   129 
       
   130   public static G_struct read(org.omg.CORBA.portable.InputStream istream)
       
   131   {
       
   132     G_struct value = new G_struct();
       
   133     value.e_e_struct = E_structHelper.read(istream);
       
   134     value.e_e_union = E_unionHelper.read(istream);
       
   135     value.e_e_sequence = E_sequenceHelper.read(istream);
       
   136     value.e_e_array = E_arrayHelper.read(istream);
       
   137     return value;
       
   138   }
       
   139 
       
   140   public static void write(org.omg.CORBA.portable.OutputStream ostream,
       
   141                            G_struct value
       
   142                           )
       
   143   {
       
   144     E_structHelper.write(ostream, value.e_e_struct);
       
   145     E_unionHelper.write(ostream, value.e_e_union);
       
   146     E_sequenceHelper.write(ostream, value.e_e_sequence);
       
   147     E_arrayHelper.write(ostream, value.e_e_array);
       
   148   }
       
   149 }