om_create(3xom) — Subroutines
(c) Digital Equipment Corporation. 1994. All rights reserved.
Name
om_create − Creates a new private object that is an instance of a particular class.
Syntax
OM_return_code om_create(class, initialise, workspace, object)
class@OM_object_identifier@T{ read T} initialise@OM_boolean@T{ read T} workspace@OM_workspace@T{ read T} object@OM_private_object@T{ write T} return_code@T{ OM_return_code T}
C Binding
OM_return_code om_create(class, initialise, workspace, object)
OM_object_identifier class,
OM_boolean initialise,
OM_workspace workspace,
OM_private_object #object
Arguments
Class
The class of the object you are creating. It must be a concrete class.
Initialise
If you set this argument to OM_TRUE, the object that you create has some of its attributes initialised. These are the attributes for which initial values are specified in the class definition table. You can find these class definition tables in the documentation for the X.400 and X.500 APIs.
If you set this argument to OM_FALSE, the object you create has only its Class attribute initialised.
Workspace
The workspace in which the Service should create the object. The class you specify for the object must be in a package that you have already associated with this workspace.
Object
This is the created object. The Service returns this argument if the Return Code of the function is OM_SUCCESS.
Description
This function creates a private object in the workspace that you specify.
You can add new values and replace or remove existing values, any time after the object has been created. In this way, you can create any possible instance of the object’s class.
Return Values
The function has completed its task successfully T} OM_FUNCTION_DECLINED@T{ The function does not apply to the object to which it is addressed T} OM_FUNCTION_INTERRUPTED@T{ The function was aborted by external intervention T} OM_MEMORY_INSUFFICIENT@T{ There is not enough memory to complete the function T} OM_NETWORK_ERROR@T{ The Service cannot use the underlying network T} OM_NO_SUCH_CLASS@T{ There is an undefined class identifier T} OM_NO_SUCH_WORKSPACE@T{ You have specified a nonexistent workspace T} OM_NOT_CONCRETE@T{ A class is abstract, not concrete T} OM_PERMANENT_ERROR@T{ The Service encountered a permanent problem for which there is no defined error code T} OM_POINTER_INVALID@T{ An invalid pointer was supplied as a function argument T} OM_SYSTEM_ERROR@T{ The Service cannot use the operating system T} OM_TEMPORARY_ERROR@T{ The Service encountered a temporary problem for which there is no defined error code T}
Examples
The first example shows how to create a private object of Message Handling (MH) class Local Per-recipient NDR, with the Initialise argument set to OM_FALSE; the function does not initialize any of the object’s attributes.
The second example shows the creation of a private object of X.500 class Entry-Info-Selection, with the Initialise argument set to OM_TRUE; the function initializes two of the object’s attributes.
Exhibit 0-0.
OM_private_object ndr;
OM_workspace workspace;
OM_return_code result;
result = om_create (MH_C_LOCAL_PER_RECIP_NDR,
/∗ class of object ∗/
OM_FALSE,
/∗ do not initialise attributes ∗/
workspace,
/∗ workspace in which object created ∗/
&ndr);
/∗ created object ∗/
Exhibit 0-0.
OM_private_object select_info;
OM_workspace workspace;
OM_return_code result;
result = om_create (DS_C_ENTRY_INFO_SELECTION,
/∗ class of object ∗/
OM_TRUE,
/∗ initialise attributes ∗/
workspace,
/∗ workspace in which object created ∗/
&select_info);
/∗ created object ∗/