sdaiGetAggrByIterator
Returns the data value in the actual aggregate element. The specified primitive type <valueType> must be the same as the actual data type in the aggregate element or a compatible data type. The primitive type sdaiSELECT can be used to get all data types. The primitive type sdaiADB can be used to get all data types except typed value. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.
This operation is applicable for all aggregate types. The actual aggregate element is specified by an iterator, i.e. the current element of the specified iterator is the aggregate element of interest.
The model that holds the actual aggregate must be open before this function can be successfully performed.
Related functions: sdaiGetAggrByIndex , edmiGetAggrElement
Header:
#include "sdai.h"
Prototype:
void *sdaiGetAggrByIterator(SdaiIterator iterator,
SdaiPrimitiveType valueType,
void *value);
Arguments:
iterator |
A numeric iteratorID that uniquely identifies an iterator in the actual EDMserver. The current element of the iterator will be the actual aggregate element. |
valueType |
The data type, i.e. the primitive type of the data value to be retrieved. This <valueType> must be the same or a compatible type of the primitive type of the value in the actual aggregate element. The primitive type sdaiSELECT can be used to read all data types. The primitive type sdaiADB can be used to read all data types except typed values. |
value |
The variable that will hold a copy of the data value read from the actual aggregate element. The type of <value> must be the same or a compatible type of <valueType>. |
Returns:
void * = address of <value> : operation successfully performed.
void * = NULL: error during operation – use sdaiErrorQuery function to get error reason.
Example:
SdaiIterator iterator;
SdaiAggr aggrId;
SdaiInteger myInt;
...
iterator = sdaiCreateIterator (aggrId);
while (sdaiNext(iterator) == sdaiTRUE) {
p = sdaiGetAggrByIterator(iterator, sdaiINTEGER, &myInt);
if (p == NULL) {
/* Error in operation */
printf("\nError: %s in sdaiGetAggrByIterator \n",
edmiGetErrorText(sdaiErrorQuery()));
goto error;
}
. . .
}
. . .