Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | buffer(:) | |||
type(StringVariableMap), | intent(inout) | :: | map | |||
integer, | intent(out), | optional | :: | rc |
subroutine StringVariableMap_deserialize(buffer, map, rc) integer, intent(in) :: buffer(:) type (StringVariableMap), intent(inout) :: map integer, optional, intent(out) :: rc character(len=:),allocatable :: key integer :: length,n,n0,n1,n2, v_type type (Variable) :: v type (CoordinateVariable) :: c integer :: status n = 1 call deserialize_intrinsic(buffer(n:),length) _ASSERT(length <= size(buffer), "stringVarmap length does not match") n0 = serialize_buffer_length(length) n = n + n0 length = length - n0 map = StringVariableMap() do while (length > 0) call deserialize_intrinsic(buffer(n:),key) n1 = serialize_buffer_length(key) n = n + n1 ! the first one is length, the second one is type call deserialize_intrinsic(buffer(n:),n2) call deserialize_intrinsic(buffer(n+1:),v_type) if (v_type == Variable_SERIALIZE_TYPE) then call Variable_deserialize(buffer(n:n+n2-1),v, status) _VERIFY(status) call map%insert(key,v) else if (v_type == Coord_SERIALIZE_TYPE) then call CoordinateVariable_deserialize(buffer(n:n+n2-1),c, status) _VERIFY(status) call map%insert(key,c) endif n = n + n2 length = length - n1 - n2 deallocate(key) enddo _RETURN(_SUCCESS) end subroutine StringVariableMap_deserialize