BoundsHelper.java revision 689:c580f8cf1bc8
1238106Sdes/*
2238106Sdes * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3238106Sdes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4238106Sdes *
5238106Sdes * This code is free software; you can redistribute it and/or modify it
6238106Sdes * under the terms of the GNU General Public License version 2 only, as
7238106Sdes * published by the Free Software Foundation.  Oracle designates this
8238106Sdes * particular file as subject to the "Classpath" exception as provided
9238106Sdes * by Oracle in the LICENSE file that accompanied this code.
10238106Sdes *
11238106Sdes * This code is distributed in the hope that it will be useful, but WITHOUT
12238106Sdes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13238106Sdes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14238106Sdes * version 2 for more details (a copy is included in the LICENSE file that
15238106Sdes * accompanied this code).
16238106Sdes *
17238106Sdes * You should have received a copy of the GNU General Public License version
18238106Sdes * 2 along with this work; if not, write to the Free Software Foundation,
19238106Sdes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20238106Sdes *
21238106Sdes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22238106Sdes * or visit www.oracle.com if you need additional information or have any
23238106Sdes * questions.
24266114Sdes */
25266114Sdes
26266114Sdespackage org.omg.CORBA.TypeCodePackage;
27266114Sdes
28266114Sdes
29266114Sdes/**
30266114Sdes * This Helper class is used to facilitate the marshalling of
31266114Sdes * {@code TypeCodePackage/Bounds}.
32266114Sdes * For more information on Helper files, see
33266114Sdes * <a href="doc-files/generatedfiles.html#helper">
34238106Sdes * "Generated Files: Helper Files"</a>.
35238106Sdes */
36238106Sdes
37238106Sdesabstract public class BoundsHelper
38238106Sdes{
39238106Sdes  private static String  _id = "IDL:omg.org.CORBA/TypeCode/Bounds:1.0";
40238106Sdes
41292206Sdes  public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.TypeCodePackage.Bounds that)
42238106Sdes  {
43238106Sdes    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
44238106Sdes    a.type (type ());
45238106Sdes    write (out, that);
46238106Sdes    a.read_value (out.create_input_stream (), type ());
47249141Sdes  }
48249141Sdes
49249141Sdes  public static org.omg.CORBA.TypeCodePackage.Bounds extract (org.omg.CORBA.Any a)
50238106Sdes  {
51238106Sdes    return read (a.create_input_stream ());
52238106Sdes  }
53238106Sdes
54238106Sdes  private static org.omg.CORBA.TypeCode __typeCode = null;
55238106Sdes  private static boolean __active = false;
56238106Sdes  synchronized public static org.omg.CORBA.TypeCode type ()
57238106Sdes  {
58238106Sdes    if (__typeCode == null)
59238106Sdes    {
60238106Sdes      synchronized (org.omg.CORBA.TypeCode.class)
61238106Sdes      {
62287917Sdes        if (__typeCode == null)
63287917Sdes        {
64238106Sdes          if (__active)
65238106Sdes          {
66238106Sdes            return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
67238106Sdes          }
68238106Sdes          __active = true;
69238106Sdes          org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
70238106Sdes          org.omg.CORBA.TypeCode _tcOf_members0 = null;
71238106Sdes          __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.TypeCodePackage.BoundsHelper.id (), "Bounds", _members0);
72238106Sdes          __active = false;
73238106Sdes        }
74238106Sdes      }
75238106Sdes    }
76238106Sdes    return __typeCode;
77238106Sdes  }
78238106Sdes
79238106Sdes  public static String id ()
80238106Sdes  {
81238106Sdes    return _id;
82238106Sdes  }
83238106Sdes
84238106Sdes  public static org.omg.CORBA.TypeCodePackage.Bounds read (org.omg.CORBA.portable.InputStream istream)
85238106Sdes  {
86238106Sdes    org.omg.CORBA.TypeCodePackage.Bounds value = new org.omg.CORBA.TypeCodePackage.Bounds ();
87238106Sdes    // read and discard the repository ID
88238106Sdes    istream.read_string ();
89238106Sdes    return value;
90238106Sdes  }
91238106Sdes
92238106Sdes  public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.TypeCodePackage.Bounds value)
93238106Sdes  {
94238106Sdes    // write the repository ID
95238106Sdes    ostream.write_string (id ());
96238106Sdes  }
97238106Sdes
98238106Sdes}
99238106Sdes