edmiAggrUnion

EdmiError edmiAggrUnion(SdaiInteger       options,
                         SdaiInteger       *membersInResult, 
                         SdaiPrimitiveType *elementType, 
                         void              *result,  
                         SdaiPrimitiveType operand1Datatype, 
                         /*operand1Value, 
                         operand2DataType, 
                         operand2Value */ 
                          . . . ); 

Implements the Express Aggregate Union> operation as defined in section 12.6.3 Union 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
SdaiInteger

options

Specifies the options to be used in the invocation of the edmiAggrUnion 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 union operation. The data type of the <result> argument is dependent of the <options> argument.

SdaiPrimitiveType

operand1Datatype

This argument specifies the data type of operand1 (left operand) in the aggregate union operation. The value of this argument must be one of the following legal data types: sdaiINTEGER, sdaiREAL, sdaiBOOLEAN, sdaiLOGICAL, sdaiSTRING, sdaiBINARY, sdaiAGGR, sdaiINSTANCE, sdaiENUMERATION or sdaiSELECT.

 

operand1Value

The actual value of <operand1>

 

operand2DataType

This argument specifies the data type of operand2 (right operand) in the aggregate union operation. The value of this argument must be one of the following legal data types: sdaiINTEGER, sdaiREAL, sdaiBOOLEAN, sdaiLOGICAL, sdaiSTRING, sdaiBINARY, sdaiAGGR, sdaiINSTANCE, sdaiENUMERATION or sdaiSELECT.

 

operand2Value

The actual value of <operand2>

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 edmiAggrUnion 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 <operand1Value> argument. Hence the original value in the <operand1Value> aggregate will be overwritten. This option is only legal when <operand1> is an aggregate that is of the same type as the resulting aggregate.

IN_OPERAND2

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

 

Example


 

int i;
 EdmiError rstat;
 void *result;
 SdaiAggr operand1, operand2, resultAggrId;
 SdaiInteger membersInResult;
 SdaiPrimitiveType elementType;
 SdaiString str;
 . . .
 If (rstat = edmiAggrUnion (AS_SCRATCH_AGGR,
 &membersInResult, 
 &elementType, 
 (void *) &result, 
 sdaiAGGR, 
 operand1, 
 sdaiAGGR, 
 operand2)) { 
 /* Error in operation */ 
 printf("\nError: %s in edmiAggrUnion \n", 
 edmiGetErrorText(rstat)); 
 goto error; 
 }
 /* Assuming that the resulting data set is a scratch aggregate of
 strings, i.e., elementType = sdaiSTRING 
 print out instanceId of resulting data set */ 
 resultAggrId = (SdaiAggr) result;
 for (i = 0; i < membersInResult; i++) {
 edmiGetAggrElement(resultAggrId, i, sdaiSTRING, &str);
 print("\n%s",str); 
 edmiFree(str); 
 }
 . . .

 

See also

Filter by label

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

 

Â