sdaiRemove
Removes the aggregate member that is the current element of the specified iterator. The iterator is positioned to the aggregate element immediately following the element to be deleted after this operation is completed. The actual data value of the element to be removed is returned by this operation. Hence the effect of this operation is as if the functions sdaiGetAggrByIterator and sdaiDelete was applied on the same iterator.
This operation cannot be applied to aggregates of category ARRAY.
This operation is only applicable to aggregates owned by application instances.
The actual model that holds the actual aggregate must be open for write access before this operation can be successfully performed.
Related function: sdaiGetAggrByIterator , sdaiGetAggrByIndex , sdaiDelete .
Header:
#include "sdai.h"
Prototype:
void *sdaiRemove(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 of aggregate element to be deleted. 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:
The actual data value of the element to be removed is returned by this operation.
Examples:
SdaiIterator iterator;
SdaiAggr aggrId;
SdaiInteger myInt;
void *p;
...
iterator = sdaiCreateIterator (aggrId);
. . .
p = sdaiRemove(iterator, sdaiINTEGER, &myINT);
if (p == NULL) {
/* Error in operation */
printf("\nError: %s in sdaiRemove \n",
edmiGetErrorText(sdaiErrorQuery()));
goto error;
}
. . .