dm_sync Module

Module for keeping track of data record synchronisation status.


Uses

  • module~~dm_sync~~UsesGraph module~dm_sync dm_sync module~dm_kind dm_kind module~dm_sync->module~dm_kind module~dm_observ dm_observ module~dm_sync->module~dm_observ module~dm_string dm_string module~dm_sync->module~dm_string module~dm_time dm_time module~dm_sync->module~dm_time module~dm_uuid dm_uuid module~dm_sync->module~dm_uuid iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_observ->module~dm_kind module~dm_observ->module~dm_time module~dm_observ->module~dm_uuid module~dm_error dm_error module~dm_observ->module~dm_error module~dm_id dm_id module~dm_observ->module~dm_id module~dm_node dm_node module~dm_observ->module~dm_node module~dm_request dm_request module~dm_observ->module~dm_request module~dm_response dm_response module~dm_observ->module~dm_response module~dm_sensor dm_sensor module~dm_observ->module~dm_sensor module~dm_target dm_target module~dm_observ->module~dm_target module~dm_util dm_util module~dm_observ->module~dm_util module~dm_string->module~dm_kind module~dm_string->module~dm_error module~dm_time->module~dm_kind module~dm_time->module~dm_error module~dm_time->module~dm_util module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii module~dm_node->module~dm_kind module~dm_node->module~dm_id module~dm_request->module~dm_kind module~dm_request->module~dm_string module~dm_request->module~dm_time module~dm_request->module~dm_error module~dm_request->module~dm_id module~dm_request->module~dm_response module~dm_request->module~dm_util module~dm_response->module~dm_kind module~dm_response->module~dm_error module~dm_response->module~dm_id module~dm_response->module~dm_util module~dm_sensor->module~dm_kind module~dm_sensor->module~dm_id module~dm_sensor->module~dm_node module~dm_target->module~dm_kind module~dm_target->module~dm_id module~dm_target->module~dm_util module~dm_util->module~dm_kind module~dm_util->module~dm_error

Used by


Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: SYNC_ID_LEN = UUID_LEN

Synchronisation id length (must equal UUID length).

integer, public, parameter :: SYNC_TYPE_NONE = 0

No type (invalid).

integer, public, parameter :: SYNC_TYPE_NODE = 1

Node.

integer, public, parameter :: SYNC_TYPE_SENSOR = 2

Sensor.

integer, public, parameter :: SYNC_TYPE_TARGET = 3

Target.

integer, public, parameter :: SYNC_TYPE_OBSERV = 4

Observation.

integer, public, parameter :: SYNC_TYPE_LOG = 5

Log.

integer, public, parameter :: SYNC_TYPE_LAST = 5

Never use this.

integer, public, parameter :: SYNC_TYPE_NAME_LEN = 6

Max. type name length.

character(len=*), public, parameter :: SYNC_TYPE_NAMES(SYNC_TYPE_NONE:SYNC_TYPE_LAST) = [character(len=SYNC_TYPE_NAME_LEN)::'none', 'node', 'sensor', 'target', 'observ', 'log']

Array of sync type names.

integer, public, parameter :: SYNC_SIZE = storage_size(sync_type())/8

Size of sync_type in bytes.


Interfaces

public interface operator (==)

Returns whether sync types are equal.

  • public pure elemental function dm_sync_equals(sync1, sync2) result(equals)

    Returns .true. if given sync types are equal.

    Arguments

    Type IntentOptional Attributes Name
    type(sync_type), intent(in) :: sync1

    First sync data.

    type(sync_type), intent(in) :: sync2

    Second sync data.

    Return Value logical


Derived Types

type, public ::  sync_type

Log, observation, node, sensor and target synchronisation type.

Components

Type Visibility Attributes Name Initial
integer, public :: type = SYNC_TYPE_NONE

Sync data type.

character(len=SYNC_ID_LEN), public :: id = ' '

Sync data id.

character(len=TIME_LEN), public :: timestamp = TIME_DEFAULT

Timestamp of last synchronisation attempt.

integer, public :: code = 0

HTTP response code of DMPACK server.

integer, public :: attempts = 0

Number of (unsuccessful) attempts to transfer.


Functions

public pure elemental function dm_sync_equals(sync1, sync2) result(equals)

Returns .true. if given sync types are equal.

Arguments

Type IntentOptional Attributes Name
type(sync_type), intent(in) :: sync1

First sync data.

type(sync_type), intent(in) :: sync2

Second sync data.

Return Value logical

public pure elemental function dm_sync_type_from_name(name) result(type)

Returns synchonisation type from given name.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Sync type name.

Return Value integer

public pure elemental function dm_sync_type_valid(type) result(valid)

Returns .true. if given sync type enumerator is valid. The type SYNC_TYPE_NONE is invalid.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Sync type enum.

Return Value logical

public pure elemental function dm_sync_valid(sync) result(valid)

Returns .true. if given sync data is valid.

Arguments

Type IntentOptional Attributes Name
type(sync_type), intent(in) :: sync

Sync type.

Return Value logical

public pure function dm_sync_name(type) result(name)

Returns name of synchronisation type.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Sync type enum.

Return Value character(len=:), allocatable

Name of sync type.


Subroutines

public subroutine dm_sync_out(sync, unit)

Prints sync type to standard output or given file unit.

Arguments

Type IntentOptional Attributes Name
type(sync_type), intent(inout) :: sync

Sync type.

integer, intent(in), optional :: unit

File unit.