Write the stream header, the schema record and the element count.
Call this once on a freshly opened stream unit, before any field record.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=default_int), | intent(in) | :: | unit |
Stream unit opened for unformatted stream writing. |
||
| character(len=*), | intent(in) | :: | schema |
The container’s schema string. |
||
| integer(kind=default_int), | intent(in) | :: | n |
Number of live elements about to be written. |
||
| type(error_t), | intent(inout) | :: | err |
Error state. |
subroutine soa_write_prologue(unit, schema, n, err) !! Write the stream header, the schema record and the element count. !! !! Call this once on a freshly opened stream unit, before any field !! record. integer(default_int), intent(in) :: unit !! Stream unit opened for unformatted stream writing. character(len=*), intent(in) :: schema !! The container's schema string. integer(default_int), intent(in) :: n !! Number of live elements about to be written. type(error_t), intent(inout) :: err !! Error state. if (n < 0) then call err%set(ERROR_VALIDATION, "soa: cannot serialize a negative element count "// & to_char(int(n, int64))) return end if call write_header(unit, err) if (err%has_error()) return call write_array(unit, schema, err) if (err%has_error()) return call write_array(unit, [int(n, int64)], err) end subroutine soa_write_prologue