StringVector_serialize Subroutine

public subroutine StringVector_serialize(strVec, buffer)

Arguments

Type IntentOptional Attributes Name
type(StringVector), intent(in) :: strVec
integer, intent(inout), allocatable :: buffer(:)

Calls

proc~~stringvector_serialize~~CallsGraph proc~stringvector_serialize StringVector_serialize begin begin proc~stringvector_serialize->begin interface~serialize_buffer_length serialize_buffer_length proc~stringvector_serialize->interface~serialize_buffer_length interface~serialize_intrinsic serialize_intrinsic proc~stringvector_serialize->interface~serialize_intrinsic next next proc~stringvector_serialize->next of of proc~stringvector_serialize->of

Called by

proc~~stringvector_serialize~~CalledByGraph proc~stringvector_serialize StringVector_serialize none~serialize~21 FileMetadata%serialize none~serialize~21->proc~stringvector_serialize none~serialize~27 Variable%serialize none~serialize~21->none~serialize~27 proc~stringvariablemap_serialize StringVariableMap_serialize none~serialize~21->proc~stringvariablemap_serialize none~serialize~27->proc~stringvector_serialize none~serialize~16 CoordinateVariable%serialize none~serialize~16->none~serialize~27 proc~historycollectionvector_serialize HistoryCollectionVector_serialize proc~historycollectionvector_serialize->none~serialize~21 proc~stringvariablemap_serialize->none~serialize~27 proc~test_serialize~2 test_serialize proc~test_serialize~2->none~serialize~21 proc~test_serialize~3 test_serialize proc~test_serialize~3->none~serialize~27 proc~stringvariablemap_get_length StringVariableMap_get_length proc~stringvariablemap_get_length->proc~stringvariablemap_serialize proc~test_serialize~4 test_serialize proc~test_serialize~4->none~serialize~16

Source Code

   subroutine StringVector_serialize(strVec,buffer)
       type (StringVector) ,intent(in):: strVec
       integer, allocatable,intent(inout) :: buffer(:)
       type (StringVectorIterator) :: iter
       character(len=:),pointer :: str
       integer :: length
      
       if (allocated(buffer)) deallocate(buffer)
       allocate(buffer(0))
       iter = strVec%begin()
       do while (iter /= strVec%end())
          str => iter%of()
          buffer=[buffer,serialize_intrinsic(str)]
          call iter%next()
       enddo
       length = serialize_buffer_length(length) + size(buffer)
       buffer = [serialize_intrinsic(length),buffer]
    end subroutine StringVector_serialize