[Enterprise Extensions only]

CORBA::is_nil

Overview Indicates whether the input object pointer represents a nil object.
Original class CORBA


Intended Usage

This method is intended to be used by client and server applications to determine whether an object pointer is nil. This test should be used to verify the validity of the object prior to invoking any methods on it. This method has different signatures for different types of objects.

IDL Syntax

  static Boolean is_nil(Any_ptr p);
  static Boolean is_nil(BOA_ptr p);
  static Boolean is_nil(ContextList_ptr p);
  static Boolean is_nil(Context_ptr p);
  static Boolean is_nil(Current_ptr p);
  static Boolean is_nil(Environment_ptr p);
  static Boolean is_nil(ExceptionList_ptr p);
  static Boolean is_nil(Exception_ptr p);
  static Boolean is_nil(NamedValue_ptr p);
  static Boolean is_nil(NV_ptr p);
  static Boolean is_nil(ORB_ptr p);
  static Boolean is_nil(Object_ptr p);
  static Boolean is_nil(Principal_ptr p);
  static Boolean is_nil(Request_ptr p);
  static Boolean is_nil(ServerRequest_ptr p);
  static Boolean is_nil(TypeCode_ptr p);

Input parameters

p
The object pointer to be tested. This pointer can be NULL.

Return values

CORBA::Boolean
Returns "0" or "1". If "0" is returned, the input object pointer is valid. If"1" is returned, the input object pointer refers to a nil object.

Example

  /* The following is a C++ example */
  #include "corba.h"
  ...
  /* Retrieve the pointer in BOA object */
  CORBA::BOA_ptr pBOA;
  pBOA = CORBA::_boa();
  /* Test if the pointer refers to a nil object */
  CORBA::Boolean bool;
  bool = CORBA::is_nil(pBOA);
  if (bool == TRUE)
    {
    /* pBOA refers to a nil object, return or generate exception */
    ...
    }
  else
    {
    /* proceed, using pBOA */
    ...