Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
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.
The aggregateID is returned when the aggregate is created or it can be retrieved by an EDMinterface get operation.

sourceIndex

Specifies the index of the first element to copy from the source aggregate. The index range is:
For ARRAY: lowerBound <= sourceIndex <= upperBound
For all other aggregates:
0<= sourceIndex < members in aggregate 

targetAggrId

A numeric aggregateID that uniquely identifies the target aggregate instance in the operation.
The aggregateID is returned when the aggregate is created or it can be retrieved by an EDMinterface get operation..

targetIndex

Specifies the lower index in the target aggregate to receive the first element from the source aggregate.
This argument is only valid for ARRAY aggregates.
The edmiCopyAggr operation works as an append operation on LIST aggregates.

maxElementsToCopy

Specifies the maximum number of elements to copy.
When <maxElementsToCopy> = 0 then all elements in the source aggregate with an index >= <sourceIndex> will be copied.

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; 
}
...

  • No labels