toml_list_structure Derived Type

type, public, abstract :: toml_list_structure

Ordered data structure, allows iterations


Type-Bound Procedures

procedure(destroy), public, deferred :: destroy

Destroy the data structure

  • subroutine destroy(self) Prototype

    Deconstructor for data structure

    Arguments

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

    Instance of the structure

procedure(get), public, deferred :: get

Get TOML value at a given index

  • subroutine get(self, idx, ptr) Prototype

    Get TOML value at a given index

    Arguments

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

    Instance of the structure

    integer, intent(in) :: idx

    Position in the ordered structure

    class(toml_value), intent(out), pointer :: ptr

    Pointer to the stored value at given index

procedure(get_len), public, deferred :: get_len

Get number of TOML values in the structure

  • pure function get_len(self) result(length) Prototype

    Get number of TOML values in the structure

    Arguments

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

    Instance of the structure

    Return Value integer

    Current length of the ordered structure

procedure(pop), public, deferred :: pop

Remove the last element from the structure

  • subroutine pop(self, val) Prototype

    Remove the last element from the data structure

    Arguments

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

    Instance of the structure

    class(toml_value), intent(out), allocatable :: val

    TOML value to be retrieved

procedure(push_back), public, deferred :: push_back

Push back a TOML value to the structure

  • subroutine push_back(self, val) Prototype

    Push back a TOML value to the structure

    Arguments

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

    Instance of the structure

    class(toml_value), intent(inout), allocatable :: val

    TOML value to be stored

procedure(shift), public, deferred :: shift

Remove the first element from the structure

  • subroutine shift(self, val) Prototype

    Remove the first element from the data structure

    Arguments

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

    Instance of the structure

    class(toml_value), intent(out), allocatable :: val

    TOML value to be retrieved

Source Code

   type, abstract :: toml_list_structure
   contains

      !> Get number of TOML values in the structure
      procedure(get_len), deferred :: get_len

      !> Push back a TOML value to the structure
      procedure(push_back), deferred :: push_back

      !> Remove the first element from the structure
      procedure(shift), deferred :: shift

      !> Remove the last element from the structure
      procedure(pop), deferred :: pop

      !> Get TOML value at a given index
      procedure(get), deferred :: get

      !> Destroy the data structure
      procedure(destroy), deferred :: destroy

   end type toml_list_structure