Copies the specified number of elements in one (source) aggregate to another (target) aggregate. The target aggregate must be located in a data model element of data type SdaiAggr cannot be copied by this operation. Hence, to copy a nested aggregate, several invocations of the edmiCopyAggr operation are required.
The model that locates the source aggregate must be open for any access and the data model that locates the target model must be open for write access before this operation can be successfully performed.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiCopyAggr (SdaiAggr sourceAggrId,
SdaiInteger sourceIndex,
SdaiAggr targetAggrId,
SdaiInteger targetIndex,
SdaiInteger maxElementsToCopy);
Arguments:
sourceAggrId |
A numeric aggregateID that uniquely identifies the source aggregate instance in the operation. |
sourceIndex |
Specifies the index of the first element to copy from the source aggregate. The index range is: |
targetAggrId |
A numeric aggregateID that uniquely identifies the target aggregate instance in the operation. |
targetIndex |
Specifies the lower index in the target aggregate to receive the first element from the source aggregate. |
maxElementsToCopy |
Specifies the maximum number of elements to copy. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0: Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiAggr sourceAggrId, targetAggrId;
...
if (rstat = edmiCopyAggr (sourceAggrId,
0,
targetAggrId,
0,
0)) {
/* Error in operation */
printf("\nError in edmiCopyAggr: %s",
edmiGetErrorText(rstat));
goto error;
}
...