Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ om_instance(3xom) — MAILbus 400 2.0C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

om_instance(3xom)  —  Subroutines

(c) Digital Equipment Corporation. 1994. All rights reserved. 

Name

om_instance − Determines whether an object is an instance of a particular class or of one of its subclasses. 

Syntax

OM_return_code om_instance(subject, class, instance)
 

Argument Data Type Access
subject OM_object read
class OM_object_identifier read
instance OM_boolean write
return_code OM_return_code

C Binding

OM_return_code om_instance(subject, class, instance) OM_object subject,
OM_object_identifier class,
OM_boolean ∗instance

Arguments

SubjectThe object whose class you want to verify. 

ClassThe class against which you want to verify the subject. 

InstanceThe Service sets this argument to OM_TRUE if the subject is an instance of the class you specified, and OM_FALSE if the subject is not. The Service returns this argument if the Return Code of the function is OM_SUCCESS. 

Description

 
This function enables you to determine whether an object is an instance of a specified class or of any of the subclasses of that class.

Note that it is possible to determine an object’s class by using programming constructs to inspect the object, if it is public, or by using om_get, if it is private. The advantage of the Instance function is that it indicates whether the object is an instance of the specified class, even when it is also a subclass of the specified class. 

Return Values

OM_SUCCESS The function has completed its task successfully
OM_FUNCTION_INTERRUPTED The function was aborted by external intervention
OM_MEMORY_INSUFFICIENT There is not enough memory to complete the function
OM_NETWORK_ERROR The Service cannot use the underlying network
OM_NO_SUCH_CLASS There is an undefined class identifier
OM_NO_SUCH_OBJECT You have specified a nonexistent object, or an invalid Handle for an object
OM_NO_SUCH_SYNTAX There is an undefined syntax identifier. 
OM_NOT_THE_SERVICES There is a client-generated public object where there should be either a service-generated public object or a private object
OM_PERMANENT_ERROR The Service encountered a permanent problem for which there is no defined error code
OM_POINTER_INVALID An invalid pointer was supplied as a function argument
OM_SYSTEM_ERROR The Service cannot use the operating system
OM_TEMPORARY_ERROR The Service encountered a temporary problem for which there is no defined error code

Examples

 
The following example shows how to check a private object, an_object, to see if it is an instance of the X.400 Message Handling class Submitted Message RD. inst_true is the return argument. The function returns OM_TRUE in the parameter if the object is an instance of the class Submitted Message RD, or its subclass Message RD. 
 
OM_private_object    an_object;
OM_return_code       result;
OM_boolean           inst;
 
result = om_instance (an_object,                  /∗ obj to be checked ∗/
                       MH_C_SUBMITTED_MESSAGE_RD, /∗ class to check for ∗/
                       &inst);                    /∗ result ∗/
if (inst == OM_TRUE)   /∗ the obj is an instance of specified class ∗/
    .
    .
    .
else                   /∗ the obj is not an instance of specified class ∗/
    .
    .
    .
 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026