memory_backend_t Derived Type

type, public :: memory_backend_t


Components

Type Visibility Attributes Name Initial
type(memory_buffer_t), public, dimension(:), allocatable :: buffers
integer, public :: buffer_count = 0
integer, public :: max_buffers = 1000
logical, public :: enabled = .false.
real(kind=real64), public :: total_memory_used = 0.0_real64

Type-Bound Procedures

procedure, public :: initialize => memory_backend_initialize

  • private subroutine memory_backend_initialize(this, max_buffers)

    Initialize the memory backend

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(inout) :: this
    integer, intent(in), optional :: max_buffers

procedure, public :: save => memory_backend_save

  • private subroutine memory_backend_save(this, filename, data, format)

    Save data to memory buffer instead of file

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(inout) :: this
    character(len=*), intent(in) :: filename
    integer(kind=int8), intent(in), dimension(:) :: data
    character(len=*), intent(in), optional :: format

procedure, public :: get_buffer => memory_backend_get_buffer

  • private function memory_backend_get_buffer(this, filename) result(buffer)

    Retrieve a buffer by filename

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(in) :: this
    character(len=*), intent(in) :: filename

    Return Value type(memory_buffer_t)

procedure, public :: exists => memory_backend_exists

  • private function memory_backend_exists(this, filename) result(exists)

    Check if a file exists in memory backend

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(in) :: this
    character(len=*), intent(in) :: filename

    Return Value logical

procedure, public :: get_size => memory_backend_get_size

  • private function memory_backend_get_size(this, filename) result(size)

    Get size of a file in memory backend

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(in) :: this
    character(len=*), intent(in) :: filename

    Return Value integer(kind=int64)

procedure, public :: clear => memory_backend_clear

  • private subroutine memory_backend_clear(this)

    Clear all memory buffers

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(inout) :: this

procedure, public :: get_stats => memory_backend_get_stats

  • private subroutine memory_backend_get_stats(this, buffer_count, total_memory, enabled)

    Get memory backend statistics

    Arguments

    Type IntentOptional Attributes Name
    class(memory_backend_t), intent(in) :: this
    integer, intent(out), optional :: buffer_count
    real(kind=real64), intent(out), optional :: total_memory
    logical, intent(out), optional :: enabled