Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Gets a list of the subtypes of a given entity.
The dictionary model containing the the specified entity definition must be opened before this operation can be successfully performed.
The functionality of this operations is the same as for the EDMsupervisor command Schemata>List>Subtypes
Related functions: sdaiIsSubtypeOf, sdaiIsSubtypeOfBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetSubtypes(SdaiEntity entityId,SdaiInteger options,SdaiInteger *numberOfSubtypes,SdaiEntity **subtypes);
Arguments:

entityId

The instanceID that uniquely identifies the instance of entity definition within a dictionary model in the EDMdatabase.
The entityID is returned by the sdaiGetEntity function.

options

The <options> value should be one of the options described below.
The name of all <options> are defined in the header file sdai.h

numberOfSubtypes

The number of subtypes found.

subtypes

Address of an array of entity-definition instances that specifies the returned subtypes.
The virtual memory holding the result of the operation is allocated by EXPRESS Data Manager, hence the application should free this memory when appropriate by invoking the edmiFree() operation to avoid "out of virtual memory".

Options:

DIRECT_SUBTYPES

Only the nearest subtypes will be included in the result.This is the default value of the <options> argument.

ALL_SUBTYPES

Specifies that all entities that are subtypes of the actual entity are included in the result.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiInteger numberOfsubtypes;
SdaiEntity entityId,*subtypes;
. . .
if (rstat = edmiGetSubtypes(entityId,
ALL_SUBTYPES,
&numberOfsubtypes, 
&subtypes)) {
/* Error in operation */
printf("\nError: %s in edmiGetSubtypes\n", 
edmiGetErrorText(rstat)); 
goto error; 
}
/* Resulting data set is found in memory buffer at address returned
in the <subtypes> variable */ 
. . .
/* Release memory buffer when data is no longer needed */
edmiFree(subtypes);
. . .
 

  • No labels