/[eiffelstudio]/trunk/eweasel/tests/incr071/mismatch_information.e
ViewVC logotype

Contents of /trunk/eweasel/tests/incr071/mismatch_information.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years ago) by manus
File size: 3396 byte(s)
Moved from trunk/Src/eweasel to trunk/eweasel so that a simple checkout of the source code is not penalized by the lenghty process of checking out all the tests of eweasel.
1 indexing
2
3 description: "Original values of the attributes of a mismatched object."
4 instructions: "[
5 This object will contain the original values of the attributes
6 of a retrieved object for which a mismatched was detected at
7 retrieval time. The value are indexed by the name of the attribute
8 in the stored object. One extra entry is provided to contain the
9 original name of the class in the storing system, indexed by the
10 string 'class'. This allows `correct_mismatch' to determine the
11 original name of its generating class in case class-name
12 translation is in effect.
13 ]"
14 date: "$Date$"
15 revision: "$Revision$"
16 status: "See notice at end of class"
17
18 class MISMATCH_INFORMATION
19
20 inherit
21
22 HASH_TABLE [ANY, STRING]
23 redefine
24 default_create,
25 out
26 end
27
28 creation
29
30 default_create
31
32 feature -- Initialization
33
34 default_create is
35 -- Make container with default size
36 do
37 make (5)
38 end
39
40 set_callback_pointers is
41 -- Sets call-back pointers in the run-time
42 once
43 set_mismatch_information_access (Current, $clear_all, $internal_put)
44 end
45
46 feature -- Access
47
48 class_name: STRING is
49 -- Name of generating class which held attribute values
50 do
51 check has_class_entry: has (Class_key) end
52 Result ?= item (Class_key)
53 ensure
54 result_exists: Result /= Void
55 end
56
57 feature -- Output
58
59 out: STRING is
60 -- Printable representation of attributes values
61 do
62 from
63 create Result.make (20 + class_name.count + 40 * count)
64 Result.append ("Attributes of original class ")
65 Result.append (class_name)
66 Result.append (": ")
67 Result.append_integer (count - 1)
68 Result.append (" item")
69 if count - 1 /= 1 then Result.append_character ('s') end
70 Result.append_character ('%N')
71 start
72 until
73 after
74 loop
75 if not key_for_iteration.is_equal (Class_key) then
76 Result.append (" ")
77 Result.append (key_for_iteration)
78 Result.append (": ")
79 if item_for_iteration = Void then
80 Result.append ("Void")
81 else
82 Result.append (item_for_iteration.out)
83 end
84 Result.append_character ('%N')
85 end
86 forth
87 end
88 end
89
90 feature {NONE} -- Implementation
91
92 Class_key: STRING is "class"
93
94 internal_put (value: ANY; ckey: POINTER) is
95 -- Allows run-time to insert items into table
96 local
97 key: STRING
98 do
99 create key.make_from_c (ckey)
100 put (value, key)
101 end
102
103 feature {NONE} -- Externals
104
105 set_mismatch_information_access (obj: ANY; init, add: POINTER) is
106 external
107 "C"
108 end
109
110 indexing
111
112 library: "[
113 EiffelBase: Library of reusable components for Eiffel.
114 ]"
115
116 status: "[
117 --| Copyright (c) 1993-2006 University of Southern California and contributors.
118 For ISE customers the original versions are an ISE product
119 covered by the ISE Eiffel license and support agreements.
120 ]"
121
122 license: "[
123 EiffelBase may now be used by anyone as FREE SOFTWARE to
124 develop any product, public-domain or commercial, without
125 payment to ISE, under the terms of the ISE Free Eiffel Library
126 License (IFELL) at http://eiffel.com/products/base/license.html.
127 ]"
128
129 source: "[
130 Interactive Software Engineering Inc.
131 ISE Building
132 360 Storke Road, Goleta, CA 93117 USA
133 Telephone 805-685-1006, Fax 805-685-6869
134 Electronic mail <info@eiffel.com>
135 Customer support http://support.eiffel.com
136 ]"
137
138 info: "[
139 For latest info see award-winning pages: http://eiffel.com
140 ]"
141
142
143 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23