indexing
	description: "[
		Access to internal object properties.
		This class may be used as ancestor by classes needing its
		facilities.
	]"
	status: "See notice at end of class"
	date: "$Date$"
	revision: "$Revision$"

class interface
	INTERNAL

feature -- Access

	Bit_type: INTEGER is 8

	boolean_field (i: INTEGER; object: ANY): BOOLEAN
			-- Boolean value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			boolean_field: field_type (i, object) = boolean_type

	Boolean_type: INTEGER is 3

	character_field (i: INTEGER; object: ANY): CHARACTER
			-- Character value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_field: field_type (i, object) = character_type

	Character_type: INTEGER is 2

	class_name (object: ANY): STRING
			-- Name of the class associated with object
		require
			object_not_void: object /= void

	double_field (i: INTEGER; object: ANY): DOUBLE
			-- Double precision value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			double_field: field_type (i, object) = double_type

	Double_type: INTEGER is 6

	dynamic_type (object: ANY): INTEGER
			-- Dynamic type of object
		require
			object_not_void: object /= void

	expanded_field_type (i: INTEGER; object: ANY): STRING
			-- Class name associated with the i-th
			-- expanded field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			is_expanded: field_type (i, object) = expanded_type
		ensure
			result_exists: Result /= void

	Expanded_type: INTEGER is 7

	field (i: INTEGER; object: ANY): ANY
			-- Object attached to the i-th field of object
			-- (directly or through a reference)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			not_special: not is_special (object)

	field_name (i: INTEGER; object: ANY): STRING
			-- Name of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			not_special: not is_special (object)
		ensure
			result_exists: Result /= void

	field_name_of_type (i: INTEGER; type_id: INTEGER): STRING
			-- Name of i-th field of dynamic type type_id.
		require
			index_large_enough: i >= 1
			index_small_enought: i <= field_count_of_type (type_id)

	field_offset (i: INTEGER; object: ANY): INTEGER
			-- Offset of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			not_special: not is_special (object)

	field_type (i: INTEGER; object: ANY): INTEGER
			-- Type of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)

	field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER
			-- Type of i-th field of dynamic type type_id
		require
			index_large_enough: i >= 1
			index_small_enough: i <= field_count_of_type (type_id)

	generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
			-- Dynamic type of generic parameter of object at
			-- position i.

	Integer_16_type: INTEGER is 10

	Integer_32_type: INTEGER is 4

	Integer_64_type: INTEGER is 11

	Integer_8_type: INTEGER is 9

	integer_field (i: INTEGER; object: ANY): INTEGER
			-- Integer value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_field: field_type (i, object) = integer_type

	Integer_type: INTEGER is 4

	pointer_field (i: INTEGER; object: ANY): POINTER
			-- Pointer value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			pointer_field: field_type (i, object) = pointer_type

	Pointer_type: INTEGER is 0

	real_field (i: INTEGER; object: ANY): REAL
			-- Real value of i-th field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_field: field_type (i, object) = real_type

	Real_type: INTEGER is 5

	Reference_type: INTEGER is 1

	Wide_character_type: INTEGER is 12

feature -- Measurement

	bit_size (i: INTEGER; object: ANY): INTEGER
			-- Size (in bit) of the i-th bit field of object
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			is_bit: field_type (i, object) = bit_type
		ensure
			positive_result: Result > 0

	field_count (object: ANY): INTEGER
			-- Number of logical fields in object
		require
			object_not_void: object /= void

	field_count_of_type (type_id: INTEGER): INTEGER
			-- Number of logical fields in dynamic type type_id.

	physical_size (object: ANY): INTEGER
			-- Space occupied by object in bytes
		require
			object_not_void: object /= void

feature -- Status report

	is_special (object: ANY): BOOLEAN
			-- Is object a special object?
			-- It only recognized a special object
			-- initialized within a TO_SPECIAL object.
		require
			object_not_void: object /= void

feature -- Element change

	set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			boolean_field: field_type (i, object) = boolean_type

	set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
			-- Set character value of i-th field of object to value
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_field: field_type (i, object) = character_type

	set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			double_field: field_type (i, object) = double_type

	set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_field: field_type (i, object) = integer_type

	set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			pointer_field: field_type (i, object) = pointer_type

	set_real_field (i: INTEGER; object: ANY; value: REAL)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_field: field_type (i, object) = real_type

	set_reference_field (i: INTEGER; object: ANY; value: ANY)
		require
			object_not_void: object /= void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			reference_field: field_type (i, object) = reference_type

feature -- Conformance

	is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
			-- Is object an instance of type type_id?
		require
			object_not_void: object /= void

	type_conforms_to (type1, type2: INTEGER): BOOLEAN
			-- Does type1 conform to type2?

feature -- Creation

	dynamic_type_from_string (class_type: STRING): INTEGER
			-- Dynamic type corresponding to class_type.
			-- If no dynamic type available, returns -1.
		require
			class_type_not_void: class_type /= void
		ensure
			valid_result: Result = - 1 or else Result >= 0

	new_instance_of (type_id: INTEGER): ANY
			-- New instance of dynamic type_id.
			-- Note: returned object is not initialized and may
			-- hence violate its invariant.

feature -- Version

	compiler_version: INTEGER

invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

indexing
	library: "[
			EiffelBase: Library of reusable components for Eiffel.
	]"
	status: "[
			Copyright 1986-2001 Interactive Software Engineering (ISE).
			For ISE customers the original versions are an ISE product
			covered by the ISE Eiffel license and support agreements.
	]"
	license: "[
			EiffelBase may now be used by anyone as FREE SOFTWARE to
			develop any product, public-domain or commercial, without
			payment to ISE, under the terms of the ISE Free Eiffel Library
			License (IFELL) at http://eiffel.com/products/base/license.html.
	]"
	source: "[
			Interactive Software Engineering Inc.
			ISE Building
			360 Storke Road, Goleta, CA 93117 USA
			Telephone 805-685-1006, Fax 805-685-6869
			Electronic mail <info@eiffel.com>
			Customer support http://support.eiffel.com
	]"
	info: "[
			For latest info see award-winning pages: http://eiffel.com
	]"

end -- class INTERNAL