/[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 44434 - (hide annotations)
Wed Jul 21 04:49:24 2004 UTC (15 years, 6 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/API/evaluated_type/like_type_a.e
File size: 3082 byte(s)
Removed support for `reference' types:
  - removed `reference_actual_type'.
  - added `is_conformant_to' which enables us to find if one type inherits
    from another one in a conformant way. It is needed for checking constraint
	genericity when actual generic is an expanded and constraint is a reference.
	Before we were using `reference_actual_type.conform_to' but since we
	removed it, we need something else and this is `is_conformant_to'.

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