1 package org.omg.DynamicAny; 2 3 4 10 11 12 79 abstract public class DynAnyHelper 80 { 81 private static String _id = "IDL:omg.org/DynamicAny/DynAny:1.0"; 82 83 public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynAny that) 84 { 85 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 86 a.type (type ()); 87 write (out, that); 88 a.read_value (out.create_input_stream (), type ()); 89 } 90 91 public static org.omg.DynamicAny.DynAny extract (org.omg.CORBA.Any a) 92 { 93 return read (a.create_input_stream ()); 94 } 95 96 private static org.omg.CORBA.TypeCode __typeCode = null; 97 synchronized public static org.omg.CORBA.TypeCode type () 98 { 99 if (__typeCode == null) 100 { 101 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynAnyHelper.id (), "DynAny"); 102 } 103 return __typeCode; 104 } 105 106 public static String id () 107 { 108 return _id; 109 } 110 111 public static org.omg.DynamicAny.DynAny read (org.omg.CORBA.portable.InputStream istream) 112 { 113 throw new org.omg.CORBA.MARSHAL (); 114 } 115 116 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynAny value) 117 { 118 throw new org.omg.CORBA.MARSHAL (); 119 } 120 121 public static org.omg.DynamicAny.DynAny narrow (org.omg.CORBA.Object obj) 122 { 123 if (obj == null) 124 return null; 125 else if (obj instanceof org.omg.DynamicAny.DynAny ) 126 return (org.omg.DynamicAny.DynAny )obj; 127 else if (!obj._is_a (id ())) 128 throw new org.omg.CORBA.BAD_PARAM (); 129 else 130 { 131 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 132 org.omg.DynamicAny._DynAnyStub stub = new org.omg.DynamicAny._DynAnyStub (); 133 stub._set_delegate(delegate); 134 return stub; 135 } 136 } 137 138 public static org.omg.DynamicAny.DynAny unchecked_narrow (org.omg.CORBA.Object obj) 139 { 140 if (obj == null) 141 return null; 142 else if (obj instanceof org.omg.DynamicAny.DynAny ) 143 return (org.omg.DynamicAny.DynAny )obj; 144 else 145 { 146 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 147 org.omg.DynamicAny._DynAnyStub stub = new org.omg.DynamicAny._DynAnyStub (); 148 stub._set_delegate(delegate); 149 return stub; 150 } 151 } 152 153 } 154 | Popular Tags |