...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiUsedIn(SdaiAppInstance instance,
SdaiAttr roleId,
SdaiInteger options,
SdaiInteger *membersInResult,
void *result);
|
Implements the Express built in function UsedIn as defined in section 15.26 UsedIn – general function; in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual.
This operation is only applicable on data models. The actual data model must be open before this operation can be successfully performed.
Related functions: edmiUsedInBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiUsedIn(SdaiAppInstance instance,
SdaiAttr roleId,
SdaiInteger options,
SdaiInteger *membersInResult,
void *result);
Arguments:
Arguments
...
Type | Name | Comment | |
SdaiAppInstance | instance | A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase. | |
SdaiAttr | roleId | The SdaiAttr instance that uniquely specifies a role in a dictionary model. A role is the same as an attributeID. The attributeID is returned from the sdaiGetAttrDefinition and sdaiGetAttrDefinitionBN functions. | This argument can be set to zero, meaning that any role the actual <instance> plays will be returned by this function. |
SdaiInteger | options | Specifies the options that are enabled in the invocation of the edmiUsedIn function. The <options> value should be specified as a bitwise OR between the options to enable. All option names are defined in the header file sdai.h . | See detailed descriptions of the available options below. |
SdaiInteger | membersInResult | Address of a SdaiInteger variable that will receive the returned number of elements in the result data set. | |
void | result | Address of a variable that will receive the aggregateID of the scratch aggregate or address of the memory buffer that holds the resulting data set. |
Return Value
...
Insert excerpt | ||
---|---|---|
|
|
Options
...
Option | Comment | ||
---|---|---|---|
AS_SCRATCH_AGGR | The result of the operation will be returned in a new created scratch aggregate. The scratch aggregate will be a BAG OF ENTITY_INSTANCE. | A numeric aggregateID that uniquely identifies the resulting scratch aggregate instance will be returned in the <result> argument. | AS_SCRATCH_AGGR is the default value of the <options> argument. |
AS_MEMORY_BUFFER | The operation result aggregate will be returned as a memory buffer in the calling application's virtual memory. The memory address (byte address) of the memory buffer will be returned in the <result> argument. | The memory buffer will be an array of SdaiInstance. | The virtual memory in the calling application's memory will be allocated by EDMinterface. This virtual memory should be released by the calling application, using the EDMinterface operation edmiFree when the data is no longer needed by the application. |
...
Example
...
Code Block | ||
---|---|---|
| ||
EdmiError rstat; SdaiAppInstance instance, result, *p; SdaiInteger membersInResult; SdaiAttr roleId; int i; . . . if (rstat = edmiUsedIn (instance, roleId, AS_MEMORY_BUFFER, |
...
&membersInResult, |
...
(void *) &result)) { |
...
/* Error in operation */ |
...
printf("\nError: %s in edmiUsedIn\n", |
...
edmiGetErrorText(rstat)); |
...
goto error; |
...
} /* Printing out all the instances that uses the specified instance |
...
in the specified role */ |
...
p = result; |
...
for (i = 0; i < membersInResult; i++) { |
...
printf("\nInstanceId: %lu", *p); |
...
++p; |
...
} edmiFree((void *) result); |
...
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|