blob: f540a5962ee4844fed7d6a7c2f2557b4b5972a69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-- File: MoniTool_Element.cdl
-- Created: Fri Nov 4 10:59:26 1994
-- Author: Christian CAILLET
-- <cky@anion>
---Copyright: Matra Datavision 1994
deferred class Element from MoniTool inherits TShared
---Purpose : a Element allows to map any kind of object as a Key for a Map.
-- This works by defining, for a Hash Code, that of the real Key,
-- not of the Element which acts only as an intermediate.
-- When a Map asks for the HashCode of a Element, this one returns
-- the code it has determined at creation time
uses CString, Type, Transient, AttrList from MoniTool
is
SetHashCode (me : mutable; code : Integer) is static protected;
---Purpose : Stores the HashCode which corresponds to the Value given to
-- create the Mapper
GetHashCode (me) returns Integer is static;
---Purpose : Returns the HashCode which has been stored by SetHashCode
-- (remark that HashCode could be deferred then be defined by
-- sub-classes, the result is the same)
Equates (me; other : Element) returns Boolean is deferred;
---Purpose : Specific testof equallity : to be defined by each sub-class,
-- must be False if Elements have not the same true Type, else
-- their contents must be compared
ValueType (me) returns Type is virtual;
---Purpose : Returns the Type of the Value. By default, returns the
-- DynamicType of <me>, but can be redefined
ValueTypeName (me) returns CString is virtual;
---Purpose : Returns the name of the Type of the Value. Default is name
-- of ValueType, unless it is for a non-handled object
-- -- Attributes
ListAttr (me) returns AttrList;
---Purpose : Returns (readonly) the Attribute List
---C++ : return const &
ChangeAttr (me : mutable) returns AttrList;
---Purpose : Returns (modifiable) the Attribute List
---C++ : return &
fields
thecode : Integer;
theattrib : AttrList;
end Element;
|