edmiAggrIntersection


 

EdmiError edmiAggrIntersection(SdaiAggr          operand1,
                                SdaiAggr          operand2, 
                                SdaiInteger       options, 
                                SdaiInteger       *membersInResult, 
                                SdaiPrimitiveType *elementType, 
                                void              *result);  

Implements the Express Aggregate Intersection> operation as defined in section 12.6.2 Intersection operator; in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual. This operation is only applicable to aggregates in data models. The actual data models must be open before this function can be successfully performed. When any of the options values IN_OPERAND1 or IN_OPERAND2 is specified, then the actual model must be opened for write access,

Arguments


TypeNameComment
SdaiAggr

operand1

A numeric aggregateID that uniquely identifies the aggregate instance used as operand1 (left operand) in the operation. The aggregateID is returned when the aggregate is created or it can be retrieved by an EDMinterface get operation.

SdaiAggr

operand2

A numeric aggregateID that uniquely identifies the aggregate instance used as operand2 (right operand) in the operation. The aggregateID is returned when the aggregate is created or it can be retrieved by an EDMinterface get operation.

SdaiInteger

options

Specifies the options to be used in the invocation of the edmiAggrIntersection function. The <options> value can be specified as a bitwise OR between the actual options to enable. All option names are defined in the header file sdai.h.  The default value of the <options> argument is: AS_SCRATCH_AGGR  See detailed descriptions of the available options below.

SdaiInteger

membersInResult

Address of a variable that will receive the returned number of elements in the result aggregate.

SdaiPrimitiveType

elementType

Address of a variable that will receive the data type of the resulting data of the operation.

void

result

Address of a variable that will receive the result of the aggregate intersection operation. The data type of the <result> argument is dependent of the <options> argument.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

 

Options


  

OptionComment

AS_SCRATCH_AGGR

The result of the operation will be returned in a new created scratch aggregate. The aggregate type is dependent of the aggregate type of the operands and will be according to the definition of the operation in the Express language.  A numeric aggregateID that uniquely identifies the resulting aggregate instance will be returned in the <result> argument. See: Scratch Aggregate for more details

AS_MEMORY_BUFFER

The operation result aggregate will be returned as a memory aggregate in the calling application's virtual memory. The memory address (byte address) will be returned in the <result> argument.  The virtual memory required to locate the memory aggregate will be allocated by the edmiAggrIntersection operation. 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.  See: Memory Aggregates for more details

IN_OPERAND1

The result of the operation will be in the aggregate specified in the <operand1> argument. Hence the original value in the <operand1> aggregate will be overwritten.

IN_OPERAND2

The result of the operation will be in the aggregate specified in the <operand2> argument. Hence the original value in the <operand2> aggregate will be overwritten. This option is only legal when the <operand2> aggregate is the same type as the resulting aggregate from the edmiAggrIntersection operation.

 

Example


 

 int i;
 EdmiError rstat;
 void *result;
 SdaiAggr operand1, operand2;
 SdaiInteger membersInResult;
 SdaiPrimitiveType elementType;
 SdaiInstance *pi;
 . . .
 If (rstat = edmiAggrIntersection (operand1,
 operand2, 
 AS_MEMORY_BUFFER,
 &membersInResult,
 &elementType, 
 (void *)&result)) { 
 /* Error in operation */ 
 printf("\nError: %s in edmiAggrIntersection \n", 
 edmiGetErrorText(rstat)); 
 goto error; 
 }
 /* Assuming that the resulting data set is of type SdaiInstance,
 i.e., elementType = sdaiINSTANCE 
 print out instanceId of resulting data set */ 
 pi = (SdaiInstance *) pi;
 for (i = 0; i < membersInResult; i++) {
 print("\n%lu",*p); 
 ++pi;
 }
 . . .
 edmiFree(result); /* free memory buffer */
 . . . 

 

See also

Filter by label

There are no items with the selected labels at this time.