metapackage_config_t Derived Type

type, public, extends(serializable_t) :: metapackage_config_t

Configuration data for metapackages


Components

Type Visibility Attributes Name Initial
type(metapackage_request_t), public :: blas

BLAS

type(metapackage_request_t), public :: hdf5

HDF5

type(metapackage_request_t), public :: minpack

fortran-lang minpack

type(metapackage_request_t), public :: mpi

Request MPI support

type(metapackage_request_t), public :: netcdf

NetCDF

type(metapackage_request_t), public :: openmp

Request OpenMP support

type(metapackage_request_t), public :: stdlib

Request stdlib support


Finalization Procedures

final :: meta_config_final

  • private subroutine meta_config_final(self)

    Arguments

    Type IntentOptional Attributes Name
    type(metapackage_config_t), intent(inout) :: self

Type-Bound Procedures

generic, public :: dump => dump_to_toml, dump_to_file, dump_to_unit

  • private subroutine srcfile_dump_to_toml(self, table, error)

    Dump dependency to toml table

    Arguments

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

    Instance of the serializable object

    type(toml_table), intent(inout) :: table

    Data structure

    type(error_t), intent(out), allocatable :: error

    Error handling

  • private subroutine dump_to_file(self, file, error, json)

    Write serializable object to file

    Arguments

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

    Instance of the dependency tree

    character(len=*), intent(in) :: file

    File name

    type(error_t), intent(out), allocatable :: error

    Error handling

    logical, intent(in), optional :: json

    Optional JSON format

  • private subroutine dump_to_unit(self, unit, error, json)

    Write serializable object to a formatted Fortran unit

    Arguments

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

    Instance of the dependency tree

    integer, intent(in) :: unit

    Formatted unit

    type(error_t), intent(out), allocatable :: error

    Error handling

    logical, intent(in), optional :: json

    Optional JSON format requested?

procedure, public :: dump_to_toml => meta_config_dump

  • private subroutine meta_config_dump(self, table, error)

    Arguments

    Type IntentOptional Attributes Name
    class(metapackage_config_t), intent(inout) :: self
    type(toml_table), intent(inout) :: table
    type(error_t), intent(out), allocatable :: error

procedure, public :: get_requests

  • private function get_requests(meta) result(requests)

    Return a list of metapackages requested for the current build

    Arguments

    Type IntentOptional Attributes Name
    class(metapackage_config_t), intent(in) :: meta

    Return Value type(metapackage_request_t), allocatable, (:)

generic, public :: load => load_from_toml, load_from_file, load_from_unit

  • private subroutine srcfile_load_from_toml(self, table, error)

    Read dependency from toml table (no checks made at this stage)

    Arguments

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

    Instance of the serializable object

    type(toml_table), intent(inout) :: table

    Data structure

    type(error_t), intent(out), allocatable :: error

    Error handling

  • private subroutine load_from_file(self, file, error, json)

    Read dependency tree from file

    Arguments

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

    Instance of the dependency tree

    character(len=*), intent(in) :: file

    File name

    type(error_t), intent(out), allocatable :: error

    Error handling

    logical, intent(in), optional :: json

    Optional JSON format

  • private subroutine load_from_unit(self, unit, error, json)

    Read dependency tree from file init JSON interpreter Read object from TOML table

    use default TOML parser

    Read object from TOML table

    Arguments

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

    Instance of the dependency tree

    integer, intent(in) :: unit

    File name

    type(error_t), intent(out), allocatable :: error

    Error handling

    logical, intent(in), optional :: json

    Optional JSON format

procedure, public :: load_from_toml => meta_config_load

  • private subroutine meta_config_load(self, table, error)

    Arguments

    Type IntentOptional Attributes Name
    class(metapackage_config_t), intent(inout) :: self
    type(toml_table), intent(inout) :: table
    type(error_t), intent(out), allocatable :: error

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

  • private function srcfile_is_same(this, that)

    Check that two source files are equal All checks passed!

    Arguments

    Type IntentOptional Attributes Name
    class(srcfile_t), intent(in) :: this
    class(serializable_t), intent(in) :: that

    Return Value logical

procedure, public :: serializable_is_same => meta_config_same

  • private function meta_config_same(this, that)

    Arguments

    Type IntentOptional Attributes Name
    class(metapackage_config_t), intent(in) :: this
    class(serializable_t), intent(in) :: that

    Return Value logical

procedure, public, non_overridable :: test_serialization

Test load/write roundtrip

  • private subroutine test_serialization(self, message, error)

    Test serialization of a serializable object Dump to scratch file Load from scratch file Check same

    Arguments

    Type IntentOptional Attributes Name
    class(serializable_t), intent(inout) :: self
    character(len=*), intent(in) :: message
    type(error_t), intent(out), allocatable :: error

Source Code

    type, extends(serializable_t) :: metapackage_config_t

        !> Request MPI support
        type(metapackage_request_t) :: mpi

        !> Request OpenMP support
        type(metapackage_request_t) :: openmp

        !> Request stdlib support
        type(metapackage_request_t) :: stdlib

        !> fortran-lang minpack
        type(metapackage_request_t) :: minpack

        !> HDF5
        type(metapackage_request_t) :: hdf5

        !> NetCDF
        type(metapackage_request_t) :: netcdf

        !> BLAS
        type(metapackage_request_t) :: blas
        
        contains
        
           procedure :: get_requests
           final     :: meta_config_final

           procedure :: serializable_is_same => meta_config_same
           procedure :: dump_to_toml        => meta_config_dump
           procedure :: load_from_toml      => meta_config_load
           
    end type metapackage_config_t