2-104
SOMobjects Base Toolkit: Programmer’s Reference Manual
is_nil Method
Purpose
Tests to see if the object reference is nil.
IDL Syntax
boolean is_nil ( );
Description
The is_nil method tests to see if the specified object reference is nil.
Parameters
receiver A pointer to any object, either a SOMObject or a SOMDObject. The
pointer can be NULL.
env A pointer to the Environment structure for the method caller.
Return Value
The is_nil method returns TRUE if the object reference is empty. Otherwise, is_nil returns
FALSE.
Example
#include <somd.h>
Environment ev;
SOMDObject objref;
SOMObject somobj;
...
/* This code might be part of the code
* that overrides the somdSOMObjFromRef method, i.e.
* in an implementation of a subclass of SOMDServer called
* myServer
*/
if (_is_nil(objref, &ev) ||
_somIsA(objref, SOMDClientProxyNewClass(0, 0)) ||
_is_SOM_ref(objref, &ev)) {
somobj = myServer_parent_SOMDServer_somdSOMObjFromRef
(somSelf, &ev, objref);
}
else {
/* do the myServer–specific stuff to create/find somobj here */
}
return somobj;
Related Information
Methods: create, is_constant, is_proxy, is_SOM_ref
Kommentare zu diesen Handbüchern