MockSocket Derived Type

type, public, extends(AbstractSocket) :: MockSocket


Inherits

type~~mocksocket~~InheritsGraph type~mocksocket MockSocket type~abstractsocket AbstractSocket type~mocksocket->type~abstractsocket type~messagevector MessageVector type~mocksocket->type~messagevector messages type~mocksocketlog MockSocketLog type~mocksocket->type~mocksocketlog log type~v_wrapper~7 v_Wrapper type~messagevector->type~v_wrapper~7 elements type~abstractmessage AbstractMessage type~v_wrapper~7->type~abstractmessage item

Components

Type Visibility Attributes Name Initial
integer, public :: collection_counter = 0
real(kind=REAL32), public, allocatable :: q1
real(kind=REAL32), public, allocatable :: q2(:)
type(MessageVector), public :: messages
type(MockSocketLog), public, pointer :: log

Constructor

public interface MockSocket

  • private function new_MockSocket(log) result(socket)

    Arguments

    Type IntentOptional Attributes Name
    type(MockSocketLog), target :: log

    Return Value type(MockSocket)


Type-Bound Procedures

procedure, public :: add_message

  • private subroutine add_message(this, message)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout) :: this
    class(AbstractMessage), intent(in) :: message

procedure, public :: get

  • private function get(this, request_id, local_reference, rc) result(handle)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout), target :: this
    integer, intent(in) :: request_id
    class(AbstractDataReference), intent(in) :: local_reference
    integer, intent(out), optional :: rc

    Return Value class(AbstractRequestHandle), allocatable

procedure, public :: prefix

  • private subroutine prefix(this, string)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout), target :: this
    character(len=*), intent(in) :: string

procedure, public :: put

  • private function put(this, request_id, local_reference, rc) result(handle)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout) :: this
    integer, intent(in) :: request_id
    class(AbstractDataReference), intent(in) :: local_reference
    integer, intent(out), optional :: rc

    Return Value class(AbstractRequestHandle), allocatable

procedure, public :: receive

  • private subroutine receive(this, message, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout) :: this
    class(AbstractMessage), intent(out), allocatable :: message
    integer, intent(out), optional :: rc

procedure, public :: send

  • private subroutine send(this, message, rc)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(inout), target :: this
    class(AbstractMessage), intent(in) :: message
    integer, intent(out), optional :: rc

procedure, public :: to_string

  • private function to_string(this) result(string)

    Arguments

    Type IntentOptional Attributes Name
    class(MockSocket), intent(in) :: this

    Return Value character(len=:), allocatable

Source Code

   type, extends(AbstractSocket) :: MockSocket
      type (MessageVector) :: messages
      type (MockSocketLog), pointer :: log
      integer :: collection_counter = 0
      real(kind=REAL32), allocatable :: q1
      real(kind=REAL32), allocatable :: q2(:)
   contains
      procedure :: prefix
      procedure :: receive
      procedure :: send
      procedure :: add_message
      procedure :: put
      procedure :: get
      procedure :: to_string
   end type MockSocket