1 -- File: IFSelect_GeneralModifier.cdl
2 -- Created: Tue Oct 19 17:22:55 1993
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1993
8 deferred class GeneralModifier from IFSelect inherits TShared
10 ---Purpose : This class gives a frame for Actions which modify the effect
11 -- of a Dispatch, i.e. :
12 -- By Selections and Dispatches, an original Model can be
13 -- splitted into one or more "target" Models : these Models
14 -- contain Entities copied from the original one (that is, a
15 -- part of it). Basically, these dispatched Entities are copied
16 -- as identical to their original counterparts. Also the copied
17 -- Models reproduce the Header of the original one.
19 -- Modifiers allow to change this copied content : this is the
20 -- way to be used for any kind of alterations, adaptations ...
21 -- They are exploited by a ModelCopier, which firstly performs
22 -- the copy operation described by Dispatches, then invokes the
23 -- Modifiers to work on the result.
25 -- Each GeneralModifier can be attached to :
26 -- - all the Models produced
27 -- - a Dispatch (it will be applied to all the Models obtained
28 -- from this Dispatch) designated by its Ident in a ShareOut
29 -- - in addition, to a Selection (facultative) : this adds a
30 -- criterium, the Modifier is invoked on a produced Model only
31 -- if this Model contains an Entity copied from one of the
32 -- Entities designated by this Selection.
33 -- (for special Modifiers from IFAdapt, while they must work on
34 -- definite Entities, this Selection is mandatory to run)
36 -- Remark : this class has no action attached, it only provides
37 -- a frame to work on criteria. Then, sub-classes will define
38 -- their kind of action, which can be applied at a precise step
39 -- of the production of a File : see Modifier, and in the
40 -- package IFAdapt, EntityModifier and EntityCopier
43 uses AsciiString from TCollection, Selection, Dispatch
47 Initialize (maychangegraph : Boolean);
48 ---Purpose : Sets the Modifier criteria to default Values
49 -- (i.e. "always applies")
50 -- <maychangegraph> must be provided at creation time, to :
51 -- - False if this GeneralModifier surely lets the graph of
52 -- dependencies unchanged (NO edition of any reference, BUT
53 -- also NO entity added or replaced or removed)
54 -- - True if there is a possibility of changing the graph of
55 -- dependencies when this modifier is applied
57 MayChangeGraph (me) returns Boolean;
58 ---Purpose : Returns True if this modifier may change the graph of
59 -- dependences (aknowledged at creation time)
61 SetDispatch (me : mutable; disp : any Dispatch);
62 ---Purpose : Attaches to a Dispatch. If <disp> is Null, Resets it
63 -- (to apply the Modifier on every Dispatch)
65 Dispatch (me) returns any Dispatch;
66 ---Purpose : Returns the Dispatch to be matched, Null if not set
68 Applies (me; disp : Dispatch) returns Boolean;
69 ---Purpose : Returns True if a Model obtained from the Dispatch <disp>
70 -- is to be treated (apart from the Selection criterium)
71 -- If Dispatch(me) is Null, returns True. Else, checks <disp>
74 SetSelection (me : mutable; sel : mutable Selection);
75 ---Purpose : Sets a Selection : a Model is treated if it contains one or
76 -- more Entities designated by the Selection
78 ResetSelection (me : mutable);
79 ---Purpose : Resets the Selection : this criterium is not longer active
81 HasSelection (me) returns Boolean;
82 ---Purpose : Returns True if a Selection is set as an additionnal criterium
84 Selection (me) returns mutable Selection;
85 ---Purpose : Returns the Selection, or a Null Handle if not set
88 Label (me) returns AsciiString from TCollection is deferred;
89 ---Purpose : Returns a short text which defines the operation performed