An object for stepping through a linked list.
Definition (Subclass of FTObject):
TYPE(FTLinkedListIterator) :: list
Initialization
CLASS(FTLinkedList) , POINTER :: list
CLASS(FTLinkedListIterator), POINTER :: iterator
ALLOCATE(iterator)
CALL iterator % initWithFTLinkedList(list)
Accessors
ptr => iterator % list()
ptr => iterator % object()
ptr => iterator % currentRecord()
Iterating
CLASS(FTObject), POINTER :: objectPtr
CALL iterator % setToStart
DO WHILE (.NOT.iterator % isAtEnd())
objectPtr => iterator % object() ! if the object is wanted
recordPtr => iterator % currentRecord() ! if the record is wanted
Do something with object or record
CALL iterator % moveToNext() ! DON'T FORGET THIS!!
END DO
Destruction
CALL iterator % destruct() [Non Pointers]
CALL release(iterator) [Pointers]
Interfaces
-
Public, generic name: release(self)
Call release(self) on an object to release control
of an object. If its reference count is zero, then
it is deallocated.
Arguments
Derived Types
Components
Type |
Visibility | Attributes |
|
Name |
| Initial | |
class(FTLinkedList),
|
public, |
POINTER
|
:: |
list |
=> |
NULL() |
|
class(FTLinkedListRecord),
|
public, |
POINTER
|
:: |
current |
=> |
NULL() |
|
Type-Bound Procedures
procedure, public ::
description => FTObjectDescription |
|
procedure, public ::
printDescription => printFTObjectDescription |
|
procedure, public, non_overridable ::
copy => copyFTObject |
|
procedure, public, non_overridable ::
retain => retainFTObject |
|
procedure, public, non_overridable ::
isUnreferenced |
|
procedure, public, non_overridable ::
refCount |
|
procedure, public ::
init => initEmpty |
|
procedure, public ::
initWithFTLinkedList |
|
procedure, public ::
destruct => destructIterator |
|
procedure, public ::
isAtEnd => FTLinkedListIsAtEnd |
|
procedure, public ::
object => FTLinkedListObject |
|
procedure, public ::
currentRecord => FTLinkedListCurrentRecord |
|
procedure, public ::
linkedList => returnLinkedList |
|
procedure, public ::
className => linkedListIteratorClassName |
|
procedure, public ::
setLinkedList |
|
procedure, public ::
setToStart |
|
procedure, public ::
moveToNext |
|
procedure, public ::
removeCurrentRecord |
|
Functions
Arguments
Return Value
logical
Arguments
Return Value
class(FTObject), POINTER
Class name returns a string with the name of the type of the object
Read more…
Arguments
Return Value
character(len=CLASS_NAME_CHARACTER_LENGTH)
Subroutines
The destructor must not be called except at the end of destructors of
subclasses.
Arguments
Public, generic name: release(self)
Read more…
Arguments