indexing
	description: "ECOM_HRESULT"
	status: "See notice at end of class"
	date: "$Date$"
	revision: "$Revision$"

class interface
	ECOM_HRESULT

create 

	make
			-- Set 'severity_bit' to 1.

	make_from_integer (an_integer: INTEGER)
			-- Initialize hresult according to 'an_integer'.

feature -- Initialization

	make
			-- Set 'severity_bit' to 1.

	make_from_integer (an_integer: INTEGER)
			-- Initialize hresult according to 'an_integer'.
	
feature -- Access

	error_code: INTEGER
			-- Error code

	facility_code: INTEGER
			-- Facility code

	item: INTEGER
			-- HRESULT

	message: STRING
			-- Human-readable string.
		ensure
			non_void_message: Result /= void

	severity_bit: INTEGER
			-- Severity bit
	
feature -- Status report

	succeeded: BOOLEAN
			-- Does hresult correspond to success?
	
feature -- Element change

	set_error_code (a_code: like error_code)
			-- Set error code
		require
			valid_error_code: a_code >= 0
		ensure
			facility_code_set: error_code = a_code

	set_facility_code (a_code: like facility_code)
			-- Set facility code
		require
			valid_facility_code: a_code >= 0
		ensure
			facility_code_set: facility_code = a_code

	set_failed
			-- Set severity bit to indicate failure

	set_item (an_item: like item)
			-- Set value of item to 'an_item'
		ensure
			item_set: item = an_item

	set_succeeded
			-- Set severity bit to indicate succeeded
	
invariant

	valid_severity_value: severity_bit = 0 or severity_bit = 1
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class ECOM_HRESULT