IDL Complex Type | |
abstract valuetype |
The CORBA abstact valuetype (TBD) ...... It maps to J#'s class type. |
// CORBA IDL |
module demo { moudle obv { abstract valuetype aValueBase { readonly attribute long number; void print_base(); }; }; }; |
e.g. aValueBase aValueBaseHelper aValueBaseHolder |
// J# package demo.obv.abstract_valuetype; /** * Value Type definition : aValueBase * * @author TomORB J# Native Compiler */ public interface aValueBase extends org.omg.CORBA.portable.ValueBase { /** * Read accessor for number attribute * @return the attribute value */ public abstract int number(); /** * Operation print_base */ public abstract void print_base(); } package demo.obv.abstract_valuetype; /** * Helper class for : aValueBase * * @author TomORB J# Native Compiler */ public class aValueBaseHelper { /** * Insert aValueBase into an any * @param a an any * @param t aValueBase value */ public static void insert(org.omg.CORBA.Any a, demo.obv.abstract_valuetype.aValueBase t) { a.insert_Value(t, type()); } /** * Extract aValueBase from an any * @param a an any * @return the extracted aValueBase value */ public static demo.obv.abstract_valuetype.aValueBase extract(org.omg.CORBA.Any a) { if (!a.type().equal(type())) throw new org.omg.CORBA.MARSHAL(); try { return (demo.obv.abstract_valuetype.aValueBase)a.extract_Value(); } catch(final java.lang.ClassCastException e) { throw new org.omg.CORBA.MARSHAL(e.getMessage()); } } // // Internal TypeCode value // private static org.omg.CORBA.TypeCode _tc = null; private static boolean _working = false; /** * Return the aValueBase TypeCode * @return a TypeCode */ public static org.omg.CORBA.TypeCode type() { if (_tc == null) { synchronized(org.omg.CORBA.TypeCode.class) { if (_tc != null) return _tc; if (_working) return org.omg.CORBA.ORB.init().create_recursive_tc(id()); _working = true; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.ValueMember []_members = new org.omg.CORBA.ValueMember[0]; org.omg.CORBA.TypeCode _concrete_tc = orb.get_primitive_tc( org.omg.CORBA.TCKind.tk_null); _tc = orb.create_value_tc(id(),"aValueBase", org.omg.CORBA.VM_ABSTRACT.value,_concrete_tc,_members); _working = false; } } return _tc; } /** * Return the aValueBase IDL ID * @return an ID */ public static java.lang.String id() { return _id; } private final static java.lang.String _id = "IDL:demo/obv/abstract_valuetype/aValueBase:1.0"; /** * Read aValueBase from a marshalled stream * @param istream the input stream * @return the readed aValueBase value */ public static demo.obv.abstract_valuetype.aValueBase read( org.omg.CORBA.portable.InputStream istream) { return (demo.obv.abstract_valuetype.aValueBase) ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value(_id.toString()); } /** * Write aValueBase into a marshalled stream * @param ostream the output stream * @param value aValueBase value */ public static void write(org.omg.CORBA.portable.OutputStream ostream, demo.obv.abstract_valuetype.aValueBase value) { ((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value(value, _id); } } package demo.obv.abstract_valuetype; /** * Holder class for : aValueBase * * @author TomORB J# Native Compiler */ final public class aValueBaseHolder implements org.omg.CORBA.portable.Streamable { /** * Internal aValueBase value */ public demo.obv.abstract_valuetype.aValueBase value; /** * Default constructor */ public aValueBaseHolder() { } /** * Constructor with value initialisation * @param initial the initial value */ public aValueBaseHolder(demo.obv.abstract_valuetype.aValueBase initial) { value = initial; } /** * Read aValueBase from a marshalled stream * @param istream the input stream */ public void _read(org.omg.CORBA.portable.InputStream istream) { value = aValueBaseHelper.read(istream); } /** * Write aValueBase into a marshalled stream * @param ostream the output stream */ public void _write(org.omg.CORBA.portable.OutputStream ostream) { aValueBaseHelper.write(ostream,value); } /** * Return the aValueBase TypeCode * @return a TypeCode */ public org.omg.CORBA.TypeCode _type() { return aValueBaseHelper.type(); } } |