AbstractSocket.F90 Source File


Files dependent on this one

sourcefile~~abstractsocket.f90~~AfferentGraph sourcefile~abstractsocket.f90 AbstractSocket.F90 sourcefile~abstractdirectoryservice.f90 AbstractDirectoryService.F90 sourcefile~abstractdirectoryservice.f90->sourcefile~abstractsocket.f90 sourcefile~abstractsocketvector.f90 AbstractSocketVector.F90 sourcefile~abstractsocketvector.f90->sourcefile~abstractsocket.f90 sourcefile~baseserver.f90 BaseServer.F90 sourcefile~baseserver.f90->sourcefile~abstractsocket.f90 sourcefile~basethread.f90 BaseThread.F90 sourcefile~basethread.f90->sourcefile~abstractsocket.f90 sourcefile~clientthread.f90 ClientThread.F90 sourcefile~clientthread.f90->sourcefile~abstractsocket.f90 sourcefile~directoryservice.f90 DirectoryService.F90 sourcefile~directoryservice.f90->sourcefile~abstractsocket.f90 sourcefile~fastclientthread.f90 FastClientThread.F90 sourcefile~fastclientthread.f90->sourcefile~abstractsocket.f90 sourcefile~integersocketmap.f90 IntegerSocketMap.F90 sourcefile~integersocketmap.f90->sourcefile~abstractsocket.f90 sourcefile~mockclientthread.f90 MockClientThread.F90 sourcefile~mockclientthread.f90->sourcefile~abstractsocket.f90 sourcefile~mockserverthread.f90 MockServerThread.F90 sourcefile~mockserverthread.f90->sourcefile~abstractsocket.f90 sourcefile~mocksocket.f90 MockSocket.F90 sourcefile~mocksocket.f90->sourcefile~abstractsocket.f90 sourcefile~mpiserver.f90 MpiServer.F90 sourcefile~mpiserver.f90->sourcefile~abstractsocket.f90 sourcefile~mpisocket.f90 MpiSocket.F90 sourcefile~mpisocket.f90->sourcefile~abstractsocket.f90 sourcefile~multicommserver.f90 MultiCommServer.F90 sourcefile~multicommserver.f90->sourcefile~abstractsocket.f90 sourcefile~multigroupserver.f90 MultiGroupServer.F90 sourcefile~multigroupserver.f90->sourcefile~abstractsocket.f90 sourcefile~multilayerserver.f90 MultiLayerServer.F90 sourcefile~multilayerserver.f90->sourcefile~abstractsocket.f90 sourcefile~openmpserver.f90 OpenMPServer.F90 sourcefile~openmpserver.f90->sourcefile~abstractsocket.f90 sourcefile~pfio.f90 pFIO.F90 sourcefile~pfio.f90->sourcefile~abstractsocket.f90 sourcefile~serverthread.f90 ServerThread.F90 sourcefile~serverthread.f90->sourcefile~abstractsocket.f90 sourcefile~simplesocket.f90 SimpleSocket.F90 sourcefile~simplesocket.f90->sourcefile~abstractsocket.f90 sourcefile~test_client.pf Test_Client.pf sourcefile~test_client.pf->sourcefile~abstractsocket.f90 sourcefile~test_directoryservice.pf Test_DirectoryService.pf sourcefile~test_directoryservice.pf->sourcefile~abstractsocket.f90 sourcefile~test_serverthread.pf Test_ServerThread.pf sourcefile~test_serverthread.pf->sourcefile~abstractsocket.f90 sourcefile~test_simplesocket.pf Test_SimpleSocket.pf sourcefile~test_simplesocket.pf->sourcefile~abstractsocket.f90

Source Code

module pFIO_AbstractSocketMod
   implicit none
   private

   public :: AbstractSocket

   type, abstract :: AbstractSocket
   contains
      procedure (receive), deferred :: receive
      procedure (send), deferred :: send

      procedure (put), deferred :: put
      procedure (get), deferred :: get
      procedure (to_string), deferred :: to_string
   end type AbstractSocket

   abstract interface


      function receive(this, rc) result(message)
         use pFIO_AbstractMessageMod
         import AbstractSocket
         implicit none
         class (AbstractMessage), pointer :: message
         class (AbstractSocket), intent(inout) :: this
         integer, optional, intent(out) :: rc
      end function receive


      subroutine send(this, message, rc)
         use pFIO_AbstractMessageMod
         import AbstractSocket
         implicit none
         class (AbstractSocket), target, intent(inout) :: this
         class (AbstractMessage), intent(in) :: message
         integer, optional, intent(out) :: rc
      end subroutine send


      function put(this, request_id, local_reference, rc) result(handle)
         use pFIO_AbstractDataReferenceMod
         use pFIO_AbstractRequestHandleMod
         import AbstractSocket
         class (AbstractRequestHandle), allocatable :: handle
         class (AbstractSocket), intent(inout) :: this
         integer, intent(in) :: request_id
         class (AbstractDataReference), intent(in) :: local_reference
         integer, optional, intent(out) :: rc
      end function put

      
      function get(this, request_id, local_reference, rc) result(handle)
         use pFIO_AbstractDataReferenceMod
         use pFIO_AbstractRequestHandleMod
         import AbstractSocket
         class (AbstractRequestHandle), allocatable :: handle
         class (AbstractSocket), target, intent(inout) :: this
         integer, intent(in) :: request_id
         class (AbstractDataReference), intent(in) :: local_reference
         integer, optional, intent(out) :: rc
      end function get


      function to_string(this) result(string)
         import AbstractSocket
         class (AbstractSocket), intent(in) :: this
         character(len=:), allocatable :: string
      end function to_string

   end interface

end module pFIO_AbstractSocketMod