[Enterprise Extensions only]

Object::_narrow

Overview Performs essentially the same function as CORBA::Object::_duplicate().
Original class CORBA::Object
Exceptions CORBA::SystemException


Intended Usage

This method is provided for consistency with the _narrow methods provided by the C++ bindings for subclasses of CORBA::Object, which narrow a generic CORBA::Object to a more specific type. When narrowing from a CORBA::Object to a CORBA::Object, however, the method degenerates to a simple duplication. Hence, this method is equivalent to CORBA::Object::_duplicate.

IDL Syntax

  static CORBA::Object_ptr _narrow (CORBA::Object_ptr obj);

Input parameters

obj
The CORBA::Object to be narrowed.The caller retains ownership of this object reference.

Return values

CORBA::Object_ptr
The narrowed (and duplicated) object reference. The caller assumes ownership of this object reference and should subsequently CORBA::release it.

Example

  /* Assume the following idl interface: */
  interface testObject
  {
    string testMethod (in long input_value, out float out_value);
  };
  /* Here is the cpp code: */
  CORBA::Object_ptr optr;
  /* instantiate optr somehow */
  ...
  testObject_ptr test_obj = testObject::_narrow(optr);
  ...