GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
wrappers
>
ITERATOR_ON_C_ARRAY
+
Point of view
TYPED_INTERNALS
ANY
INTERNALS_HANDLER
TYPED_INTERNALS
All features
class ITERATOR_ON_C_ARRAY [ITEM_ ->
C_STRUCT
]
Summary
top
TODO: this class is conceptually obsolete as it actually duplicates
ITERATOR_ON_COLLECTION
, or more precisely
ITERATOR_ON_TRAVERSABLE
. It could and should be easily removed
Direct parents
Inherit list:
ITERATOR
Class invariant
top
generation_only_grows
Overview
top
Creation features
from_array
(an_array: C_ARRAY[ITEM_])
Exported features
Creation and implementation
from_array
(an_array: C_ARRAY[ITEM_])
i
:
INTEGER_32
Iterator index
array
: C_ARRAY[ITEM_]
start
Positions the iterator to the first object in the aggregate to be traversed.
is_off
:
BOOLEAN
Returns True when there are no more objects in the sequence.
item
: ITEM_
Returns the object at the current position in the sequence.
next
Positions the iterator to the next object in the sequence.
iterable_generation
:
INTEGER_32
generation
:
INTEGER_32
is_valid
:
BOOLEAN
Agent-based features:
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
Apply
action
to every item of
Current
.
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Do all items satisfy
test
?
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Does at least one item satisfy
test
?
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
Aggregate all the elements starting from the initial value.
Invariant on
generation` dynamics
generation_for_invariant
:
INTEGER_32
generation_only_grows
:
BOOLEAN
from_array
(an_array: C_ARRAY[ITEM_])
effective procedure
top
require
array_not_void:
an_array /= Void
i
:
INTEGER_32
writable attribute
top
Iterator index
array
: C_ARRAY[ITEM_]
writable attribute
top
start
effective procedure
top
Positions the iterator to the first object in the aggregate to be traversed.
ensure
is_valid
is_off
:
BOOLEAN
effective function
top
Returns True when there are no more objects in the sequence.
require
is_valid
ensure
generation = old generation
is_valid
item
: ITEM_
effective function
top
Returns the object at the current position in the sequence.
require
is_valid
not is_off
ensure
generation = old generation
is_valid
next
effective procedure
top
Positions the iterator to the next object in the sequence.
require
is_valid
not is_off
ensure
generation = old generation
is_valid
iterable_generation
:
INTEGER_32
effective function
top
generation
:
INTEGER_32
writable attribute
top
is_valid
:
BOOLEAN
frozen
effective function
top
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
effective procedure
top
Apply
action
to every item of
Current
.
See also
for_all
,
exists
,
aggregate
.
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
effective function
top
Do all items satisfy
test
?
See also
for_each
,
exists
,
aggregate
.
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
effective function
top
Does at least one item satisfy
test
?
See also
for_each
,
for_all
,
aggregate
.
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
top
Aggregate all the elements starting from the initial value.
See also
for_each
,
for_all
,
exists
.
generation_for_invariant
:
INTEGER_32
writable attribute
top
generation_only_grows
:
BOOLEAN
effective function
top