/[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 30264 - (hide 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 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     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 manus 26913 class_id: INTEGER
33 manus 9658 -- 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 manus 11302 Result := actual_type.is_basic
40 manus 9658 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 manus 11302 Result := actual_type /= Void and then
53     actual_type.has_associated_class
54 manus 9658 end
55    
56 manus 11302 associated_class: CLASS_C is
57 manus 9658 -- Associated class
58     do
59 manus 11302 Result := actual_type.associated_class
60 manus 9658 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 manus 26913 instantiation_in (type: TYPE_A written_id: INTEGER): like Current is
77 manus 9658 -- 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 manus 12165 Result := actual_type.internal_conform_to (other.actual_type, in_generics)
95 manus 9658 end
96    
97     type_i: TYPE_I is
98     -- Reduced type of `actual_type'
99 manus 10886 local
100     cl_type : CL_TYPE_I
101 manus 9658 do
102     Result := actual_type.type_i
103 manus 10886 cl_type ?= Result
104    
105     if cl_type /= Void then
106 manus 30264 -- Remember that it's an anchored type
107 manus 10886 cl_type.set_cr_info (create_info)
108     end
109 manus 9658 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