content_adt Derived Type

type, public, abstract :: content_adt

Abstract content class to storage any contents.

A very base class that is intended to be the parent of all contents.


Source Code


Type-Bound Procedures

procedure(destroy_interface), public, deferred, pass(self) :: destroy

Destroy the content.

  • elemental subroutine destroy_interface(self) Prototype

    Destroy the content.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(inout) :: self

    The content.

procedure(is_filled_interface), public, deferred, pass(self) :: is_filled

Return storage status.

  • elemental function is_filled_interface(self) Prototype

    Return storage status.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(in) :: self

    The content.

    Return Value logical

procedure(set_interface), public, deferred, pass(self) :: set

Set the content.

  • subroutine set_interface(self, content) Prototype

    Set the content of the content.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(out) :: self

    The content.

    class(*), intent(in) :: content

    The content to be stored.

procedure(typeguard_interface), public, deferred, pass(self) :: typeguard

Check if the content type is allowed.

  • elemental function typeguard_interface(self, content) Prototype

    Check if the content type is allowed.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(in) :: self

    The content.

    class(*), intent(in) :: content

    The content to be stored.

    Return Value logical

procedure(is_equal_interface), private, deferred, pass(lhs) :: is_equal

Implement == operator.

  • elemental function is_equal_interface(lhs, rhs) Prototype

    Implement == operator.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(in) :: lhs

    Left hand side.

    class(content_adt), intent(in) :: rhs

    Rigth hand side.

    Return Value logical

generic, public :: operator(==) => is_equal

Overloading == operator.

  • elemental function is_equal_interface(lhs, rhs) Prototype

    Implement == operator.

    Arguments

    Type IntentOptional AttributesName
    class(content_adt), intent(in) :: lhs

    Left hand side.

    class(content_adt), intent(in) :: rhs

    Rigth hand side.

    Return Value logical

Source Code

type, abstract :: content_adt
  !< Abstract **content** class to storage any contents.
  !<
  !< A very base class that is intended to be the parent of all contents.
  contains
    ! public/private deferred methods
    procedure(destroy_interface),   pass(self),         deferred :: destroy   !< Destroy the content.
    procedure(is_filled_interface), pass(self),         deferred :: is_filled !< Return storage status.
    procedure(set_interface),       pass(self),         deferred :: set       !< Set the content.
    procedure(typeguard_interface), pass(self),         deferred :: typeguard !< Check if the content type is allowed.
    procedure(is_equal_interface),  pass(lhs), private, deferred :: is_equal  !< Implement `==` operator.
    ! public generics
    generic, public :: operator(==) => is_equal !< Overloading `==` operator.
endtype content_adt