2-31
DSOM Framework Reference
destroy Method (for a Context object)
Purpose
Deletes a Context object.
IDL Syntax
ORBStatus destroy (
in Flags del_flag);
Description
The destroy method deletes the specified Context object.
NOTE: This method is called “delete” in the CORBA 1.1 specification. However, the word
“delete” is a reserved operator in C++, so the name “destroy” was chosen as an alternative.
For CORBA compatibility, a macro defining Context_delete as an alias for destroy has
been included in the C header files.
Parameters
receiver A pointer to the Context object to be deleted.
env A pointer to the Environment structure for the method caller.
del_flag A bitmask (unsigned long). If the option flag
CTX_DELETE_DESCENDENTS is specified, the method deletes the
indicated Context object and all of its descendent Context objects. Or, a
zero value indicates the flag is not set.
Return Value
The destroy method returns an ORBStatus value representing the return code from the
operation.
Example
#include <somd.h>
Environment ev;
Context cxt, newcxt;
long rc;
...
/* get the process’ default Context */
rc = _get_default_context(SOMD_ORBObject, &ev, &cxt);
/* make newcxt a child Context of the default Context (cxt) */
rc = _create_child(cxt, &ev, ”myContext”, &newcxt);
...
/* assuming no descendent Contexts have been
* created from newcxt, we can destroy newcxt with flags=0
*/
rc = _destroy(newcxt, &ev, (Flags) 0);
Original Class
Context
Komentarze do niniejszej Instrukcji