Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ om_instance(3xom) — X.500 3.1

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)
 

 
subject@OM_object@T{ read T} class@OM_object_identifier@T{ read T} instance@OM_boolean@T{ write T} return_code@T{ OM_return_code T}  

 
 
 
 
 
 

C Binding

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

Arguments

 
 
 

Subject
 
The object whose class you want to verify.
 
 

Class
 
The class against which you want to verify the subject.
 
 

Instance
 
The 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

 
 
 
 

The function has completed its task successfully 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_OBJECT@T{ You have specified a nonexistent object, or an invalid Handle for an object T} OM_NO_SUCH_SYNTAX@T{ There is an undefined syntax identifier. T} OM_NOT_THE_SERVICES@T{ An object is Client generated rather than Service generated or private. 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 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. 
 

Exhibit 0-0.

 
OM_private_object   sub_mess_rd;
 
OM_return_code      result;
 
OM_boolean          inst;
 
     result = om_instance (an_object,
                                /∗ object to be checked ∗/
                           MH_C_SUBMITTED_MESSAGE_RD,
                                /∗ class to be checked against ∗/
                           &inst);
                                /∗ result ∗/
 
     if (inst == OM_TRUE)
              /∗ the object is an instance of specified class ∗/
 
     else
              /∗ the object is not an instance of specified class ∗/
 

 
 
 
 
 
 
 
 
 
 
 

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