7fd59977 |
1 | -- File: IFSelect_SelectExplore.cdl |
2 | -- Created: Wed Sep 25 09:28:48 1996 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@fidox.paris1.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | |
8 | deferred class SelectExplore from IFSelect inherits SelectDeduct |
9 | |
10 | ---Purpose : A SelectExplore determines from an input list of Entities, |
11 | -- a list obtained by a way of exploration. This implies the |
12 | -- possibility of recursive exploration : the output list is |
13 | -- itself reused as input, etc... |
14 | -- Examples : Shared Entities, can be considered at one level |
15 | -- (immediate shared) or more, or max level |
16 | -- |
17 | -- Then, for each input entity, if it is not rejected, it can be |
18 | -- either taken itself, or explored : it then produces a list. |
19 | -- According to a level, either the produced lists or taken |
20 | -- entities give the result (level one), or lists are themselves |
21 | -- considered and for each item, is it taken or explored. |
22 | -- |
23 | -- Remark that rejection is just a safety : normally, an input |
24 | -- entity is, either taken itself, or explored |
25 | -- A maximum level can be specified. Else, the process continues |
26 | -- until all entities have been either taken or rejected |
27 | |
28 | uses AsciiString from TCollection, InterfaceModel, EntityIterator, Graph |
29 | |
30 | is |
31 | |
32 | Initialize (level : Integer); |
33 | ---Purpose : Initializes a SelectExplore : the level must be specified on |
34 | -- starting. 0 means all levels, 1 means level one only, etc... |
35 | |
36 | Level (me) returns Integer; |
37 | ---Purpose : Returns the required exploring level |
38 | |
39 | RootResult (me; G : Graph) returns EntityIterator; |
40 | ---Purpose : Returns the list of selected entities. Works by calling the |
41 | -- method Explore on each input entity : it can be rejected, |
42 | -- taken for output, or to explore. If the maximum level has not |
43 | -- yet been attained, or if no max level is specified, entities |
44 | -- to be explored are themselves used as if they were input |
45 | |
46 | Explore (me; level : Integer; ent : Transient; G : Graph; |
47 | explored : in out EntityIterator) |
48 | returns Boolean is deferred; |
49 | ---Purpose : Analyses and, if required, Explores an entity, as follows : |
50 | -- The explored list starts as empty, it has to be filled by this |
51 | -- method. |
52 | -- If it returns False, <ent> is rejected for result (this is to |
53 | -- be used only as safety) |
54 | -- If it returns True and <explored> remains empty, <ent> is |
55 | -- taken itself for result, not explored |
56 | -- If it returns True and <explored> is not empty, the content |
57 | -- of this list is considered : |
58 | -- If maximum level is attained, it is taken for result |
59 | -- Else (or no max), each of its entity will be itself explored |
60 | |
61 | Label (me) returns AsciiString from TCollection; |
62 | ---Purpose : Returns a text saying "(Recursive)" or "(Level nn)" plus |
63 | -- specific criterium returned by ExploreLabel (see below) |
64 | |
65 | ExploreLabel (me) returns AsciiString from TCollection is deferred; |
66 | ---Purpose : Returns a text defining the way of exploration |
67 | |
68 | fields |
69 | |
70 | thelevel : Integer; |
71 | |
72 | end SelectExplore; |