where the data is stored in list_node_t type objects.
Definition of list_node_t
type::list_node_tprivate
logical::clone!< indicate whether this node is a clone of another node.
!! In this case data is copeied, otherwise a pointer is stored.
class(*),pointer::value=>null()!< the data to be stored in the node
type(list_node_t),pointer::next_node=>null()!< pointer to the next node
contains
procedure::get=>list_node_get!< @copydoc list_node_oct_m::list_node_get
procedure::next=>list_node_next!< @copydoc list_node_oct_m::list_node_next
procedure::set_next=>list_node_set_next!< @copydoc list_node_oct_m::list_node_set_next
procedure::is_equal=>list_node_is_equal!< @copydoc list_node_oct_m::list_node_is_equal
procedure::copy=>list_node_copy!< @copydoc list_node_oct_m::list_node_copy
final::list_node_finalize!< @copydoc list_node_oct_m::list_node_finalize
end type list_node_t
The class(*), pointer :: value => null() allows storage of a pointer to any data type.
Iterating over the list is done using the associated iterator.
Definition of linked_list_iterator_t
type::linked_list_iterator_tprivate
class(list_node_t),pointer::next_node=>null()contains
procedure::start=>linked_list_iterator_start!< @copydoc linked_list_oct_m::linked_list_iterator_start
procedure::has_next=>linked_list_iterator_has_next!< @copydoc linked_list_oct_m::linked_list_iterator_has_next
procedure::get_next_ptr=>linked_list_iterator_get_next_ptr!< @copydoc linked_list_oct_m::linked_list_iterator_get_next_ptr
end type linked_list_iterator_t
These classes are not meant to used as is, but rather to be extended and by providing an add method to the
list and a get_next method to the iterator.
Also the linked_list_iterator_t is the parent of a number of specialized iterators for the various systems: