MockServerThread.F90 Source File


This file depends on

sourcefile~~mockserverthread.f90~~EfferentGraph sourcefile~mockserverthread.f90 MockServerThread.F90 sourcefile~abstractmessage.f90 AbstractMessage.F90 sourcefile~mockserverthread.f90->sourcefile~abstractmessage.f90 sourcefile~abstractsocket.f90 AbstractSocket.F90 sourcefile~mockserverthread.f90->sourcefile~abstractsocket.f90 sourcefile~addextcollectionmessage.f90 AddExtCollectionMessage.F90 sourcefile~mockserverthread.f90->sourcefile~addextcollectionmessage.f90 sourcefile~donemessage.f90 DoneMessage.F90 sourcefile~mockserverthread.f90->sourcefile~donemessage.f90 sourcefile~idmessage.f90 IDMessage.F90 sourcefile~mockserverthread.f90->sourcefile~idmessage.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~mockserverthread.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~messagevisitor.f90 MessageVisitor.F90 sourcefile~mockserverthread.f90->sourcefile~messagevisitor.f90 sourcefile~prefetchdatamessage.f90 PrefetchDataMessage.F90 sourcefile~mockserverthread.f90->sourcefile~prefetchdatamessage.f90 sourcefile~prefetchdonemessage.f90 PrefetchDoneMessage.F90 sourcefile~mockserverthread.f90->sourcefile~prefetchdonemessage.f90 sourcefile~serverthread.f90 ServerThread.F90 sourcefile~mockserverthread.f90->sourcefile~serverthread.f90 sourcefile~terminatemessage.f90 TerminateMessage.F90 sourcefile~mockserverthread.f90->sourcefile~terminatemessage.f90

Files dependent on this one

sourcefile~~mockserverthread.f90~~AfferentGraph sourcefile~mockserverthread.f90 MockServerThread.F90 sourcefile~test_simplesocket.pf Test_SimpleSocket.pf sourcefile~test_simplesocket.pf->sourcefile~mockserverthread.f90

Source Code

#include "MAPL_ErrLog.h"
#include "unused_dummy.H"
module MockServerThreadMod
   use MAPL_ExceptionHandling
   use pFIO_ServerThreadMod
   use pFIO_AbstractMessageMod
   use pFIO_MessageVisitorMod
   use pFIO_AbstractSocketMod

   use pFIO_TerminateMessageMod
   use pFIO_DoneMessageMod
   use pFIO_PrefetchDoneMessageMod
   use pFIO_AddExtCollectionMessageMod
   use pFIO_IdMessageMod
   use pFIO_PrefetchDataMessageMod

   implicit none
   private

   public :: MockServerThread

   type, extends(ServerThread) :: MockServerThread
      character(len=:), allocatable :: log
   contains
      procedure :: prefix
      procedure :: handle_Terminate
      procedure :: handle_Done
      procedure :: handle_Done_prefetch
      procedure :: handle_AddExtCollection
      procedure :: handle_PrefetchData
   end type MockServerThread

   interface MockServerThread
      module procedure new_MockServerThread
   end interface MockServerThread

contains

   function new_MockServerThread(sckt) result(s)
      type (MockServerThread) :: s
      class (AbstractSocket), target, intent(in) :: sckt
      call s%set_connection(sckt)
   end function new_MockServerThread

   subroutine prefix(this, string)
      class (MockServerThread), intent(inout) :: this
      character(len=*), intent(in) :: string

      if (allocated(this%log)) then
         this%log = this%log // ' :: ' // string
      else
         this%log = string
      end if

   end subroutine prefix

   subroutine handle_Terminate(this, message, rc)
      class (MockServerThread), intent(inout) :: this
      type (TerminateMessage), intent(in) :: message
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(message)
      call this%prefix('handle_Terminate()')
      call this%set_terminate()
      _RETURN(_SUCCESS)
   end subroutine handle_Terminate

   subroutine handle_Done(this, message, rc)
      class (MockServerThread), target, intent(inout) :: this
      type (DoneMessage), intent(in) :: message
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(message)
      call this%prefix('handle_Done()')
      _RETURN(_SUCCESS)
   end subroutine handle_Done

   subroutine handle_Done_prefetch(this, message, rc)
      class (MockServerThread), target, intent(inout) :: this
      type (PrefetchDoneMessage), intent(in) :: message
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(message)
      call this%prefix('handle_Done_prefetch()')
      _RETURN(_SUCCESS)
   end subroutine handle_Done_prefetch

   subroutine handle_AddExtCollection(this, message, rc)
      class (MockServerThread), target, intent(inout) :: this
      type (AddExtCollectionMessage), intent(in) :: message
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(message)

      call this%prefix('handle_AddExtCollection()')
      _RETURN(_SUCCESS)
   end subroutine handle_AddExtCollection

   subroutine handle_PrefetchData(this, message, rc)
      class (MockServerThread), target, intent(inout) :: this
      type (PrefetchDataMessage), intent(in) :: message
      integer, optional, intent(out) :: rc

      _UNUSED_DUMMY(message)
      call this%prefix('handle_PrefetchData()')
      _RETURN(_SUCCESS)
   end subroutine handle_PrefetchData

end module MockServerThreadMod