edmiAggrDifference
Â
EdmiError edmiAggrDifference(SdaiInteger options, SdaiInteger *membersInResult, SdaiPrimitiveType *elementType, void *result, SdaiAggr operand1, SdaiPrimitiveType operand2Datatype, . . . ); /* operand2 data value*/
Implements the Express Aggregate Difference> operation as defined in section 12.6.4 Difference 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 with the required access 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
Type | Name | Comment |
SdaiInteger | options | Specifies the options to be used in the invocation of the edmiAggrDifference 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 from the operation. |
void | result | Address of a variable that will receive the result of the operation. The data type of the <result> argument depends on the option argument. |
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. |
SdaiPrimitiveType | operand2Datatype | This argument specifies the data type of operand2 (right operand) in the aggregate difference operation. The value of this argument must be one of the following legal data types: sdaiINTEGER, sdaiREAL, sdaiBOOLEAN, sdaiLOGICAL, sdaiSTRING, sdaiBINARY, sdaiENUMERATION, sdaiAGGR, sdaiINSTANCE or sdaiSELECT. |
SdaiAggr | operand2 | The value of operand2 (right operand) in the aggregate difference operation. The data type must be according to the specification in the < operand2Datatype> data type. |
Return Value
Â
Options
 Â
Option | Comment |
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. |
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 virtual memory required to locate the memory buffer will be allocated by the edmiAggrDifference 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. |
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 data type of <operand2> is sdaiAGGR and this aggregate is the same type as the resulting aggregate from the edmiAggrDifference operation. |
Â
Example
Â
 EdmiError rstat; SdaiInteger membersInResult; void *result; SdaiPrimitiveType elementType; SdaiAggr operand1, operand2; . . . if (rstat = edmiAggrDifference(AS_MEMORY_BUFFER, &membersInResult, &elementType, (void *) &result, operand1, sdaiAGGR, operand2)) { /* Error in operation */ printf("\nError: %s in edmiAggrDifference\n", edmiGetErrorText(rstat)); goto error; } /* Resulting data set is found in memory buffer at address returned in the result variable */ . . . /* Release memory buffer when data is no longer needed */ edmiFree(result); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â
Â