Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeConfluence
FUNCTION xpfAddToAggrIfNotInAggr (aggr         :   AGGREGATE OF GENERIC;   
                                  elementelementValue     :   GENERIC)
                                  inserted     :   BOOLEAN;
                

Use this function to add an instance to aggregate (or append) the given 'elementValue' to the specified aggregate 'aggr' if the aggregate does not have an element with the same instance.

xpfAddToAggrIfNotInAggr(aggr, element) for instances and aggregate of instances performs the same as the following statements:

IF NOT (inst IN aggr) THEN aggr ++ inst; END_IF;value.


Arguments

...

TypeNameComment
AGGREGATE OF GENERICaggrId

Any aggregate

of some instances, that requires to be unique
GENERICinstanceIdinstance id of new element 

type except ARRAY.

The aggregate elements data type must be compatible with the data type of the argument 'elementValue'.

If the aggregate is a LIST, the actual 'elementValue' will be appended to the list.

GENERICelementValue

The value to add to the aggregate if the actual value does not exist in the aggregate.

The 'elementValue' can be any of the following data types: sdaiINSTANCE, sdaiINTEGER, sdaiREAL, sdaiSTRING
and "typed value" of sdaiINTEGER, sdaiREAL, sdaiSTRING


Return Value

...

 

TypeNameComment
BOOLEANinserted TRUE if the element was added

...