Project

General

Profile

add_item Subroutine

private recursive subroutine add_item(this, new_stuff)

Arguments

Type IntentOptional AttributesName
class(vector_ref), intent(inout) :: this
class(*), intent(in), target:: new_stuff

Source Code

    recursive subroutine add_item(this, new_stuff)
        class(vector_ref),intent(inout) :: this
        class(*), target, intent(in) :: new_stuff
        if(this%get_verbose()) print *, 'vector_ref%add_item begin'
        if(this%current_size == this%maximum_size) then
            call this%extend()
        end if
        this%current_size = this%current_size + 1
        this%items(this%current_size)%stuff => new_stuff
        if(this%verbose) then
            print *, 'added to vector_ref (', this%current_size, '/', &
                     this%maximum_size, ' elements)'
        end if
        if(this%get_verbose()) print *, 'vector_ref%add_item end'
    end subroutine add_item


© 2016
self was developed by
Documentation generated by FORD