note
	description: "[
		Access to internal object properties.
		This class may be used as ancestor by classes needing its facilities.
	]"
	library: "Free implementation of ELKS library"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	date: "$Date: 2019-12-09 13:48:44 +0000 (Mon, 09 Dec 2019) $"
	revision: "$Revision: 103722 $"

class interface
	INTERNAL

create 
	default_create

feature -- Conformance

	is_instance_of (object: ANY; type_id: INTEGER_32): BOOLEAN
			-- Is object an instance of type type_id?
		require
			object_not_void: object /= Void
			type_id_nonnegative: type_id >= 0
		ensure
			instance_free: class
	
feature -- Creation

	type_of (object: detachable ANY): TYPE [detachable ANY]
			-- Associated TYPE instance of object.
		ensure
			instance_free: class
			result_not_void: Result /= Void
	
feature -- Status report

	is_special (object: ANY): BOOLEAN
			-- Is object a special object?
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	is_tuple (object: ANY): BOOLEAN
			-- Is object a TUPLE object?
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	is_field_transient (i: INTEGER_32; object: ANY): BOOLEAN
			-- Is i-th field of object a transient attribute?
			-- I.e. an attribute that does not need to be stored?
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
		ensure
			instance_free: class

	is_field_expanded (i: INTEGER_32; object: ANY): BOOLEAN
			-- Is i-th field of object a user-defined expanded attribute?
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
		ensure
			instance_free: class
	
feature -- Access

	class_name (object: ANY): STRING_8
			-- Name of the class associated with object
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	type_name_32 (object: ANY): READABLE_STRING_32
			-- Name of object's generating type
			-- (type of which object is a direct instance).
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	dynamic_type (object: separate ANY): INTEGER_32
			-- Dynamic type of object
		require
			object_not_void: object /= Void
		ensure
			instance_free: class
			dynamic_type_nonnegative: Result >= 0

	generic_count (obj: ANY): INTEGER_32
			-- Number of generic parameter in obj.
		require
			obj_not_void: obj /= Void
		ensure
			instance_free: class

	generic_dynamic_type (obj: ANY; i: INTEGER_32): INTEGER_32
			-- Dynamic type of generic parameter of object at
			-- position i.
		require
			obj_not_void: obj /= Void
			obj_generic: generic_count (obj) > 0
			i_valid: i > 0 and i <= generic_count (obj)
		ensure
			instance_free: class
			dynamic_type_nonnegative: Result >= 0

	field (i: INTEGER_32; object: ANY): detachable 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)
		ensure
			instance_free: class

	reference_field (i: INTEGER_32; object: ANY): detachable ANY
			-- Reference value of the 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)
			valid_type: field_type (i, object) = Reference_type
		ensure
			instance_free: class

	field_name (i: INTEGER_32; object: ANY): STRING_8
			-- 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
			instance_free: class
			result_exists: Result /= Void

	field_offset (i: INTEGER_32; object: ANY): INTEGER_32
			-- 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)
		ensure
			instance_free: class

	field_type (i: INTEGER_32; object: ANY): INTEGER_32
			-- Abstract 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)
		ensure
			instance_free: class
			field_type_nonnegative: Result >= 0

	character_8_field (i: INTEGER_32; object: ANY): CHARACTER_8
			-- Character value of i-th field of object
			-- Was declared in INTERNAL as synonym of character_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_8_field: field_type (i, object) = Character_8_type
		ensure
			instance_free: class

	character_field (i: INTEGER_32; object: ANY): CHARACTER_8
			-- Character value of i-th field of object
			-- Was declared in INTERNAL as synonym of character_8_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_8_field: field_type (i, object) = Character_8_type
		ensure
			instance_free: class

	character_32_field (i: INTEGER_32; object: ANY): CHARACTER_32
			-- 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_32_field: field_type (i, object) = Character_32_type
		ensure
			instance_free: class

	boolean_field (i: INTEGER_32; 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
		ensure
			instance_free: class

	natural_8_field (i: INTEGER_32; object: ANY): NATURAL_8
			-- NATURAL_8 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)
			natural_8_field: field_type (i, object) = Natural_8_type
		ensure
			instance_free: class

	natural_16_field (i: INTEGER_32; object: ANY): NATURAL_16
			-- NATURAL_16 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)
			natural_16_field: field_type (i, object) = Natural_16_type
		ensure
			instance_free: class

	natural_32_field (i: INTEGER_32; object: ANY): NATURAL_32
			-- NATURAL_32 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)
			natural_field: field_type (i, object) = Natural_32_type
		ensure
			instance_free: class

	natural_64_field (i: INTEGER_32; object: ANY): NATURAL_64
			-- NATURAL_64 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)
			natural_64_field: field_type (i, object) = Natural_64_type
		ensure
			instance_free: class

	integer_8_field (i: INTEGER_32; object: ANY): INTEGER_8
			-- 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_8_field: field_type (i, object) = Integer_8_type
		ensure
			instance_free: class

	integer_16_field (i: INTEGER_32; object: ANY): INTEGER_16
			-- 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_16_field: field_type (i, object) = Integer_16_type
		ensure
			instance_free: class

	integer_field (i: INTEGER_32; object: ANY): INTEGER_32
			-- Integer value of i-th field of object
			-- Was declared in INTERNAL as synonym of integer_32_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_32_field: field_type (i, object) = Integer_32_type
		ensure
			instance_free: class

	integer_32_field (i: INTEGER_32; object: ANY): INTEGER_32
			-- Integer value of i-th field of object
			-- Was declared in INTERNAL as synonym of integer_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_32_field: field_type (i, object) = Integer_32_type
		ensure
			instance_free: class

	integer_64_field (i: INTEGER_32; object: ANY): INTEGER_64
			-- 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_64_field: field_type (i, object) = Integer_64_type
		ensure
			instance_free: class

	real_32_field (i: INTEGER_32; object: ANY): REAL_32
			-- Real value of i-th field of object
			-- Was declared in INTERNAL as synonym of real_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_32_field: field_type (i, object) = Real_32_type
		ensure
			instance_free: class

	real_field (i: INTEGER_32; object: ANY): REAL_32
			-- Real value of i-th field of object
			-- Was declared in INTERNAL as synonym of real_32_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_32_field: field_type (i, object) = Real_32_type
		ensure
			instance_free: class

	pointer_field (i: INTEGER_32; 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
		ensure
			instance_free: class

	real_64_field (i: INTEGER_32; object: ANY): REAL_64
			-- Double precision value of i-th field of object
			-- Was declared in INTERNAL as synonym of double_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_64_field: field_type (i, object) = Real_64_type
		ensure
			instance_free: class

	double_field (i: INTEGER_32; object: ANY): REAL_64
			-- Double precision value of i-th field of object
			-- Was declared in INTERNAL as synonym of real_64_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_64_field: field_type (i, object) = Real_64_type
		ensure
			instance_free: class
	
feature -- Element change

	set_reference_field (i: INTEGER_32; object: ANY; value: detachable 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
			valid_value: is_attached_type (field_static_type_of_type (i, dynamic_type (object))) implies value /= Void
			value_conforms_to_field_static_type: value /= Void implies field_conforms_to (dynamic_type (value), field_static_type_of_type (i, dynamic_type (object)))
		ensure
			instance_free: class

	set_real_64_field (i: INTEGER_32; object: ANY; value: REAL_64)
			-- Was declared in INTERNAL as synonym of set_double_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_64_field: field_type (i, object) = Real_64_type
		ensure
			instance_free: class

	set_double_field (i: INTEGER_32; object: ANY; value: REAL_64)
			-- Was declared in INTERNAL as synonym of set_real_64_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_64_field: field_type (i, object) = Real_64_type
		ensure
			instance_free: class

	set_character_8_field (i: INTEGER_32; object: ANY; value: CHARACTER_8)
			-- Was declared in INTERNAL as synonym of set_character_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_8_field: field_type (i, object) = Character_8_type
		ensure
			instance_free: class

	set_character_field (i: INTEGER_32; object: ANY; value: CHARACTER_8)
			-- Was declared in INTERNAL as synonym of set_character_8_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_8_field: field_type (i, object) = Character_8_type
		ensure
			instance_free: class

	set_character_32_field (i: INTEGER_32; object: ANY; value: CHARACTER_32)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			character_32_field: field_type (i, object) = Character_32_type
		ensure
			instance_free: class

	set_boolean_field (i: INTEGER_32; 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
		ensure
			instance_free: class

	set_natural_8_field (i: INTEGER_32; object: ANY; value: NATURAL_8)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			natural_8_field: field_type (i, object) = Natural_8_type
		ensure
			instance_free: class

	set_natural_16_field (i: INTEGER_32; object: ANY; value: NATURAL_16)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			natural_16_field: field_type (i, object) = Natural_16_type
		ensure
			instance_free: class

	set_natural_32_field (i: INTEGER_32; object: ANY; value: NATURAL_32)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			natural_32_field: field_type (i, object) = Natural_32_type
		ensure
			instance_free: class

	set_natural_64_field (i: INTEGER_32; object: ANY; value: NATURAL_64)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			natural_64_field: field_type (i, object) = Natural_64_type
		ensure
			instance_free: class

	set_integer_8_field (i: INTEGER_32; object: ANY; value: INTEGER_8)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_8_field: field_type (i, object) = Integer_8_type
		ensure
			instance_free: class

	set_integer_16_field (i: INTEGER_32; object: ANY; value: INTEGER_16)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_16_field: field_type (i, object) = Integer_16_type
		ensure
			instance_free: class

	set_integer_field (i: INTEGER_32; object: ANY; value: INTEGER_32)
			-- Was declared in INTERNAL as synonym of set_integer_32_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_32_field: field_type (i, object) = Integer_32_type
		ensure
			instance_free: class

	set_integer_32_field (i: INTEGER_32; object: ANY; value: INTEGER_32)
			-- Was declared in INTERNAL as synonym of set_integer_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_32_field: field_type (i, object) = Integer_32_type
		ensure
			instance_free: class

	set_integer_64_field (i: INTEGER_32; object: ANY; value: INTEGER_64)
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			integer_64_field: field_type (i, object) = Integer_64_type
		ensure
			instance_free: class

	set_real_32_field (i: INTEGER_32; object: ANY; value: REAL_32)
			-- Was declared in INTERNAL as synonym of set_real_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_32_field: field_type (i, object) = Real_32_type
		ensure
			instance_free: class

	set_real_field (i: INTEGER_32; object: ANY; value: REAL_32)
			-- Was declared in INTERNAL as synonym of set_real_32_field.
		require
			object_not_void: object /= Void
			index_large_enough: i >= 1
			index_small_enough: i <= field_count (object)
			real_32_field: field_type (i, object) = Real_32_type
		ensure
			instance_free: class

	set_pointer_field (i: INTEGER_32; 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
		ensure
			instance_free: class
	
feature -- Measurement

	field_count (object: ANY): INTEGER_32
			-- Number of logical fields in object
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	persistent_field_count (object: ANY): INTEGER_32
			-- Number of logical fields in object that are not transient.
		require
			object_not_void: object /= Void
		ensure
			instance_free: class
			count_positive: Result >= 0

	physical_size (object: ANY): INTEGER_32
			-- Space occupied by object in bytes
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	deep_physical_size (object: ANY): INTEGER_32
			-- Space occupied by object and its children in bytes
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	physical_size_64 (object: separate ANY): NATURAL_64
			-- Space occupied by object in bytes
		require
			object_not_void: object /= Void
		ensure
			instance_free: class

	deep_physical_size_64 (object: ANY): NATURAL_64
			-- Space occupied by object and its children in bytes
		require
			object_not_void: object /= Void
		ensure
			instance_free: class
	
note
	copyright: "Copyright (c) 1984-2019, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class INTERNAL

Generated by ISE EiffelStudio