(git:6a2e663)
list_routinestat Module Reference

An array-based list which grows on demand. When the internal array is full, a new array of twice the size will be allocated and the items are copied over. More...

Functions/Subroutines

logical function, public list_routinestat_isready (list)
 Test if the given list has been initialized. More...
 
subroutine, public list_routinestat_init (list, initial_capacity)
 Allocates the internal data-structures of the given list. This has to be called before any of the other routines. For deallocation call list_[valuetype]_destroy. More...
 
subroutine, public list_routinestat_destroy (list)
 Deallocated the internal data-structures of the given list. Caution: If the stored values are pointers, their targets will not get deallocated by this routine. More...
 
subroutine, public list_routinestat_set (list, value, pos)
 Assings the given value to the given position in the list. Thereby, the former value at that position gets overwritten. If the position is out of bounds, the program stops. More...
 
subroutine, public list_routinestat_push (list, value)
 Appends the given value at the end of the list. More...
 
subroutine, public list_routinestat_insert (list, value, pos)
 Inserts the given value at the givenn position within the list. Values which lay behind the insertion-position move one position up. More...
 
type(routine_stat_type) function, pointer, public list_routinestat_peek (list)
 Returns the last element in the list. Is equivalent to: list_routinestat_get(list, list_routinestat_size(list)) More...
 
type(routine_stat_type) function, pointer, public list_routinestat_pop (list)
 Returns the last element in the list and removes it. Is equivialent to: value = list_routinestat_get(list, list_routinestat_size(list)) call list_routinestat_del(list, list_routinestat_size(list)) More...
 
subroutine, public list_routinestat_clear (list)
 Removes all values from the list. The list itself is not deallocated. More...
 
type(routine_stat_type) function, pointer, public list_routinestat_get (list, pos)
 Returns the value at the given position from the list. More...
 
subroutine, public list_routinestat_del (list, pos)
 Removes the value at the given position from the list. More...
 
integer function, public list_routinestat_size (list)
 Returns the current size of the list. More...
 

Detailed Description

An array-based list which grows on demand. When the internal array is full, a new array of twice the size will be allocated and the items are copied over.

This list can also be used as a stack. Have look at list_push(), list_pop() and list_peek().

History
12.2012 first version [ole]
Author
Ole Schuett

Function/Subroutine Documentation

◆ list_routinestat_isready()

logical function, public list_routinestat::list_routinestat_isready ( type(list_routinestat_type), intent(in)  list)

Test if the given list has been initialized.

Parameters
list...
Returns
...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 61 of file list_routinestat.F.

◆ list_routinestat_init()

subroutine, public list_routinestat::list_routinestat_init ( type(list_routinestat_type), intent(inout)  list,
integer, intent(in), optional  initial_capacity 
)

Allocates the internal data-structures of the given list. This has to be called before any of the other routines. For deallocation call list_[valuetype]_destroy.

Parameters
list...
initial_capacityThe initial size of the internal array (default=11).
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 77 of file list_routinestat.F.

◆ list_routinestat_destroy()

subroutine, public list_routinestat::list_routinestat_destroy ( type(list_routinestat_type), intent(inout)  list)

Deallocated the internal data-structures of the given list. Caution: If the stored values are pointers, their targets will not get deallocated by this routine.

Parameters
list...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 108 of file list_routinestat.F.

◆ list_routinestat_set()

subroutine, public list_routinestat::list_routinestat_set ( type(list_routinestat_type), intent(inout)  list,
type(routine_stat_type), intent(in), pointer  value,
integer, intent(in)  pos 
)

Assings the given value to the given position in the list. Thereby, the former value at that position gets overwritten. If the position is out of bounds, the program stops.

Parameters
list...
value...
posPosition in the list - musst fulfill 0 < pos < list_size+1.
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 132 of file list_routinestat.F.

◆ list_routinestat_push()

subroutine, public list_routinestat::list_routinestat_push ( type(list_routinestat_type), intent(inout)  list,
type(routine_stat_type), intent(in), pointer  value 
)

Appends the given value at the end of the list.

Parameters
list...
value...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 153 of file list_routinestat.F.

◆ list_routinestat_insert()

subroutine, public list_routinestat::list_routinestat_insert ( type(list_routinestat_type), intent(inout)  list,
type(routine_stat_type), intent(in), pointer  value,
integer, intent(in)  pos 
)

Inserts the given value at the givenn position within the list. Values which lay behind the insertion-position move one position up.

Parameters
list...
value...
posPosition in the list - musst fulfill 0 < pos < list_size+2 .
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 180 of file list_routinestat.F.

◆ list_routinestat_peek()

type(routine_stat_type) function, pointer, public list_routinestat::list_routinestat_peek ( type(list_routinestat_type), intent(inout)  list)

Returns the last element in the list. Is equivalent to: list_routinestat_get(list, list_routinestat_size(list))

Parameters
list...
Returns
...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 216 of file list_routinestat.F.

◆ list_routinestat_pop()

type(routine_stat_type) function, pointer, public list_routinestat::list_routinestat_pop ( type(list_routinestat_type), intent(inout)  list)

Returns the last element in the list and removes it. Is equivialent to: value = list_routinestat_get(list, list_routinestat_size(list)) call list_routinestat_del(list, list_routinestat_size(list))

Parameters
list...
Returns
...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 240 of file list_routinestat.F.

◆ list_routinestat_clear()

subroutine, public list_routinestat::list_routinestat_clear ( type(list_routinestat_type), intent(inout)  list)

Removes all values from the list. The list itself is not deallocated.

Parameters
list...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 261 of file list_routinestat.F.

◆ list_routinestat_get()

type(routine_stat_type) function, pointer, public list_routinestat::list_routinestat_get ( type(list_routinestat_type), intent(in)  list,
integer, intent(in)  pos 
)

Returns the value at the given position from the list.

Parameters
list...
posPosition in the list - musst fulfill 0 < pos < list_size+1 .
Returns
...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 284 of file list_routinestat.F.

◆ list_routinestat_del()

subroutine, public list_routinestat::list_routinestat_del ( type(list_routinestat_type), intent(inout)  list,
integer, intent(in)  pos 
)

Removes the value at the given position from the list.

Parameters
list...
posPosition in the list - musst fulfill 0 < pos < list_size+1 .
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 308 of file list_routinestat.F.

◆ list_routinestat_size()

integer function, public list_routinestat::list_routinestat_size ( type(list_routinestat_type), intent(in)  list)

Returns the current size of the list.

Parameters
list...
Returns
...
History
12.2012 created [ole]
Author
Ole Schuett

Definition at line 337 of file list_routinestat.F.