MockClientThread.F90 Source File


This file depends on

sourcefile~~mockclientthread.f90~~EfferentGraph sourcefile~mockclientthread.f90 MockClientThread.F90 sourcefile~abstractdatareference.f90 AbstractDataReference.F90 sourcefile~mockclientthread.f90->sourcefile~abstractdatareference.f90 sourcefile~abstractmessage.f90 AbstractMessage.F90 sourcefile~mockclientthread.f90->sourcefile~abstractmessage.f90 sourcefile~abstractrequesthandle.f90 AbstractRequestHandle.F90 sourcefile~mockclientthread.f90->sourcefile~abstractrequesthandle.f90 sourcefile~abstractsocket.f90 AbstractSocket.F90 sourcefile~mockclientthread.f90->sourcefile~abstractsocket.f90 sourcefile~addextcollectionmessage.f90 AddExtCollectionMessage.F90 sourcefile~mockclientthread.f90->sourcefile~addextcollectionmessage.f90 sourcefile~addhistcollectionmessage.f90 AddHistCollectionMessage.F90 sourcefile~mockclientthread.f90->sourcefile~addhistcollectionmessage.f90 sourcefile~basethread.f90 BaseThread.F90 sourcefile~mockclientthread.f90->sourcefile~basethread.f90 sourcefile~clientthread.f90 ClientThread.F90 sourcefile~mockclientthread.f90->sourcefile~clientthread.f90 sourcefile~collectiveprefetchdatamessage.f90 CollectivePrefetchDataMessage.F90 sourcefile~mockclientthread.f90->sourcefile~collectiveprefetchdatamessage.f90 sourcefile~collectivestagedatamessage.f90 CollectiveStageDataMessage.F90 sourcefile~mockclientthread.f90->sourcefile~collectivestagedatamessage.f90 sourcefile~donemessage.f90 DoneMessage.F90 sourcefile~mockclientthread.f90->sourcefile~donemessage.f90 sourcefile~filemetadata.f90 FileMetadata.F90 sourcefile~mockclientthread.f90->sourcefile~filemetadata.f90 sourcefile~idmessage.f90 IDMessage.F90 sourcefile~mockclientthread.f90->sourcefile~idmessage.f90 sourcefile~integerrequestmap.f90 IntegerRequestMap.F90 sourcefile~mockclientthread.f90->sourcefile~integerrequestmap.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~mockclientthread.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~mapl_keywordenforcer.f90 MAPL_KeywordEnforcer.F90 sourcefile~mockclientthread.f90->sourcefile~mapl_keywordenforcer.f90 sourcefile~messagevisitor.f90 MessageVisitor.F90 sourcefile~mockclientthread.f90->sourcefile~messagevisitor.f90 sourcefile~modifymetadatamessage.f90 ModifyMetadataMessage.F90 sourcefile~mockclientthread.f90->sourcefile~modifymetadatamessage.f90 sourcefile~prefetchdatamessage.f90 PrefetchDataMessage.F90 sourcefile~mockclientthread.f90->sourcefile~prefetchdatamessage.f90 sourcefile~simplesocket.f90 SimpleSocket.F90 sourcefile~mockclientthread.f90->sourcefile~simplesocket.f90 sourcefile~stagedatamessage.f90 StageDataMessage.F90 sourcefile~mockclientthread.f90->sourcefile~stagedatamessage.f90 sourcefile~stringvariablemap.f90 StringVariableMap.F90 sourcefile~mockclientthread.f90->sourcefile~stringvariablemap.f90 sourcefile~terminatemessage.f90 TerminateMessage.F90 sourcefile~mockclientthread.f90->sourcefile~terminatemessage.f90

Files dependent on this one

sourcefile~~mockclientthread.f90~~AfferentGraph sourcefile~mockclientthread.f90 MockClientThread.F90 sourcefile~test_client.pf Test_Client.pf sourcefile~test_client.pf->sourcefile~mockclientthread.f90

Source Code

#include "MAPL_ErrLog.h"
#include "unused_dummy.H"

module pFIO_MockClientThreadMod
   use MAPL_ExceptionHandling
   use pFIO_AbstractMessageMod
   use pFIO_AbstractSocketMod
   use pFIO_AbstractRequestHandleMod
   use pFIO_IntegerRequestMapMod
   use pFIO_MessageVisitorMod
   use pFIO_BaseThreadMod
   use pFIO_AbstractDataReferenceMod
   use mapl_KeywordEnforcerMod
   use pFIO_SimpleSocketMod
   use pFIO_FileMetadataMod

   use pFIO_TerminateMessageMod
   use pFIO_DoneMessageMod
   use pFIO_AddExtCollectionMessageMod
   use pFIO_AddHistCollectionMessageMod
   use pFIO_IdMessageMod
   use pFIO_PrefetchDataMessageMod
   use pFIO_StageDataMessageMod
   use pFIO_CollectivePrefetchDataMessageMod
   use pFIO_CollectiveStageDataMessageMod
   use pFIO_ModifyMetadataMessageMod
   use pFIO_StringVariableMapMod
   use pFIO_ClientThreadMod

   use, intrinsic :: iso_fortran_env, only: REAL32
   implicit none
   private

   public :: MockClientThread

   
   type, extends(ClientThread) :: MockClientThread
      integer :: counter = 0
   contains
      procedure :: wait
   end type MockClientThread


   interface MockClientThread
      module procedure new_MockClientThread
   end interface MockClientThread

contains

   function new_MockClientThread(sckt) result(c)
      type (MockClientThread),target :: c
      class(AbstractSocket),optional,intent(in) :: sckt
      if(present(sckt)) call c%set_connection(sckt)
   end function new_MockClientThread

   subroutine wait(this, request_id, rc)
      use pFIO_AbstractRequestHandleMod
      class (MockClientThread), target, intent(inout) :: this
      integer, intent(in) :: request_id
      integer, optional, intent(out) :: rc
      class(AbstractRequestHandle), pointer :: handle

      this%counter = this%counter + 1
      handle => this%get_RequestHandle(request_id)
      call handle%wait()
      call this%erase_RequestHandle(request_id)
      _RETURN(_SUCCESS)
   end subroutine wait

end module pFIO_MockClientThreadMod