Java Code Examples for org.omg.CORBA.StructMember

The following are top voted examples for showing how to use org.omg.CORBA.StructMember. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 2
Project: openjdk-jdk10   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 3
Project: openjdk9   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 4
Project: lookaside_java-1.8.0-openjdk   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 5
Project: jdk8u_corba   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 6
Project: javify   File: StructureToReturnHelper.java   View source code 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 7
Project: javify   File: TaggedComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 8
Project: javify   File: ServiceContextHelper.java   View source code 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 9
Project: javify   File: TaggedProfileHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 10
Project: javify   File: NameValuePairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 11
Project: javify   File: NameDynAnyPairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 12
Project: javify   File: InvalidPolicyHelper.java   View source code 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 13
Project: javify   File: NameComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;

  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 14
Project: javify   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 15
Project: javify   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 16
Project: jvm-stm   File: StructureToReturnHelper.java   View source code 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 17
Project: jvm-stm   File: TaggedComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];
  
  TypeCode field;
  
  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);
  
  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 18
Project: jvm-stm   File: ServiceContextHelper.java   View source code 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 19
Project: jvm-stm   File: TaggedProfileHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 20
Project: jvm-stm   File: NameValuePairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 21
Project: jvm-stm   File: NameDynAnyPairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 22
Project: jvm-stm   File: InvalidPolicyHelper.java   View source code 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 23
Project: jvm-stm   File: NameComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  
  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 24
Project: jvm-stm   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 25
Project: jvm-stm   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 26
Project: infobip-open-jdk-8   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 27
Project: openjdk-source-code-learn   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 28
Project: OLD-OpenJDK8   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 29
Project: JamVM-PH   File: StructureToReturnHelper.java   View source code 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 30
Project: JamVM-PH   File: TaggedComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];
  
  TypeCode field;
  
  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);
  
  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 31
Project: JamVM-PH   File: ServiceContextHelper.java   View source code 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 32
Project: JamVM-PH   File: TaggedProfileHelper.java   View source code 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 33
Project: JamVM-PH   File: NameValuePairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 34
Project: JamVM-PH   File: NameDynAnyPairHelper.java   View source code 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 35
Project: JamVM-PH   File: InvalidPolicyHelper.java   View source code 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 36
Project: JamVM-PH   File: NameComponentHelper.java   View source code 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  
  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 37
Project: JamVM-PH   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 38
Project: JamVM-PH   File: OrbRestricted.java   View source code 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 39
Project: openjdk-orb   File: TypeCodeImpl.java   View source code 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 40
Project: classpath   File: StructureToReturnHelper.java   View source code 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}