edmiReadAggrElements
EdmiError edmiReadAggrElements(SdaiAggr aggrId, SdaiInteger firstElementIndex, SdaiInteger maxElementsToRead, SdaiInteger *actualElementsRead, SdaiPrimitiveType *elementType, SdaiBoolean **elementsValueSet, void **dataAddress);
Reads the specified elements from the specified aggregate and store the result as a memory buffer in the calling application. The space required to hold the memory buffer and optionally the <elementsValueSet> array are allocated by the operation and should be released by the caller when appropriate by invoking the edmiFree operation. 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.
Arguments
Type | Name | Comment |
SdaiAggr | aggrId | A numeric aggregateID that uniquely identifies the aggregate of interest in the EDMdatabase. The aggregateID is returned when the aggregate is created or it can be retrieved with an EDMinterface get operation. |
SdaiInteger | firstElementIndex | Specifies the index of the first aggregate element to read. The legal index range for all aggregate types are: |
SdaiInteger | maxElementsToRead | Specifies max number of elements to read. |
SdaiInteger | actualElementsRead | Address of a SdaiInteger variable that receives the actual number of elements read. |
SdaiPrimitiveType | elementType | Address of a SdaiPrimitiveType variable that receives the data type (primitive type) of the elements in the memory buffer. |
SdaiBoolean | elementsValueSet | Address of a SdaiBoolean array. The index range of this array is: |
void | dataAddress | Address of a void* variable that receives the address of the returned memory buffer. This address should be used as the argument in the edmiFree operation to release the virtual memory holding the memory buffer. |
Return Value
Options
Example
EdmiError rstat; SdaiAggr aggrId; SdaiInteger firstElementIndex,maxElementsToRead,actualElementsRead; SdaiPrimitiveType elementType; SdaiBoolean *elementsValueSet; SdaiString *p,*dataAddress; int i; . . . firstElementIndex = 0; maxElementsToRead = 1000; if (rstat = edmiReadAggrElements (aggrId, firstElementIndex, maxElementsToRead, &actualElementsRead, &elementType, &elementsValueSet, (void *) &dataAdress)) { /* Error in operation */ printf("\nError: %s in edmiReadAggrElements\n", edmiGetErrorText(rstat)); goto error; } /* Expecting a memory buffer of SdaiString data type */ if (elementType == sdaiSTRING) { /* Print out the returned strings */ p = dataAdress; for (i = 0; i < actualElementsRead; i++) { printf("\n%s",*p); ++p; } } edmiFree(dataAddress); . . .
See also
Filter by label
There are no items with the selected labels at this time.