indexing description: "Run time value representing of reference object."; date: "$Date$"; revision: "$Revision $" class REFERENCE_VALUE inherit ABSTRACT_REFERENCE_VALUE redefine set_hector_addr end OBJECT_ADDR export {NONE} all undefine is_equal end; CHARACTER_ROUTINES export {NONE} all undefine is_equal end; SHARED_DEBUG export {NONE} all undefine is_equal end; create {DEBUG_VALUE_EXPORTER} make, make_attribute feature {NONE} -- Initialization make (reference: POINTER; id: like dynamic_type_id) is -- Set `address' to `reference' address -- and `dynamic_type_id' to `id'. local void_pointer: POINTER do set_default_name; if reference /= Void_pointer then address := reference.out is_null := (address = Void) dynamic_type_id := id; end; end; make_attribute (attr_name: like name; a_class: like e_class; type: like dynamic_type_id; addr: like address) is require not_attr_name_void: attr_name /= Void; do name := attr_name; if a_class /= Void then e_class := a_class; is_attribute := True; end; dynamic_type_id := type; address := addr is_null := (address = Void) end; --feature -- Properties -- -- address: STRING; -- -- Address of referenced object (Void if no object) -- -- string_value: STRING; -- -- Value if the reference object is a STRING feature -- Access dynamic_class: CLASS_C is do Result := private_dynamic_class if Result = Void then if Eiffel_system.valid_dynamic_id (dynamic_type_id) then --| Extra safe test. The dynamic type should be known --| from the system, but somehow Dino managed to crash --| ebench here. This is very weird!!! Result := Eiffel_system.class_of_dynamic_id (dynamic_type_id) private_dynamic_class := Result end end end dump_value: DUMP_VALUE is -- Dump_value corresponding to `Current'. do debug ("debug_recv") print ("Dumping value ") print (address) print (dynamic_class /= Void) if dynamic_class /= Void then print (" ") print (dynamic_class.name_in_upper) end print ("%N") end create Result.make_object (address, dynamic_class) end feature {NONE} -- Output type_and_value: STRING is -- Return a string representing `Current'. local ec: CLASS_C; do if address = Void then Result := NONE_representation else ec := dynamic_class; if ec /= Void then create Result.make (60) Result.append (ec.name_in_upper) Result.append (Left_square_bracket) Result.append (address) Result.append (Right_square_bracket) else create Result.make (20) Result.append (Any_class.name_in_upper) Result.append (Is_unknown) end end end feature -- Output children: LIST [ABSTRACT_DEBUG_VALUE] is -- List of all sub-items of `Current'. -- May be void if there are no children. -- Generated on demand. local obj: DEBUGGED_OBJECT do debug ("debug_recv") print ("REFERENCE_VALUE.children%N") end create obj.make (address, min_slice, max_slice) Result := obj.attributes end feature {NONE} -- Implementation set_hector_addr is -- Convert the physical addresses received from the application -- to hector addresses. (should be called only once just after -- all the information has been received from the application.) -- If referenced object is a STRING, get its value. do if address /= Void then address := hector_addr (address); end is_null := (address = Void) end; feature {NONE} -- Property min_slice: INTEGER is -- From which attribute number should special objects be displayed? do Result := min_slice_ref.item end max_slice: INTEGER is -- Up to which attribute number should special objects be displayed? do Result := max_slice_ref.item end dynamic_type_id: INTEGER; -- Dynamic type id of return type private_dynamic_class: CLASS_C -- Saved class end -- class REFERENCE_VALUE