GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
NATIVE_ARRAY_INTERNALS
+
Point of view
All features
ANY
INTERNALS
All features
class NATIVE_ARRAY_INTERNALS [E_]
Summary
top
NATIVE_ARRAY_INTERNALS
plays the same role as
TYPED_INTERNALS
, except they describe
NATIVE_ARRAY
's.
Direct parents
Inherit list:
TYPED_INTERNALS
Class invariant
top
type_generator
.is_equal("NATIVE_ARRAY")
Overview
top
Creation features
{}
for_object
(native_array:
NATIVE_ARRAY
[
ANY
], capacity_:
INTEGER_32
)
Attach
Current
to
native_array
{
INTERNALS_HANDLER
}
make_blank
(capacity_:
INTEGER_32
)
Attach
Current
to a blank object: all items of the object have their default value (references are Void, INTEGERs are 0, BOOLEANs are False, etc)
Features
Getting information about the described object's type
{
INTERNALS_HANDLER
,
INTERNALS
}
type_is_native_array
:
BOOLEAN
Is the type described by
Current
a
NATIVE_ARRAY
?
type_attribute_is_expanded
(i:
INTEGER_32
):
BOOLEAN
Is the type of the
i
th attribute expanded?
type_item_is_expanded
:
BOOLEAN
type_can_be_assigned_to_attribute
(other:
INTERNALS
, i:
INTEGER_32
):
BOOLEAN
Can the object attached to
other
be assigned to the
i
th attribute?
type_can_be_assigned_to_item
(other:
INTERNALS
):
BOOLEAN
{
INTERNALS_HANDLER
}
for_object
(native_array:
NATIVE_ARRAY
[
ANY
], capacity_:
INTEGER_32
)
Attach
Current
to
native_array
make_blank
(capacity_:
INTEGER_32
)
Attach
Current
to a blank object: all items of the object have their default value (references are Void, INTEGERs are 0, BOOLEANs are False, etc)
Getting information about the type's attributes
{
INTERNALS_HANDLER
}
type_attribute_count
:
INTEGER_32
Number of attributes of the type described by
Current
capacity
:
INTEGER_32
type_attribute_name
(i:
INTEGER_32
):
STRING
Name of the
i
th attribute of the type described by
Current
.
type_attribute_generator
(i:
INTEGER_32
):
STRING
Name of the base class of the
i
th attribute of the type described by
Current
.
type_item_generator
:
STRING
type_attribute_generating_type
(i:
INTEGER_32
):
STRING
Name of the type of the
i
th attribute of the type described by
Current
.
type_item_generating_type
:
STRING
Accessing the object's attributes
{
INTERNALS_HANDLER
}
object_attribute
(i:
INTEGER_32
):
INTERNALS
Read the
i
th attribute of the type described by
Current
(also see
type_attribute
).
set_object_attribute
(element:
INTERNALS
, i:
INTEGER_32
)
Write the
i
th attribute of the type described by
Current
Getting information about the described object's type
{
INTERNALS_HANDLER
,
INTERNALS
}
type_generator
:
STRING
Name of the base class of the type described by
Current
.
type_generating_type
:
STRING
Name of the type described by
Current
.
type_is_expanded
:
BOOLEAN
Is the type described by
Current
expanded?
{
INTERNALS_HANDLER
}
object_as_pointer
:
POINTER
Pointer to the object currently attached to
Current
.
{
INTERNALS_HANDLER
}
object
: E_
The object
Current
is attached to
{
TYPED_INTERNALS
}
object_memory
: E_
{
ANY
}
is_equal
(other: NATIVE_ARRAY_INTERNALS [E_]):
BOOLEAN
Is
other
attached to an object considered equal to current object?
set_object_can_be_retrieved
Forbid further modification of the object through
set_object_attribute
, so that it can safely be released into the system.
{}
correct_generating_type
(object_: E_):
BOOLEAN
Accessing the object's attributes
{
INTERNALS_HANDLER
}
object_can_be_retrieved
:
BOOLEAN
Can the object be retrieved by the rest of the system through
object
?
object_can_be_modified
:
BOOLEAN
Can the object be modified through
set_object_attribute
, i.e.
type_is_native_array
:
BOOLEAN
is True
constant attribute
{
INTERNALS_HANDLER
,
INTERNALS
}
top
Is the type described by
Current
a
NATIVE_ARRAY
?
ensure
Result = type_generator.is_equal("NATIVE_ARRAY")
type_attribute_is_expanded
(i:
INTEGER_32
):
BOOLEAN
effective function
{
INTERNALS_HANDLER
,
INTERNALS
}
top
Is the type of the
i
th attribute expanded?
require
i.in_range(1, type_attribute_count)
type_item_is_expanded
:
BOOLEAN
{
INTERNALS_HANDLER
,
INTERNALS
}
top
type_can_be_assigned_to_attribute
(other:
INTERNALS
, i:
INTEGER_32
):
BOOLEAN
effective function
{
INTERNALS_HANDLER
,
INTERNALS
}
top
Can the object attached to
other
be assigned to the
i
th attribute?
require
i.in_range(1, type_attribute_count)
ensure
other = Void implies Result = not type_attribute_is_expanded(i)
type_can_be_assigned_to_item
(other:
INTERNALS
):
BOOLEAN
{
INTERNALS_HANDLER
,
INTERNALS
}
top
for_object
(native_array:
NATIVE_ARRAY
[
ANY
], capacity_:
INTEGER_32
)
effective procedure
{
INTERNALS_HANDLER
}
top
Attach
Current
to
native_array
require
native_array.is_null = capacity_ = 0
correct_generating_type
(native_array)
ensure
object_can_be_retrieved
object
= native_array
capacity
= capacity_
make_blank
(capacity_:
INTEGER_32
)
{
INTERNALS_HANDLER
}
top
Attach
Current
to a blank object: all items of the object have their default value (references are Void, INTEGERs are 0, BOOLEANs are False, etc)
ensure
object_can_be_modified
capacity
= capacity_
type_attribute_count
:
INTEGER_32
{
INTERNALS_HANDLER
}
top
Number of attributes of the type described by
Current
ensure
Result =
capacity
or Result = 0
capacity
:
INTEGER_32
writable attribute
{
INTERNALS_HANDLER
}
top
type_attribute_name
(i:
INTEGER_32
):
STRING
effective function
{
INTERNALS_HANDLER
}
top
Name of the
i
th 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
effective function
{
INTERNALS_HANDLER
}
top
Name of the base class of the
i
th attribute of the type described by
Current
.
require
i.in_range(1, type_attribute_count)
ensure
Result /= Void
type_item_generator
:
STRING
{
INTERNALS_HANDLER
}
top
type_attribute_generating_type
(i:
INTEGER_32
):
STRING
effective function
{
INTERNALS_HANDLER
}
top
Name of the type of the
i
th attribute of the type described by
Current
.
require
i.in_range(1, type_attribute_count)
ensure
Result /= Void
type_item_generating_type
:
STRING
{
INTERNALS_HANDLER
}
top
object_attribute
(i:
INTEGER_32
):
INTERNALS
{
INTERNALS_HANDLER
}
top
Read the
i
th 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
)
{
INTERNALS_HANDLER
}
top
Write the
i
th 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)
type_generator
:
STRING
{
INTERNALS_HANDLER
,
INTERNALS
}
top
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
{
INTERNALS_HANDLER
,
INTERNALS
}
top
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
{
INTERNALS_HANDLER
,
INTERNALS
}
top
Is the type described by
Current
expanded?
object_as_pointer
:
POINTER
{
INTERNALS_HANDLER
}
top
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
{
INTERNALS_HANDLER
}
top
The object
Current
is attached to
require
object_can_be_retrieved
ensure
Result.generating_type =
type_generating_type
object_memory
: E_
writable attribute
{
TYPED_INTERNALS
}
top
is_equal
(other: NATIVE_ARRAY_INTERNALS [E_]):
BOOLEAN
{
ANY
}
top
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
}
top
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
{}
top
ensure
Result = object_.generating_type =
type_generating_type
object_can_be_retrieved
:
BOOLEAN
writable attribute
{
INTERNALS_HANDLER
}
top
Can the object be retrieved by the rest of the system through
object
?
object_can_be_modified
:
BOOLEAN
effective function
{
INTERNALS_HANDLER
}
top
Can the object be modified through
set_object_attribute
, i.e.
is it safely isolated from the rest of the system?
ensure
Result = not
object_can_be_retrieved