FUNCTION get_template_arrangement
(input : SET [0:?] OF template_location_in_structured_template) : template_arrangement;
LOCAL tlist : SET OF Template_location_in_structured_template := (QUERY(inx <* input | ('LAYERED_INTERCONNECT_COMPLEX_TEMPLATE_XIM.MULTI_STRATUM_STRUCTURED_TEMPLATE_ARMX' IN TYPEOF(inx.template)))); pabt : BAG OF STRING := []; pabb : BAG OF STRING := []; pabsymmetrical : BAG OF STRING := []; pabswappable : BAG OF STRING := []; END_LOCAL;
REPEAT i := 1 TO SIZEOF(tlist) BY 1; IF (tlist[i].template\Multi_stratum_structured_template_armx.location = template_arrangement.top) THEN pabt := pabt + 'top'; END_IF; IF (tlist[i].template\Multi_stratum_structured_template_armx.location = template_arrangement.bottom) THEN pabb := pabb + 'bottom'; END_IF; IF (tlist[i].template\Multi_stratum_structured_template_armx.location = template_arrangement.symmetrical) THEN pabsymmetrical := pabsymmetrical + 'symmetrical'; END_IF; IF (tlist[i].template\Multi_stratum_structured_template_armx.location = template_arrangement.swappable) THEN pabswappable := pabswappable + 'swappable';
END_IF; END_REPEAT; IF ((SIZEOF(pabt) > 0) AND (SIZEOF(pabb) = 0)) THEN RETURN(template_arrangement.top); END_IF; IF ((SIZEOF(pabb) > 0) AND (SIZEOF(pabt) = 0)) THEN RETURN(template_arrangement.bottom); END_IF; IF ((SIZEOF(pabb) = 0) AND (SIZEOF(pabt) = 0) AND (SIZEOF(pabsymmetrical) > 0)) THEN RETURN(template_arrangement.symmetrical); END_IF; IF ((SIZEOF(pabb) = 0) AND (SIZEOF(pabt) = 0) AND (SIZEOF(pabsymmetrical) = 0) AND (SIZEOF(pabswappable) > 0)) THEN RETURN(template_arrangement.swappable); END_IF; RETURN(?); END_FUNCTION; -- get_template_arrangement
|