edmiQuery
EdmiError edmiQuery(SdaiAggr sourceAggr, SdaiString condition, SdaiInteger options, SdaiInteger *membersInResult, SdaiPrimitiveType *elementType, SdaiBoolean **elementsValueSet, void *result);
Implements the Express Query operation as defined in section 12.6.7 Query expression in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual. The data model that hosts the source aggregate of the operation must be open before this operation can be successfully performed. The edmiQuery operation is fully processed by the EDMexpressVM.
Arguments
Type | Name | Comment |
SdaiAggr | sourceAggr | A numeric aggregateID that uniquely identifies the source aggregate to be queried. The aggregateID is returned when the aggregate is created or it can be retrieved with an EDMinterface get operation. |
SdaiString | condition | Any legal symbolic Express-X logical expression. This <condition> argument will be compiled by the EDMexpressXCompiler |
SdaiInteger | options | Specifies the options to be used in the invocation of the edmiQuery function. The <options> value can be specified as a bitwise OR between the actual options to enable. All option names are defined on 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. |
SdaiPrimitiveType | elementType | Address of a SdaiPrimitiveType variable that will receive the primitive type of the resulting data set. |
SdaiBoolean | elementsValueSet | Address of a SdaiBoolean array. The index range of this array is:Â 0 <= index < membersInResult |
void | result | Address of a void* variable that will receive the resulting data set. The data type and value of the resulting data set is dependent of the <options> argument. |
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 source aggregate <sourceAggr>, and will be according to the definition of the operation in the EXPRESS language. 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 the <elementType> data type, i.e., an array of SdaiInteger, SdaiReal, SdaiString, SdaiInstance, SdaiAggr, SdaiBoolean, SdaiLogical, SdaiBinary, SdaiEnumeration or SdaiSelect. 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. |
IN_OPERAND1 | The result of the operation will be in the aggregate specified in the <sourceAggr> argument. Hence the original value in the <sourceAggr> aggregate will be overwritten by the operation. |
Example
Â
EdmiError rstat; SdaiAggr sourceAggr; SdaiInteger membersInResult; SdaiPrimitiveType elementType; SdaiBoolean *elementsValueSet; SdaiInstance *p, *result; int i; . . . if (rstat = edmiQuery(sourceAggr, "Exists(Father) AND (SizeOf(Mother.children) > 2)", AS_MEMORY_BUFFER, &membersInResult, &elementType, &elementsValueSet, (void *) &result)) { /* Error in operation */ printf("\nError: %s in edmiQuery\n", edmiGetErrorText(rstat)); goto error; } /* Print out the returned instanceIds */ p = result; for (i = 0; i < membersInResult; i++) { printf("\nInstanceID: %10lu",*p); ++p; } edmiFree(result); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â