![]() |
Overview Creates a tk_except TypeCode. Original class CORBA::ORB Exceptions CORBA::SystemException
Intended Usage
This method is intended to be used to create a TypeCode of kind tk_except, representing an IDL exception.
IDL Syntax
CORBA::TypeCode_ptr create_exception_tc ( CORBA::RepositoryId rep_id, CORBA::Identifier name, CORBA::StructMemberSeq & members);
Input parameters
- rep_id
- The non-NULL Interface Repository identifier of the IDL exception. The caller retains ownership of this string.
- name
- The non-NULL simple name of the IDL exception. 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 exception. Each CORBA::StructMember in the sequence specifies the name and type of the corresponding exception member; only the type member is used, and the type_def member should be set to NULL. 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_except TypeCode corresponding to this IDL definition: exception my_exception { string my_string; }' */ /* assume op initialized */ extern CORBA::ORB_ptr op; CORBA::RepositoryId rep_id = CORBA::string_dup("RepositoryId_999"); CORBA::Identifier name = CORBA::string_dup("my_exception"); CORBA::StructMemberSeq st_seq; st_seq.length(1); st_seq[0].type = CORBA::_tc_string; st_seq[0].name = CORBA::string_dup("my_string"); CORBA::TypeCode_ptr tc = op->create_exception_tc (rep_id, name, st_seq);