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.
True if first in first out structure, false if last in first out
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ordered), | intent(in) | :: | lhs | This object |
||
class(ordered), | intent(in) | :: | rhs | The object being concatenated to this one |
The result of the concatenation
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. |
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ordered), | intent(inout) | :: | this | |||
class(*), | intent(in), | dimension(:) | :: | items | The items to be added to this data structure |
Adds the elements of an array to this object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ordered), | intent(inout) | :: | this | |||
class(iterable), | intent(inout) | :: | items | The iterable whose contents are to be added to this data structure. |
Adds the contents of an iterable object to this data structure.