ORB::create_struct_tc

Overview Creates a tk_struct TypeCode.
Original class CORBA::ORB
Exceptions CORBA::SystemException


Intended Usage

This method is used to create a TypeCode of kind tk_struct, representing an IDL struct.

Syntax

  CORBA::TypeCode_ptr create_struct_tc (
      CORBA::RepositoryId rep_id,
      CORBA::Identifier name,
      CORBA::StructMemberSeq & members);

Input parameters

rep_id
The non-NULL Interface Repository identifier of the IDL struct. The caller retains ownership of this string.
name
The non-NULL simple name of the IDL struct. The caller retains ownership of this string.
members
A CORBA::StructMemberSeq object (a sequence of structs of type CORBA::StructMember) listing the members of the IDL struct. Each CORBA::StructMember in the sequence specifies the name and type of the corresponding struct member; only the type member is used, and the type_def member should be set to NULL. The sequence must contain at least one CORBA::StructMember, and each CORBA::StructMember in the sequence must have a non-NULL TypeCode. The caller retains ownership of this object.

Return values

CORBA::TypeCode_ptr
The newly-created TypeCode. The caller assumes ownership of this TypeCode, and should subsequently release it using CORBA::release(TypeCode_ptr).

Example

  /* Code to create a tk_struct TypeCode corresponding to this
     IDL definition:
         struct my_struct
         {
           long my_long;
           char my_char;
         };
   */
  /* assume op initialized */
  extern CORBA::ORB_ptr op;
  CORBA::_IDL_SEQUENCE_StructMember stm_seq;
  stm_seq.length(2);
  stm_seq [0].type = CORBA::_tc_long;
  stm_seq [0].name = CORBA::string_dup ("my_long");
  stm_seq [1].type = CORBA::_tc_char;
  stm_seq [1].name = CORBA::string_dup ("my_char");
 
  CORBA::RepositoryId rep_id = CORBA::string_dup("RepositoryId_999");
  CORBA::Identifier name = CORBA::string_dup("my_struct");
  CORBA::TypeCode_ptr tc = op->create_struct_tc (rep_id, name, stm_seq);

Related reference
CORBA module



Searchable topic ID:   rcor_modo20
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modo20.html

Library | Support | Terms of Use | Feedback