self_vector_ref Module
Uses:
- self_object
Provides array-based, self-extending reference vectors of arbitrary type.
Used By
Variables
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | vector_initial_size | = | 20 |
Interfaces
private interface vector_ref
-
private function new_empty(verbose, initial_size) result(this)
Arguments
Type Intent Optional Attributes Name logical, intent(in), optional :: verbose integer, intent(in), optional :: initial_size Return Value type(vector_ref)
-
private function new_from_array(items, verbose, initial_size) result(this)
Arguments
Type Intent Optional Attributes Name class(*), intent(in), target :: items(:) logical, intent(in), optional :: verbose integer, intent(in), optional :: initial_size Return Value type(vector_ref)
Description
Create a vector from a pre-existing array
Derived Types
type, public, extends(object) :: vector_ref
Components
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | current_size | = | 0 | ||
integer, | private | :: | maximum_size | = | 0 | ||
logical, | private | :: | verbose | = | .false. | ||
type(vector_item), | private, | allocatable | :: | items(:) |
Constructor
private function new_empty(verbose, initial_size) | |
private function new_from_array(items, verbose, initial_size) | Create a vector from a pre-existing array |
Finalizations Procedures
final :: destroy |
Type-Bound Procedures
procedure, public :: clone | |
procedure, public :: clear | |
procedure, public :: extend | |
procedure, public :: at | |
procedure, public :: find | |
procedure, public :: add_item | |
generic, public :: add => add_item | |
procedure, public :: add_array | |
procedure, public :: add_vector | |
procedure, public :: add_iter | |
generic, public :: add_list => add_array | |
generic, public :: add_list => add_vector | |
generic, public :: add_list => add_iter | |
procedure, public :: set_verbose | |
procedure, public :: get_verbose | |
procedure, public :: length | |
procedure, public :: capacity | |
procedure, public :: includes | |
procedure, public :: iter | |
procedure, public :: is_equal | |
procedure, public :: to_string |
Description
Array-based, self-extending vector containing references to arbitrary data.
type, public :: vector_iterator
Components
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(vector_ref), | public, | pointer | :: | my_vector | => | null() | |
integer, | private | :: | current | = | 0 |
Type-Bound Procedures
procedure, public :: set_vector | |
procedure, public :: more | |
procedure, public :: next | |
procedure, public :: pos |
type, private :: vector_item
Components
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
class(*), | public, | pointer | :: | stuff | => | null() |
Functions
private function new_empty(verbose, initial_size) result(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in), | optional | :: | verbose | ||
integer, | intent(in), | optional | :: | initial_size |
Return Value type(vector_ref)
private function new_from_array(items, verbose, initial_size) result(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in), | target | :: | items(:) | ||
logical, | intent(in), | optional | :: | verbose | ||
integer, | intent(in), | optional | :: | initial_size |
Return Value type(vector_ref)
Description
Create a vector from a pre-existing array
private function at(this, idx)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this | |||
integer, | intent(in) | :: | idx |
Return Value class(*), pointer
private function find(this, my_stuff, offset)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this | |||
class(*), | intent(in) | :: | my_stuff | |||
integer, | intent(in), | optional | :: | offset |
Return Value integer
private function get_verbose(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this |
Return Value logical
private function length(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this |
Return Value integer
private function capacity(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this |
Return Value integer
private function includes(this, my_stuff)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this | |||
class(*), | intent(in) | :: | my_stuff |
Return Value logical
private function iter(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this |
Return Value type(vector_iterator)
private recursive function is_equal(this, that) result(equal)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this | |||
class(*), | intent(in) | :: | that |
Return Value logical
private recursive function to_string(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this |
Return Value character(len=:), allocatable
private function more(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_iterator), | intent(in) | :: | this |
Return Value logical
private function next(this, item)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_iterator), | intent(inout) | :: | this | |||
class(*), | intent(out), | pointer | :: | item |
Return Value logical
private function pos(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_iterator), | intent(in) | :: | this |
Return Value integer
Subroutines
private subroutine clone(this, copy)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(in) | :: | this | |||
class(vector_ref), | intent(inout) | :: | copy |
private recursive subroutine destroy(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector_ref), | intent(inout) | :: | this |
private subroutine clear(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this |
private subroutine extend(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this |
private recursive subroutine add_item(this, new_stuff)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
class(*), | intent(in), | target | :: | new_stuff |
private subroutine add_array(this, items)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
class(*), | intent(in), | target | :: | items(:) |
private subroutine add_vector(this, that)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
class(vector_ref), | intent(in) | :: | that |
private subroutine add_iter(this, iter)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
class(vector_iterator) | :: | iter |
private subroutine set(this, idx, my_stuff)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | idx | |||
class(*), | intent(in), | target | :: | my_stuff |
private subroutine set_verbose(this, value)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_ref), | intent(inout) | :: | this | |||
logical | , | optional | :: | value |
private subroutine set_vector(this, my_vector)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(vector_iterator), | intent(inout) | :: | this | |||
type(vector_ref), | intent(in), | target | :: | my_vector |