StructMemberHelper.java revision 704:3ef63dbde965
1135042Srwatson/*
2135042Srwatson * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
3135042Srwatson * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4135042Srwatson *
5135042Srwatson * This code is free software; you can redistribute it and/or modify it
6135042Srwatson * under the terms of the GNU General Public License version 2 only, as
7135042Srwatson * published by the Free Software Foundation.  Oracle designates this
8135042Srwatson * particular file as subject to the "Classpath" exception as provided
9135042Srwatson * by Oracle in the LICENSE file that accompanied this code.
10135042Srwatson *
11135042Srwatson * This code is distributed in the hope that it will be useful, but WITHOUT
12135042Srwatson * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13135042Srwatson * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14135042Srwatson * version 2 for more details (a copy is included in the LICENSE file that
15135042Srwatson * accompanied this code).
16135042Srwatson *
17135042Srwatson * You should have received a copy of the GNU General Public License version
18135042Srwatson * 2 along with this work; if not, write to the Free Software Foundation,
19135042Srwatson * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20135042Srwatson *
21135042Srwatson * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22135042Srwatson * or visit www.oracle.com if you need additional information or have any
23135042Srwatson * questions.
24135042Srwatson */
25135042Srwatsonpackage org.omg.CORBA;
26135042Srwatson
27135042Srwatson
28135042Srwatson/**
29225334Smarius* The Helper for {@code StructMember}. For more information on
30135042Srwatson* Helper files, see <a href="doc-files/generatedfiles.html#helper">
31135042Srwatson* "Generated Files: Helper Files"</a>.<P>
32227345Scognet* org/omg/CORBA/StructMemberHelper.java
33135042Srwatson* Generated by the IDL-to-Java compiler (portable), version "3.0"
34135042Srwatson* from ir.idl
35135042Srwatson* 03 June 1999 11:33:43 o'clock GMT+00:00
36135042Srwatson*/
37135042Srwatson
38135042Srwatsonabstract public class StructMemberHelper
39135042Srwatson{
40145367Smux  private static String  _id = "IDL:omg.org/CORBA/StructMember:1.0";
41135042Srwatson
42135042Srwatson  public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.StructMember that)
43135042Srwatson  {
44227345Scognet    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
45227345Scognet    a.type (type ());
46198136Sluigi    write (out, that);
47198136Sluigi    a.read_value (out.create_input_stream (), type ());
48198136Sluigi  }
49227345Scognet
50198136Sluigi  public static org.omg.CORBA.StructMember extract (org.omg.CORBA.Any a)
51198136Sluigi  {
52198136Sluigi    return read (a.create_input_stream ());
53198136Sluigi  }
54227345Scognet
55198136Sluigi  private static org.omg.CORBA.TypeCode __typeCode = null;
56198136Sluigi  private static boolean __active = false;
57198136Sluigi  synchronized public static org.omg.CORBA.TypeCode type ()
58198136Sluigi  {
59135042Srwatson    if (__typeCode == null)
60135042Srwatson    {
61135042Srwatson      synchronized (org.omg.CORBA.TypeCode.class)
62135042Srwatson      {
63135042Srwatson        if (__typeCode == null)
64198136Sluigi        {
65135042Srwatson          if (__active)
66135042Srwatson          {
67135042Srwatson            return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
68135485Srwatson          }
69135485Srwatson          __active = true;
70135042Srwatson          org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [3];
71135042Srwatson          org.omg.CORBA.TypeCode _tcOf_members0 = null;
72135042Srwatson          _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
73135042Srwatson          _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0);
74135042Srwatson          _members0[0] = new org.omg.CORBA.StructMember (
75135042Srwatson            "name",
76135042Srwatson            _tcOf_members0,
77135042Srwatson            null);
78135042Srwatson          _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode);
79135042Srwatson          _members0[1] = new org.omg.CORBA.StructMember (
80135042Srwatson            "type",
81135042Srwatson            _tcOf_members0,
82135551Srwatson            null);
83135551Srwatson          _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type ();
84135551Srwatson          _members0[2] = new org.omg.CORBA.StructMember (
85135551Srwatson            "type_def",
86135551Srwatson            _tcOf_members0,
87135551Srwatson            null);
88135551Srwatson          __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.StructMemberHelper.id (), "StructMember", _members0);
89135551Srwatson          __active = false;
90135551Srwatson        }
91135551Srwatson      }
92135551Srwatson    }
93135551Srwatson    return __typeCode;
94135551Srwatson  }
95135042Srwatson
96135042Srwatson  public static String id ()
97135042Srwatson  {
98135551Srwatson    return _id;
99135551Srwatson  }
100135042Srwatson
101139121Skeramida  public static org.omg.CORBA.StructMember read (org.omg.CORBA.portable.InputStream istream)
102135551Srwatson  {
103135042Srwatson    org.omg.CORBA.StructMember value = new org.omg.CORBA.StructMember ();
104135042Srwatson    value.name = istream.read_string ();
105135042Srwatson    value.type = istream.read_TypeCode ();
106135042Srwatson    value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream);
107135042Srwatson    return value;
108135042Srwatson  }
109135551Srwatson
110135551Srwatson  public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.StructMember value)
111135551Srwatson  {
112135551Srwatson    ostream.write_string (value.name);
113135551Srwatson    ostream.write_TypeCode (value.type);
114135551Srwatson    org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def);
115135551Srwatson  }
116135551Srwatson
117135551Srwatson}
118135551Srwatson