fdoc

functionfind_childprivate

integer function find_child(list, parent, name, entity) result(found)

The child of parent named name, or 0.

Arguments

NameTypeIntentAttributesDescription
listtype(entity_list_t)in

the entities

parentintegerin

the entity

namecharacter(len=*)in

the name, in lowercase

entitycharacter(len=*)in

the class, in lowercase

Result

NameTypeAttributesDescription
foundinteger

Calls

Source

Show the code
integer function find_child(list, parent, name, entity) result(found)
    type(entity_list_t), intent(in) :: list !! the entities
    integer, intent(in) :: parent           !! the entity
    character(len=*), intent(in) :: name    !! the name, in lowercase
    character(len=*), intent(in) :: entity  !! the class, in lowercase
    integer :: k

    found = 0
    associate (e => list%box(parent)%e)
        do k = 1, size(e%children)
            if (matches(list, e%children(k), name, entity)) then
                found = e%children(k)
                return
            end if
        end do
        if (.not. allocated(e%more%inherited)) return
        do k = 1, size(e%more%inherited)
            if (matches(list, e%more%inherited(k), name, entity)) then
                found = e%more%inherited(k)
                return
            end if
        end do
    end associate
end function find_child

Graphs

Calls

Called by