dm_request_get Interface

public interface dm_request_get

Generic function to get value, unit, type, and error of a response.


Module Procedures

private pure elemental subroutine request_get_byte(request, name, value, unit, type, error, status, default)

Returns byte response as single character value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type byte.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

character(len=1), intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

character(len=1), intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_int32(request, name, value, unit, type, error, status, default)

Returns 4-byte integer response value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type int32.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

integer(kind=i4), intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

integer(kind=i4), intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_int64(request, name, value, unit, type, error, status, default)

Returns 8-byte integer response value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type int64.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

integer(kind=i8), intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

integer(kind=i8), intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_logical(request, name, value, unit, type, error, status, default)

Returns logical response value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type logical.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

logical, intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

logical, intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_real32(request, name, value, unit, type, error, status, default)

Returns 4-byte real response value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type real32.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

real(kind=r4), intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

real(kind=r4), intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_real64(request, name, value, unit, type, error, status, default)

Returns 8-byte real response value, unit, type, and error of response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.
  • E_TYPE if the response value is not of type real64.

On error, value will not be modified, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

real(kind=r8), intent(inout) :: value

Response value.

character(len=RESPONSE_UNIT_LEN), intent(out), optional :: unit

Response unit.

integer, intent(out), optional :: type

Response value type.

integer, intent(out), optional :: error

Response error.

integer, intent(out), optional :: status

Error code.

real(kind=r8), intent(in), optional :: default

Default value.

private pure elemental subroutine request_get_type(request, name, response, status, default)

Returns response of name name.

The routine returns the following error codes in status:

  • E_EMPTY if the request has no responses.
  • E_NOT_FOUND if a response of the given name does not exist.

On error, an empty response will be returned, unless default is passed.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Request type.

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

Response name.

type(response_type), intent(out) :: response

Response type.

integer, intent(out), optional :: status

Error code.

type(response_type), intent(in), optional :: default

Default response.