/[eiffelstudio]/branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e
ViewVC logotype

Contents of /branches/CAT_mono/Src/Eiffel/API/evaluated_type/like_type_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30264 - (show annotations)
Mon Jan 21 01:39:29 2002 UTC (18 years ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 2649 byte(s)
Removed `rout_id' as it is only used in the LIKE_FEATURE descendant and therefore
we save a small amount of space.

1 indexing
2 description: "Representation of an anchored type"
3 date: "$Date$"
4 revision: "$Revision$"
5
6 deferred class
7 LIKE_TYPE_A
8
9 inherit
10 TYPE_A
11 undefine
12 same_as, solved_type, instantiation_in
13 redefine
14 actual_type, has_like, is_like,
15 is_basic, instantiated_in, meta_type,
16 has_associated_class
17 end
18
19 SHARED_LIKE_CONTROLER
20
21 feature -- Properties
22
23 actual_type: TYPE_A
24 -- Actual type of the anchored type in a given class
25
26 is_like: BOOLEAN is True
27 -- Is the type anchored one ?
28
29 has_like: BOOLEAN is True
30 -- Does the type have anchored type in its definition ?
31
32 class_id: INTEGER
33 -- Class ID of the class where the anchor is referenced
34
35
36 is_basic: BOOLEAN is
37 -- Is the current actual type a basic one ?
38 do
39 Result := actual_type.is_basic
40 end
41
42 feature -- Access
43
44 same_as (other: TYPE_A): BOOLEAN is
45 -- Is the current type the same as `other' ?
46 deferred
47 end
48
49 has_associated_class: BOOLEAN is
50 -- Does Current have an associated class?
51 do
52 Result := actual_type /= Void and then
53 actual_type.has_associated_class
54 end
55
56 associated_class: CLASS_C is
57 -- Associated class
58 do
59 Result := actual_type.associated_class
60 end
61
62 feature -- Primitives
63
64 set_actual_type (a: TYPE_A) is
65 -- Assign `a' to `actual_type'.
66 do
67 actual_type := a
68 end
69
70 solved_type (feat_table: FEATURE_TABLE f: FEATURE_I): like Current is
71 -- Calculated type in function of the feature `f' which has
72 -- the type Current and the feautre table `feat_table
73 deferred
74 end
75
76 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
77 -- Instantiation of Current in the context of `class_type',
78 -- assuming that Current is written in class of id `written_id'.
79 deferred
80 end
81
82 instantiated_in (class_type: CL_TYPE_A): like Current is
83 -- Instantiation of Current in the context of `class_type'
84 -- assuming that Current is written in the associated class
85 -- of `class_type'.
86 do
87 Result := clone (Current)
88 Result.set_actual_type (actual_type.instantiated_in (class_type))
89 end
90
91 internal_conform_to (other: TYPE_A in_generics: BOOLEAN): BOOLEAN is
92 -- Does `other' conform to `actual_type' ?
93 do
94 Result := actual_type.internal_conform_to (other.actual_type, in_generics)
95 end
96
97 type_i: TYPE_I is
98 -- Reduced type of `actual_type'
99 local
100 cl_type : CL_TYPE_I
101 do
102 Result := actual_type.type_i
103 cl_type ?= Result
104
105 if cl_type /= Void then
106 -- Remember that it's an anchored type
107 cl_type.set_cr_info (create_info)
108 end
109 end
110
111 meta_type: TYPE_I is
112 -- C type for `actual_type'
113 do
114 Result := actual_type.meta_type
115 end
116
117 end -- class LIKE_TYPE_A

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23