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 get get proc~stringvector_serialize->get 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

Called by

proc~~stringvector_serialize~~CalledByGraph proc~stringvector_serialize StringVector_serialize none~serialize~10 Variable%serialize none~serialize~10->proc~stringvector_serialize none~serialize~25 FileMetadata%serialize none~serialize~25->proc~stringvector_serialize none~serialize~25->none~serialize~10 proc~stringvariablemap_serialize StringVariableMap_serialize none~serialize~25->proc~stringvariablemap_serialize none~serialize~19 CoordinateVariable%serialize none~serialize~19->none~serialize~10 proc~historycollectionvector_serialize HistoryCollectionVector_serialize proc~historycollectionvector_serialize->none~serialize~25 proc~stringvariablemap_serialize->none~serialize~10 proc~test_serialize~4 test_serialize proc~test_serialize~4->none~serialize~25 proc~test_serialize~5 test_serialize proc~test_serialize~5->none~serialize~10 proc~stringvariablemap_get_length StringVariableMap_get_length proc~stringvariablemap_get_length->proc~stringvariablemap_serialize proc~test_serialize~6 test_serialize proc~test_serialize~6->none~serialize~19

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%get()
          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