#include "MAPL_ErrLog.h" #include "unused_dummy.H" module pFIO_AddWriteDataCollectionMessageMod use MAPL_ExceptionHandling use pFIO_UtilitiesMod use pFIO_AbstractMessageMod use pFIO_FileMetadataMod use pFIO_ConstantsMod implicit none private public :: AddWriteDataCollectionMessage type, extends(AbstractMessage) :: AddWriteDataCollectionMessage type(FileMetadata) :: fmd integer :: create_mode contains procedure, nopass :: get_type_id procedure :: get_length procedure :: serialize procedure :: deserialize end type AddWriteDataCollectionMessage interface AddWriteDataCollectionMessage module procedure new_AddWriteDataCollectionMessage end interface AddWriteDataCollectionMessage contains function new_AddWriteDataCollectionMessage(fmd, mode) result(message) type (AddWriteDataCollectionMessage) :: message type(FileMetadata), intent(in) :: fmd integer, optional, intent(in) :: mode message%fmd = fmd message%create_mode = PFIO_NOCLOBBER if( present(mode)) message%create_mode = mode end function new_AddWriteDataCollectionMessage integer function get_type_id() result(type_id) type_id = ADD_WRITEDATA_COLLECTION_ID end function get_type_id integer function get_length(this) result(length) class (AddWriteDataCollectionMessage), intent(in) :: this integer,allocatable :: buffer(:) ! no-op call this%fmd%serialize(buffer) length = size(buffer) + 1 ! 1 is the create_mode end function get_length subroutine serialize(this, buffer, rc) class (AddWriteDataCollectionMessage), intent(in) :: this integer, intent(inout) :: buffer(:) ! no-op integer, optional, intent(out) :: rc integer,allocatable :: tmp_buffer(:) ! no-op integer :: status call this%fmd%serialize(tmp_buffer, status) _VERIFY(status) buffer = [tmp_buffer,serialize_intrinsic(this%create_mode)] _RETURN(_SUCCESS) end subroutine serialize subroutine deserialize(this, buffer,rc) class (AddWriteDataCollectionMessage), intent(inout) :: this integer, intent(in) :: buffer(:) integer, optional, intent(out) :: rc integer :: n, length, status n = 1 call FileMetaData_deserialize(buffer(n:), this%fmd, status) _VERIFY(status) call deserialize_intrinsic(buffer(n:), length) n = n + length call deserialize_intrinsic(buffer(n:), this%create_mode) _RETURN(_SUCCESS) end subroutine deserialize end module pFIO_AddWriteDataCollectionMessageMod