ordered_mod Module

module~~ordered_mod~~UsesGraph module~ordered_mod ordered_mod module~iterator_mod iterator_mod module~iterator_mod->module~ordered_mod module~iterable_mod iterable_mod module~iterator_mod->module~iterable_mod module~countable_mod countable_mod module~countable_mod->module~ordered_mod module~abstract_container_mod abstract_container_mod module~abstract_container_mod->module~ordered_mod module~abstract_container_mod->module~iterator_mod module~abstract_container_mod->module~iterable_mod module~iterable_mod->module~ordered_mod module~iterable_mod->module~countable_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~abstract_container_mod
Help

Provides the ordered abstract type. This is a data structure for which the order of the elements is known. One of the effects of this is that order in which items are retrieved is determined by the order in which they are added to the data structure.

Used By

module~~ordered_mod~~UsedByGraph module~ordered_mod ordered_mod module~queue_mod queue_mod module~ordered_mod->module~queue_mod module~array_list_mod array_list_mod module~ordered_mod->module~array_list_mod module~deque_mod deque_mod module~queue_mod->module~deque_mod module~multimap_mod multimap_mod module~array_list_mod->module~multimap_mod module~data_set_mod data_set_mod module~array_list_mod->module~data_set_mod module~dictionary_mod dictionary_mod module~array_list_mod->module~dictionary_mod module~list_mod list_mod module~deque_mod->module~list_mod module~list_mod->module~array_list_mod module~data_set_mod->module~dictionary_mod module~dynamic_set_mod dynamic_set_mod module~data_set_mod->module~dynamic_set_mod module~dictionary_mod->module~multimap_mod module~map_mod map_mod module~dictionary_mod->module~map_mod module~multiset_mod multiset_mod module~dynamic_set_mod->module~multiset_mod module~map_mod->module~multimap_mod
Help

Abstract Interfaces

abstract interface

  • private pure subroutine push_sub(this, item)

    Arguments

    Type IntentOptional AttributesName
    class(ordered), intent(inout) :: this
    class(*), intent(in) :: item

    Contents to be added to this data structure

abstract interface

  • private pure subroutine blank_sub(this)

    Arguments

    Type IntentOptional AttributesName
    class(ordered), intent(inout) :: this

abstract interface

  • private function pop_func(this)

    Arguments

    Type IntentOptional AttributesName
    class(ordered), intent(inout) :: this

    Return Value class(container), allocatable

    The next item in the data structure, which has been removed

abstract interface

  • private pure function peek_func(this)

    Arguments

    Type IntentOptional AttributesName
    class(ordered), intent(in) :: this

    Return Value class(container), allocatable

    The next item in the data structure

abstract interface

  • private pure function logical_return()

    Arguments

    None

    Return Value logical

    True if first in first out structure, false if last in first out

abstract interface

  • private pure function concat_func(lhs, rhs)

    Arguments

    Type IntentOptional AttributesName
    class(ordered), intent(in) :: lhs

    This object

    class(ordered), intent(in) :: rhs

    The object being concatenated to this one

    Return Value class(ordered), allocatable

    The result of the concatenation


Derived Types

type, public, abstract, extends(countable) :: ordered

Type-Bound Procedures

procedure(push_sub), public, deferred :: push

Place a new item in the data structure

procedure(pop_func), public, deferred :: pop

Remove and return the next item from the data structure

procedure(peek_func), public, deferred :: peek

Return, but do not remove, the next item in the data structure

procedure(blank_sub), public, deferred :: clear

Remove all contents from the data structure

procedure(logical_return), public, nopass, deferred :: is_fifo

Indicates whether this is a first in first out or last in last out data type.

procedure, private :: array_extend

Add (push) the elements of an array to this data structure

procedure, private :: iterator_extend

Add ([[ordered::push]]) the contents of an iterator to this data structure.

generic, public :: extend => array_extend, iterator_extend

Place multiple new items in the data structure

procedure(concat_func), private, deferred :: concat

Join this object with another ordered object, returning the result. The contents of the returned object are ordered such that applying pop until the structure is empty would provide items in the same order as calling pop until the first object is empty and then until the second object is empty.

generic, public :: operator(//) => concat

Overloads the concatenation operator to join this object with another ordered object, returning the result. The contents of the returned object are ordered such that applying pop until the structure is empty would provide items in the same order as calling pop until the first object is empty and then until the second object is empty.

Description

An abstract type which is an ancestor for any data structure in which items are stored in a particular order. This means that the order in which items are placed in the structure will determine the order in which they are retrieved. Examples of data structures descending from this one are a [[stack]], queue, or list.


Subroutines

private subroutine array_extend(this, items)

Arguments

Type IntentOptional AttributesName
class(ordered), intent(inout) :: this
class(*), intent(in), dimension(:):: items

The items to be added to this data structure

Description

Author
Chris MacMackin
Date
February 2016

Adds the elements of an array to this object.

private subroutine iterator_extend(this, items)

Arguments

Type IntentOptional AttributesName
class(ordered), intent(inout) :: this
class(iterable), intent(inout) :: items

The iterable whose contents are to be added to this data structure.

Description

Author
Chris MacMackin
Date
February 2016

Adds the contents of an iterable object to this data structure.