This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

EiffelBase class
(HTML page generated by ISE Eiffel 4.2)

Eiffel Class
indexing
	description: "References to objects containing a reference to objects meant to be exchanged with non-Eiffel software.";
	status: "See notice at end of class";
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

class POINTER_REF

inherit
	HASHABLE
		redefine
			out, is_hashable
		end

feature -- Access

	item: POINTER;
			-- Pointer value

	hash_code: INTEGER is
			-- Hash code value
		do
			Result := (c_hashcode (item)).abs
		end;

feature -- Element change

	set_item (p: POINTER) is
			-- Make p the item value.
		do
			item := p
		end;

feature -- Status report

	is_hashable: BOOLEAN is
			-- May current object be hashed?
			-- (True if it is not its type's default.)
		do
			Result := item /= default_pointer
		end;

feature -- Output

	out: STRING is
			-- Printable representation of pointer value
		do
			Result := c_outp (item)
		end;

feature {NONE} -- Implementation

	c_outp (p: POINTER): STRING is
			-- Printable representation of pointer value
		external
			"C | %"eif_out.h%""
		end;

	c_hashcode (p: POINTER): INTEGER is
			-- Hash code value of p
		external
			"C | %"eif_misc.h%""
		alias
			"conv_pi"
		end;

end -- class POINTER_REF