fdoc

functionof_classpureprivate

pure logical function of_class(e, entity)

True if entity e is of class entity, as written in a link. Any entity matches ''.

Arguments

NameTypeIntentAttributesDescription
etype(entity_t)in

the entity

entitycharacter(len=*)in

the class, in lowercase

Result

NameTypeAttributesDescription
of_classlogical

Calls

Source

Show the code
pure logical function of_class(e, entity)
    type(entity_t), intent(in) :: e         !! the entity
    character(len=*), intent(in) :: entity  !! the class, in lowercase

    select case (entity)
    case ('')
        of_class = .true.
    case ('module')
        of_class = e%kind == E_MODULE
    case ('submodule')
        of_class = e%kind == E_SUBMODULE
    case ('type')
        of_class = e%kind == E_TYPE
    case ('procedure', 'proc')
        of_class = is_procedure(e%kind)
    case ('subroutine')
        of_class = e%kind == E_SUBROUTINE
    case ('function')
        of_class = e%kind == E_FUNCTION
    case ('file', 'sourcefile')
        of_class = e%kind == E_FILE
    case ('interface')
        of_class = e%kind == E_INTERFACE .or. e%iface == IFACE_EXPLICIT
    case ('absinterface')
        of_class = e%iface == IFACE_ABSTRACT
    case ('program')
        of_class = e%kind == E_PROGRAM
    case ('block')
        of_class = e%kind == E_BLOCKDATA
    case ('namelist')
        of_class = e%kind == E_NAMELIST
    case ('variable')
        of_class = e%kind == E_VARIABLE
    case ('bound')
        of_class = e%kind == E_BOUNDPROC
    case ('final')
        of_class = e%kind == E_FINAL
    case ('common')
        of_class = e%kind == E_COMMON
    case default
        of_class = .false.
    end select
end function of_class

Graphs

Calls

Called by