object Derived Type

type, public :: object

Base (abstract) class upon which FLAP’s concrete classes are built.


Inherited by

type~~object~~InheritedByGraph type~object object type~command_line_argument command_line_argument type~command_line_argument->type~object type~command_line_arguments_group command_line_arguments_group type~command_line_arguments_group->type~object type~command_line_arguments_group->type~command_line_argument cla type~command_line_interface command_line_interface type~command_line_interface->type~object type~command_line_interface->type~command_line_arguments_group clasg

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: progname

Program name.

character(len=:), public, allocatable :: version

Program version.

character(len=:), public, allocatable :: help

Help message.

character(len=:), public, allocatable :: help_color

ANSI color of help messages.

character(len=:), public, allocatable :: help_style

ANSI style of help messages.

character(len=:), public, allocatable :: help_markdown

Longer help message, markdown formatted.

character(len=:), public, allocatable :: description

Detailed description.

character(len=:), public, allocatable :: license

License description.

character(len=:), public, allocatable :: authors

Authors list.

character(len=:), public, allocatable :: epilog

Epilogue message.

character(len=:), public, allocatable :: m_exclude

Mutually exclude other CLA(s group).

character(len=:), public, allocatable :: error_message

Meaningful error message to standard-error.

character(len=:), public, allocatable :: error_color

ANSI color of error messages.

character(len=:), public, allocatable :: error_style

ANSI style of error messages.

character(len=512), public, allocatable :: examples(:)

Examples of correct usage.

integer(kind=I4P), public :: error = 0_I4P

Error trapping flag.

integer(kind=I4P), public :: usage_lun = stderr

Output unit to print help/usage messages

integer(kind=I4P), public :: version_lun = stdout

Output unit to print version message

integer(kind=I4P), public :: error_lun = stderr

Error unit to print error messages


Type-Bound Procedures

procedure, public, pass(self) :: free_object

Free dynamic memory.

  • private elemental subroutine free_object(self)

    Free dynamic memory.

    Arguments

    Type IntentOptional Attributes Name
    class(object), intent(inout) :: self

    Object data.

procedure, public, pass(self) :: print_version

Print version.

  • private subroutine print_version(self, pref)

    Print version.

    Arguments

    Type IntentOptional Attributes Name
    class(object), intent(in) :: self

    Object data.

    character(len=*), intent(in), optional :: pref

    Prefixing string.

procedure, public, pass(self) :: print_error_message

Print meaningful error message.

  • private subroutine print_error_message(self)

    Print meaningful error message to standard-error.

    Arguments

    Type IntentOptional Attributes Name
    class(object), intent(in) :: self

    Object data.

procedure, public, pass(self) :: set_examples

Set examples of correct usage.

  • private subroutine set_examples(self, examples)

    Set examples of correct usage.

    Arguments

    Type IntentOptional Attributes Name
    class(object), intent(inout) :: self

    Object data.

    character(len=*), intent(in), optional :: examples(1:)

    Examples of correct usage.

procedure, public, pass(lhs ) :: assign_object

Assignment overloading.

  • private elemental subroutine assign_object(lhs, rhs)

    Assign two abstract objects.

    Arguments

    Type IntentOptional Attributes Name
    class(object), intent(inout) :: lhs

    Left hand side.

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

    Rigth hand side.

Source Code

type, abstract, public :: object
  !< Base (abstract) class upon which FLAP's concrete classes are built.
  character(len=:), allocatable :: progname           !< Program name.
  character(len=:), allocatable :: version            !< Program version.
  character(len=:), allocatable :: help               !< Help message.
  character(len=:), allocatable :: help_color         !< ANSI color of help messages.
  character(len=:), allocatable :: help_style         !< ANSI style of help messages.
  character(len=:), allocatable :: help_markdown      !< Longer help message, markdown formatted.
  character(len=:), allocatable :: description        !< Detailed description.
  character(len=:), allocatable :: license            !< License description.
  character(len=:), allocatable :: authors            !< Authors list.
  character(len=:), allocatable :: epilog             !< Epilogue message.
  character(len=:), allocatable :: m_exclude          !< Mutually exclude other CLA(s group).
  character(len=:), allocatable :: error_message      !< Meaningful error message to standard-error.
  character(len=:), allocatable :: error_color        !< ANSI color of error messages.
  character(len=:), allocatable :: error_style        !< ANSI style of error messages.
#ifdef __GFORTRAN__
  character(512  ), allocatable :: examples(:)        !< Examples of correct usage.
#else
  character(len=:), allocatable :: examples(:)        !< Examples of correct usage.
#endif
  integer(I4P)                  :: error=0_I4P        !< Error trapping flag.
  integer(I4P)                  :: usage_lun=stderr   !< Output unit to print help/usage messages
  integer(I4P)                  :: version_lun=stdout !< Output unit to print version message
  integer(I4P)                  :: error_lun=stderr   !< Error unit to print error messages
  contains
    ! public methods
    procedure, pass(self) :: free_object         !< Free dynamic memory.
    procedure, pass(self) :: print_version       !< Print version.
    procedure, pass(self) :: print_error_message !< Print meaningful error message.
    procedure, pass(self) :: set_examples        !< Set examples of correct usage.
    procedure, pass(lhs ) :: assign_object       !< Assignment overloading.
endtype object