1 -- File: SelectRootComps.cdl
2 -- Created: Wed Dec 2 14:50:51 1992
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1992
8 class SelectRootComps from IFSelect inherits SelectExtract
10 ---Purpose : A SelectRootComps sorts the Entities which are part of Strong
11 -- Componants, local roots of a set of Entities : they can be
12 -- Single Componants (containing one Entity) or Cycles
13 -- This class gives a more secure result than SelectRoots (which
14 -- considers only Single Componants) but is longer to work : it
15 -- can be used when there can be or there are cycles in a Model
16 -- For each cycle, one Entity is given arbitrarily
17 -- Reject works as for SelectRoots : Strong Componants defined in
18 -- the input list which are not local roots are given
20 uses AsciiString from TCollection, InterfaceModel, EntityIterator, Graph
24 Create returns mutable SelectRootComps;
25 ---Purpose : Creates a SelectRootComps
27 RootResult (me; G : Graph) returns EntityIterator is redefined;
28 ---Purpose : Returns the list of local root strong componants, by one
29 -- Entity par componant. It is redefined for a purpose of
30 -- effeciency : calling a Sort routine for each Entity would
31 -- cost more ressource than to work in once using a Map
32 -- RootResult takes in account the Direct status
34 HasUniqueResult (me) returns Boolean is redefined protected;
35 ---Purpose : Returns True, RootResult assuring uniqueness
37 Sort (me; rank : Integer; ent : Transient; model : InterfaceModel)
39 ---Purpose : Returns always True, because RootResult has done work
41 ExtractLabel (me) returns AsciiString from TCollection;
42 ---Purpose : Returns a text defining the criterium : "Local Root Componants"