+
Point of view
All features
class TYPED_INTERNALS [E_]
Summary
TYPED_INTERNALS serves as a gateway between the typed ideal world of Eiffel objects and the untyped physical world of raw memory, files on disks, streams on networks...
TYPED_INTERNALS[E_] describes the physical structure of class E_. For instance, TYPED_INTERNALS[STRING] describes the physical structure of class STRING.
Optionally, an object of type E_ can be attached to that a TYPED_INTERNALS[E_]. The TYPED_INTERNALS[E_] object can then be used to inspect and change the values of the attributes of the attached object. For instance, a STRING could be attached to a TYPED_INTERNALS[STRING]. The TYPED_INTERNALS[STRING] could then be used to get or set this STRING's attributes.
Direct parents
Inherit list: INTERNALS
Known children
Inherit list: NATIVE_ARRAY_INTERNALS
Overview
Creation features
{}
  • for_object (object_: E_)
    Attach Current to object_
Actual creation is performed by ANY.to_internals
{INTERNALS_HANDLER}
  • make_blank
    Attach Current to a blank object: all attributes of the object have their default value (references are Void, INTEGERS are 0, BOOLEANs are False...)
Features
Getting information about the described object's type
{INTERNALS_HANDLER, INTERNALS}
{INTERNALS_HANDLER}
  • for_object (object_: E_)
    Attach Current to object_
  • make_blank
    Attach Current to a blank object: all attributes of the object have their default value (references are Void, INTEGERS are 0, BOOLEANs are False...)
Getting information about the type's attributes
{INTERNALS_HANDLER}
{INTERNALS_HANDLER}
{INTERNALS_HANDLER}
  • object: E_
    The object Current is attached to
Accessing the object's attributes
{INTERNALS_HANDLER}
{TYPED_INTERNALS}
{ANY}
{}
Getting information about the described object's type
{INTERNALS_HANDLER, INTERNALS}
Accessing the object's attributes
{INTERNALS_HANDLER}
Name of the base class of the type described by Current.
For instance, if Current is a TYPED_INTERNALS[ARRAY[INTEGER]], type_generator is "ARRAY".
type_generating_type: STRING
Name of the type described by Current.
For instance, if Current is a TYPED_INTERNALS[ARRAY[INTEGER]], type_generating_type is "ARRAY[INTEGER]".
type_is_expanded: BOOLEAN
Is the type described by Current expanded?
type_attribute_is_expanded (i: INTEGER_32): BOOLEAN
Is the type of the ith attribute expanded?
require
  • i.in_range(1, type_attribute_count)
type_can_be_assigned_to_attribute (other: INTERNALS, i: INTEGER_32): BOOLEAN
Can the object attached to other be assigned to the ith attribute?
require
  • i.in_range(1, type_attribute_count)
ensure
  • other = Void implies Result = not type_attribute_is_expanded(i)
for_object (object_: E_)
effective procedure
Attach Current to object_
require ensure
make_blank
Attach Current to a blank object: all attributes of the object have their default value (references are Void, INTEGERS are 0, BOOLEANs are False...)
require ensure
type_attribute_count: INTEGER_32
Number of attributes of the type described by Current
type_attribute_name (i: INTEGER_32): STRING
Name of the ith attribute of the type described by Current.
require
  • i.in_range(1, type_attribute_count)
ensure
  • Result /= Void
type_attribute_generator (i: INTEGER_32): STRING
Name of the base class of the ith attribute of the type described by Current.
require
  • i.in_range(1, type_attribute_count)
ensure
  • Result /= Void
type_attribute_generating_type (i: INTEGER_32): STRING
Name of the type of the ith attribute of the type described by Current.
require
  • i.in_range(1, type_attribute_count)
ensure
  • Result /= Void
object_as_pointer: POINTER
Pointer to the object currently attached to Current.
require
  • type_is_expanded implies type_generator.is_equal("NATIVE_ARRAY")
ensure
  • Result.is_not_null
object: E_
effective function
The object Current is attached to
require ensure
object_attribute (i: INTEGER_32): INTERNALS
Read the ith attribute of the type described by Current (also see type_attribute).
If this attribute is attached to an object, then Result is also attached to that object
require
  • i.in_range(1, type_attribute_count)
ensure
  • type_attribute_is_expanded(i) implies Result /= Void
set_object_attribute (element: INTERNALS, i: INTEGER_32)
Write the ith attribute of the type described by Current
require
  • i.in_range(1, type_attribute_count)
  • type_can_be_assigned_to_attribute(element, i)
  • object_can_be_modified
ensure
  • element = Void implies object_attribute(i) = Void
  • element /= Void implies object_attribute(i).is_equal(element)
object_memory: E_
writable attribute
is_equal (other: TYPED_INTERNALS [E_]): BOOLEAN
{ANY}
Is other attached to an object considered equal to current object?
require
  • other /= Void
ensure
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
set_object_can_be_retrieved
effective procedure
{ANY}
Forbid further modification of the object through set_object_attribute, so that it can safely be released into the system.
Note that the embedded object is notified via its internals_can_be_retrieved feature.
ensure
  • object_can_be_retrieved
correct_generating_type (object_: E_): BOOLEAN
effective function
{}
ensure
type_is_native_array: BOOLEAN
effective function
Is the type described by Current a NATIVE_ARRAY?
ensure
object_can_be_retrieved: BOOLEAN
writable attribute
Can the object be retrieved by the rest of the system through object?
object_can_be_modified: BOOLEAN
effective function
Can the object be modified through set_object_attribute, i.e.
is it safely isolated from the rest of the system?
ensure