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. |
options |
The <options> value should be one of the options described below. |
numberOfSubtypes |
The number of subtypes found. |
subtypes |
Address of an array of entity-definition instances that specifies the returned subtypes. |
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);
. . .