The linked_list_t type implements a linked list of unlimited polymorphic
values. This allows the storage of any type of data.
Definition of linked_list_t
type::linked_list_tprivate
integer,public::size=0class(list_node_t),pointer::first_node=>null()class(list_node_t),pointer::last_node=>null()contains
procedure::add_node=>linked_list_add_nodeprocedure::add_ptr=>linked_list_add_node_ptrprocedure::add_copy=>linked_list_add_node_copyprocedure::delete=>linked_list_delete_nodeprocedure::has=>linked_list_hasprocedure::copy=>linked_list_copygeneric::assignment(=)=>copyprocedure::empty=>linked_list_emptyfinal::linked_list_finalizeend type linked_list_t
where the data is stored in list_node_t type objects.
Definition of list_node_t
type::list_node_tprivate
logical::cloneclass(*),pointer::value=>null()type(list_node_t),pointer::next_node=>null()contains
procedure::get=>list_node_getprocedure::next=>list_node_nextprocedure::set_next=>list_node_set_nextprocedure::is_equal=>list_node_is_equalprocedure::copy=>list_node_copyfinal::list_node_finalizeend 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_startprocedure::has_next=>linked_list_iterator_has_nextprocedure::get_next_ptr=>linked_list_iterator_get_next_ptrend 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: