102 integer(int32),
parameter :: FL_NO_ERROR = 0
103 integer(int32),
parameter :: FL_INVALID_ARGUMENT_ERROR = 1000
104 integer(int32),
parameter :: FL_OUT_OF_MEMORY_ERROR = 1001
105 integer(int32),
parameter :: FL_INDEX_OUT_OF_RANGE_ERROR = 1002
106 integer(int32),
parameter :: FL_INVALID_ITERATOR_ERROR = 1003
113 class(*),
private,
pointer :: m_item => null()
116 logical,
private :: m_delete = .true.
128 procedure,
public :: get => c_get
141 procedure,
public :: delete_on_cleanup => c_get_delete
152 procedure,
public :: free => c_cleanup
156 type,
extends(container) :: node
158 type(node),
private,
pointer :: next => null()
160 type(node),
private,
pointer :: previous => null()
165 module function c_get(this) result(rst)
166 class(container),
intent(in) :: this
167 class(*),
pointer :: rst
170 pure module function c_get_delete(this) result(rst)
171 class(container),
intent(in) :: this
175 module subroutine c_destroy(this)
176 type(container),
intent(inout) :: this
179 module subroutine c_cleanup(this)
180 class(container),
intent(inout) :: this
261 type(container),
private,
allocatable,
dimension(:) :: m_list
263 integer(int32),
private :: m_count = 0
274 procedure,
public :: count => list_get_count
291 procedure,
public :: get_capacity => list_get_capacity
307 procedure,
public :: set_capacity => list_set_capacity
330 procedure,
public :: push => list_push
339 procedure,
public :: pop => list_pop
356 procedure,
public :: get => list_get
382 procedure,
public :: set => list_set
408 procedure,
public :: insert => list_insert
423 procedure,
public :: remove => list_remove
432 procedure,
public :: clear => list_clear
437 pure module function list_get_count(this) result(rst)
438 class(list),
intent(in) :: this
439 integer(int32) :: rst
442 pure module function list_get_capacity(this) result(rst)
443 class(list),
intent(in) :: this
444 integer(int32) :: rst
447 module subroutine list_set_capacity(this, n, err)
448 class(list),
intent(inout) :: this
449 integer(int32),
intent(in) :: n
450 class(errors),
intent(inout),
optional,
target :: err
453 module subroutine list_push(this, x, manage, err)
454 class(list),
intent(inout) :: this
455 class(*),
intent(in),
target :: x
456 logical,
intent(in),
optional :: manage
457 class(errors),
intent(inout),
optional,
target :: err
460 module subroutine list_pop(this)
461 class(list),
intent(inout) :: this
464 module function list_get(this, i, err) result(rst)
465 class(list),
intent(in) :: this
466 integer(int32),
intent(in) :: i
467 class(errors),
intent(inout),
optional,
target :: err
468 class(*),
pointer :: rst
471 module subroutine list_set(this, i, x, manage, err)
472 class(list),
intent(inout) :: this
473 integer(int32),
intent(in) :: i
474 class(*),
intent(in),
target :: x
475 logical,
intent(in),
optional :: manage
476 class(errors),
intent(inout),
optional,
target :: err
479 module subroutine list_insert(this, i, x, manage, err)
480 class(list),
intent(inout) :: this
482 class(*),
intent(in) :: x
483 logical,
intent(in),
optional :: manage
484 class(errors),
intent(inout),
optional,
target :: err
487 module subroutine list_remove(this, i, err)
488 class(list),
intent(inout) :: this
490 class(errors),
intent(inout),
optional,
target :: err
493 module subroutine list_clear(this)
494 class(list),
intent(inout) :: this
578 integer(int32),
private :: m_count = 0
580 type(node),
private,
pointer :: m_first => null()
582 type(node),
private,
pointer :: m_last => null()
584 type(node),
private,
pointer :: m_current => null()
595 procedure,
public :: count => ll_count
604 procedure,
public :: move_to_first => ll_move_to_first
613 procedure,
public :: move_to_last => ll_move_to_last
625 procedure,
public :: next => ll_move_to_next
637 procedure,
public :: previous => ll_move_to_previous
648 procedure,
public :: get => ll_get
671 procedure,
public :: set => ll_set
694 procedure,
public :: push => ll_push
703 procedure,
public :: pop => ll_pop
712 procedure,
public :: clear => ll_clear
720 pure module function ll_count(this) result(rst)
721 class(linked_list),
intent(in) :: this
722 integer(int32) :: rst
725 module subroutine ll_move_to_first(this)
726 class(linked_list),
intent(inout) :: this
729 module subroutine ll_move_to_last(this)
730 class(linked_list),
intent(inout) :: this
733 module function ll_move_to_next(this) result(rst)
734 class(linked_list),
intent(inout) :: this
738 module function ll_move_to_previous(this) result(rst)
739 class(linked_list),
intent(inout) :: this
743 module function ll_get(this) result(rst)
744 class(linked_list),
intent(in) :: this
745 class(*),
pointer :: rst
748 module subroutine ll_set(this, x, manage, err)
749 class(linked_list),
intent(inout) :: this
750 class(*),
intent(in),
target :: x
751 logical,
intent(in),
optional :: manage
752 class(errors),
intent(inout),
optional,
target :: err
755 module subroutine ll_push(this, x, manage, err)
756 class(linked_list),
intent(inout) :: this
757 class(*),
intent(in),
target :: x
758 logical,
intent(in),
optional :: manage
759 class(errors),
intent(inout),
optional,
target :: err
762 module subroutine ll_pop(this)
763 class(linked_list),
intent(inout) :: this
766 module subroutine ll_clear(this)
767 class(linked_list),
intent(inout) :: this
770 module subroutine ll_destroy(this)
771 type(linked_list),
intent(inout) :: this
A module containing various collections using Fortran's unlimited polymorphic functionallity.
Defines a generic, linked-list container.
Defines a generic, dynamically sizable list.