1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class PrimitiveDef_impl 42 extends IRObject_impl 43 implements PrimitiveDefOperations 44 { 45 51 52 protected TypeCode tc_; 53 54 55 protected PrimitiveKind primitive_kind_; 56 57 63 64 public 65 PrimitiveDef_impl(IFR ifr, 66 PrimitiveKind pk) 67 { 68 super(ifr); 70 71 setServant(new PrimitiveDefPOATie(this)); 73 74 ORB tcf = ifr.getTCF(); 76 77 switch(pk.value()) 81 { 82 case PrimitiveKind._pk_null: 83 tc_ = tcf.get_primitive_tc(TCKind.tk_null); 84 break; 85 86 case PrimitiveKind._pk_void: 87 tc_ = tcf.get_primitive_tc(TCKind.tk_void); 88 break; 89 90 case PrimitiveKind._pk_short: 91 tc_ = tcf.get_primitive_tc(TCKind.tk_short); 92 break; 93 94 case PrimitiveKind._pk_long: 95 tc_ = tcf.get_primitive_tc(TCKind.tk_long); 96 break; 97 98 case PrimitiveKind._pk_ushort: 99 tc_ = tcf.get_primitive_tc(TCKind.tk_ushort); 100 break; 101 102 case PrimitiveKind._pk_ulong: 103 tc_ = tcf.get_primitive_tc(TCKind.tk_ulong); 104 break; 105 106 case PrimitiveKind._pk_float: 107 tc_ = tcf.get_primitive_tc(TCKind.tk_float); 108 break; 109 110 case PrimitiveKind._pk_double: 111 tc_ = tcf.get_primitive_tc(TCKind.tk_double); 112 break; 113 114 case PrimitiveKind._pk_boolean: 115 tc_ = tcf.get_primitive_tc(TCKind.tk_boolean); 116 break; 117 118 case PrimitiveKind._pk_char: 119 tc_ = tcf.get_primitive_tc(TCKind.tk_char); 120 break; 121 122 case PrimitiveKind._pk_octet: 123 tc_ = tcf.get_primitive_tc(TCKind.tk_octet); 124 break; 125 126 case PrimitiveKind._pk_any: 127 tc_ = tcf.get_primitive_tc(TCKind.tk_any); 128 break; 129 130 case PrimitiveKind._pk_TypeCode: 131 tc_ = tcf.get_primitive_tc(TCKind.tk_TypeCode); 132 break; 133 134 case PrimitiveKind._pk_Principal: 135 tc_ = tcf.get_primitive_tc(TCKind.tk_Principal); 136 break; 137 138 case PrimitiveKind._pk_string: 139 tc_ = tcf.create_string_tc(0); 140 break; 141 142 case PrimitiveKind._pk_objref: 143 tc_ = tcf.create_interface_tc("IDL:omg.org/CORBA/Object:1.0", 144 "Object"); 145 break; 146 147 case PrimitiveKind._pk_longlong: 148 tc_ = tcf.get_primitive_tc(TCKind.tk_longlong); 149 break; 150 151 case PrimitiveKind._pk_ulonglong: 152 tc_ = tcf.get_primitive_tc(TCKind.tk_ulonglong); 153 break; 154 155 case PrimitiveKind._pk_longdouble: 156 tc_ = tcf.get_primitive_tc(TCKind.tk_longdouble); 157 break; 158 159 case PrimitiveKind._pk_wchar: 160 tc_ = tcf.get_primitive_tc(TCKind.tk_wchar); 161 break; 162 163 case PrimitiveKind._pk_wstring: 164 tc_ = tcf.create_wstring_tc(0); 165 break; 166 167 case PrimitiveKind._pk_value_base: 168 tc_ = org.objectweb.openccm.corba.TheORB.create_valuebase_tc(); 169 break; 170 } 171 172 primitive_kind_ = pk; 174 } 175 176 182 186 protected TypeCode 187 recursiveType(java.util.List idSeq) 188 { 189 return type(); 190 } 191 192 198 201 public PrimitiveDef 202 asPrimitiveDef() 203 { 204 return PrimitiveDefHelper.narrow(asObject()); 205 } 206 207 213 216 public DefinitionKind 217 def_kind() 218 { 219 return DefinitionKind.dk_Primitive; 220 } 221 222 225 public void 226 destroy() 227 { 228 throw exceptionCanNotBeDestroyed(); 230 } 231 232 238 241 public TypeCode 242 type() 243 { 244 return tc_; 245 } 246 247 253 256 public PrimitiveKind 257 kind() 258 { 259 return primitive_kind_; 260 } 261 } 262 | Popular Tags |