1 package org.omg.DynamicAny; 2 3 4 10 11 12 24 abstract public class DynValueHelper 25 { 26 private static String _id = "IDL:omg.org/DynamicAny/DynValue:1.0"; 27 28 public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynValue that) 29 { 30 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 31 a.type (type ()); 32 write (out, that); 33 a.read_value (out.create_input_stream (), type ()); 34 } 35 36 public static org.omg.DynamicAny.DynValue extract (org.omg.CORBA.Any a) 37 { 38 return read (a.create_input_stream ()); 39 } 40 41 private static org.omg.CORBA.TypeCode __typeCode = null; 42 synchronized public static org.omg.CORBA.TypeCode type () 43 { 44 if (__typeCode == null) 45 { 46 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynValueHelper.id (), "DynValue"); 47 } 48 return __typeCode; 49 } 50 51 public static String id () 52 { 53 return _id; 54 } 55 56 public static org.omg.DynamicAny.DynValue read (org.omg.CORBA.portable.InputStream istream) 57 { 58 throw new org.omg.CORBA.MARSHAL (); 59 } 60 61 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynValue value) 62 { 63 throw new org.omg.CORBA.MARSHAL (); 64 } 65 66 public static org.omg.DynamicAny.DynValue narrow (org.omg.CORBA.Object obj) 67 { 68 if (obj == null) 69 return null; 70 else if (obj instanceof org.omg.DynamicAny.DynValue ) 71 return (org.omg.DynamicAny.DynValue )obj; 72 else if (!obj._is_a (id ())) 73 throw new org.omg.CORBA.BAD_PARAM (); 74 else 75 { 76 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 77 org.omg.DynamicAny._DynValueStub stub = new org.omg.DynamicAny._DynValueStub (); 78 stub._set_delegate(delegate); 79 return stub; 80 } 81 } 82 83 public static org.omg.DynamicAny.DynValue unchecked_narrow (org.omg.CORBA.Object obj) 84 { 85 if (obj == null) 86 return null; 87 else if (obj instanceof org.omg.DynamicAny.DynValue ) 88 return (org.omg.DynamicAny.DynValue )obj; 89 else 90 { 91 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 92 org.omg.DynamicAny._DynValueStub stub = new org.omg.DynamicAny._DynValueStub (); 93 stub._set_delegate(delegate); 94 return stub; 95 } 96 } 97 98 } 99 | Popular Tags |