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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42626 - (hide annotations)
Fri Apr 9 02:52:52 2004 UTC (15 years, 9 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3294 byte(s)
Implemented constraints that are either reference or expanded.
Added proper redefinition of newly introduced `is_reference' in TYPE_A.
Fixed missing redefinition of `is_expanded' from TYPE_A.

1 manus 9658 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 manus 41738 actual_type, has_like, is_like, is_external,
15 manus 9658 is_basic, instantiated_in, meta_type,
16 manus 42626 has_associated_class, reference_actual_type,
17     is_reference, is_expanded
18 manus 9658 end
19    
20     SHARED_LIKE_CONTROLER
21    
22     feature -- Properties
23    
24     actual_type: TYPE_A
25     -- Actual type of the anchored type in a given class
26 manus 41738
27     reference_actual_type: TYPE_A is
28     -- `actual_type' if not `is_expanded'.
29     -- Otherwise associated reference of `actual type'
30     do
31     Result := actual_type.reference_actual_type
32     end
33 manus 9658
34     is_like: BOOLEAN is True
35     -- Is the type anchored one ?
36    
37     has_like: BOOLEAN is True
38     -- Does the type have anchored type in its definition ?
39    
40 manus 26913 class_id: INTEGER
41 manus 9658 -- Class ID of the class where the anchor is referenced
42    
43     is_basic: BOOLEAN is
44     -- Is the current actual type a basic one ?
45     do
46 manus 11302 Result := actual_type.is_basic
47 manus 9658 end
48 manus 41738
49     is_external: BOOLEAN is
50     -- Is current type based on an external class?
51     do
52     Result := actual_type.is_external
53     end
54 manus 42626
55     is_reference: BOOLEAN is
56     -- Is current actual type a reference one?
57     do
58     Result := actual_type.is_reference
59     end
60 manus 9658
61 manus 42626 is_expanded: BOOLEAN is
62     -- Is current actual type an expanded one?
63     do
64     Result := actual_type.is_expanded
65     end
66    
67 manus 9658 feature -- Access
68    
69     same_as (other: TYPE_A): BOOLEAN is
70     -- Is the current type the same as `other' ?
71     deferred
72     end
73    
74     has_associated_class: BOOLEAN is
75     -- Does Current have an associated class?
76     do
77 manus 11302 Result := actual_type /= Void and then
78     actual_type.has_associated_class
79 manus 9658 end
80    
81 manus 11302 associated_class: CLASS_C is
82 manus 9658 -- Associated class
83     do
84 manus 11302 Result := actual_type.associated_class
85 manus 9658 end
86    
87     feature -- Primitives
88    
89     set_actual_type (a: TYPE_A) is
90     -- Assign `a' to `actual_type'.
91     do
92     actual_type := a
93     end
94    
95     solved_type (feat_table: FEATURE_TABLE f: FEATURE_I): like Current is
96     -- Calculated type in function of the feature `f' which has
97     -- the type Current and the feautre table `feat_table
98     deferred
99     end
100    
101 manus 26913 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
102 manus 9658 -- Instantiation of Current in the context of `class_type',
103     -- assuming that Current is written in class of id `written_id'.
104     deferred
105     end
106    
107     instantiated_in (class_type: CL_TYPE_A): like Current is
108     -- Instantiation of Current in the context of `class_type'
109     -- assuming that Current is written in the associated class
110     -- of `class_type'.
111     do
112 manus 40762 Result := twin
113 manus 9658 Result.set_actual_type (actual_type.instantiated_in (class_type))
114     end
115    
116 manus 41738 conform_to (other: TYPE_A): BOOLEAN is
117     -- Does `actual_type' conform to `other'?
118 manus 9658 do
119 manus 41738 Result := actual_type.conform_to (other.actual_type)
120 manus 9658 end
121    
122     type_i: TYPE_I is
123     -- Reduced type of `actual_type'
124 manus 10886 local
125     cl_type : CL_TYPE_I
126 manus 9658 do
127     Result := actual_type.type_i
128 manus 10886 cl_type ?= Result
129    
130 manus 41738 if cl_type /= Void and then not cl_type.is_expanded then
131     -- Remember that it's an anchored type, not needed
132     -- when handling expanded types.
133 manus 10886 cl_type.set_cr_info (create_info)
134     end
135 manus 9658 end
136    
137     meta_type: TYPE_I is
138     -- C type for `actual_type'
139     do
140     Result := actual_type.meta_type
141     end
142    
143     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