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


TypeNameComment
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:
0 <= index < number of elements in aggregate.

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:
0 <= index < membersInResult
An element value = sdaiTRUE means that the corresponding element in the memory buffer is set (is valid).  This argument is only valid when the aggregate type of <aggrId> is ARRAY. This virtual memory occupied by the <elementsValueSet> argument should be released by the calling application, using the EDMinterface operation edmiFree when the data is no longer needed by the application.

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


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

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.