Lines Matching full:descriptor
1 //===-- runtime/descriptor-io.h ---------------------------------*- C++ -*-===//
14 #include "descriptor.h"
23 inline A &ExtractElement(IoStatementState &io, const Descriptor &descriptor, in ExtractElement() argument
25 A *p{descriptor.Element<A>(subscripts)}; in ExtractElement()
32 // Per-category descriptor-based I/O templates
36 IoStatementState &io, const Descriptor &descriptor) { in FormattedIntegerIO() argument
37 std::size_t numElements{descriptor.Elements()}; in FormattedIntegerIO()
39 descriptor.GetLowerBounds(subscripts); in FormattedIntegerIO()
42 A &x{ExtractElement<A>(io, descriptor, subscripts)}; in FormattedIntegerIO()
47 } else if (edit->descriptor != DataEdit::ListDirectedNullValue) { in FormattedIntegerIO()
53 if (!descriptor.IncrementSubscripts(subscripts) && j + 1 < numElements) { in FormattedIntegerIO()
66 IoStatementState &io, const Descriptor &descriptor) { in FormattedRealIO() argument
67 std::size_t numElements{descriptor.Elements()}; in FormattedRealIO()
69 descriptor.GetLowerBounds(subscripts); in FormattedRealIO()
73 RawType &x{ExtractElement<RawType>(io, descriptor, subscripts)}; in FormattedRealIO()
78 } else if (edit->descriptor != DataEdit::ListDirectedNullValue) { in FormattedRealIO()
83 if (!descriptor.IncrementSubscripts(subscripts) && j + 1 < numElements) { in FormattedRealIO()
96 IoStatementState &io, const Descriptor &descriptor) { in FormattedComplexIO() argument
97 std::size_t numElements{descriptor.Elements()}; in FormattedComplexIO()
99 descriptor.GetLowerBounds(subscripts); in FormattedComplexIO()
104 RawType *x{&ExtractElement<RawType>(io, descriptor, subscripts)}; in FormattedComplexIO()
107 rEdit.descriptor = DataEdit::ListDirectedRealPart; in FormattedComplexIO()
108 iEdit.descriptor = DataEdit::ListDirectedImaginaryPart; in FormattedComplexIO()
122 } else if (edit->descriptor == DataEdit::ListDirectedNullValue) { in FormattedComplexIO()
130 if (!descriptor.IncrementSubscripts(subscripts) && j + 1 < numElements) { in FormattedComplexIO()
140 IoStatementState &io, const Descriptor &descriptor) { in FormattedCharacterIO() argument
141 std::size_t numElements{descriptor.Elements()}; in FormattedCharacterIO()
143 descriptor.GetLowerBounds(subscripts); in FormattedCharacterIO()
144 std::size_t length{descriptor.ElementBytes() / sizeof(A)}; in FormattedCharacterIO()
147 A *x{&ExtractElement<A>(io, descriptor, subscripts)}; in FormattedCharacterIO()
158 if (edit->descriptor != DataEdit::ListDirectedNullValue) { in FormattedCharacterIO()
167 if (!descriptor.IncrementSubscripts(subscripts) && j + 1 < numElements) { in FormattedCharacterIO()
177 IoStatementState &io, const Descriptor &descriptor) { in FormattedLogicalIO() argument
178 std::size_t numElements{descriptor.Elements()}; in FormattedLogicalIO()
180 descriptor.GetLowerBounds(subscripts); in FormattedLogicalIO()
183 A &x{ExtractElement<A>(io, descriptor, subscripts)}; in FormattedLogicalIO()
194 if (edit->descriptor != DataEdit::ListDirectedNullValue) { in FormattedLogicalIO()
206 if (!descriptor.IncrementSubscripts(subscripts) && j + 1 < numElements) { in FormattedLogicalIO()
215 static bool DescriptorIO(IoStatementState &io, const Descriptor &descriptor) { in DescriptorIO() argument
225 std::size_t elementBytes{descriptor.ElementBytes()}; in DescriptorIO()
227 descriptor.GetLowerBounds(subscripts); in DescriptorIO()
228 std::size_t numElements{descriptor.Elements()}; in DescriptorIO()
229 if (descriptor.IsContiguous()) { // contiguous unformatted I/O in DescriptorIO()
230 char &x{ExtractElement<char>(io, descriptor, subscripts)}; in DescriptorIO()
239 char &x{ExtractElement<char>(io, descriptor, subscripts)}; in DescriptorIO()
249 if (!descriptor.IncrementSubscripts(subscripts) && in DescriptorIO()
257 } else if (auto catAndKind{descriptor.type().GetCategoryAndKind()}) { in DescriptorIO()
263 return FormattedIntegerIO<std::int8_t, DIR>(io, descriptor); in DescriptorIO()
265 return FormattedIntegerIO<std::int16_t, DIR>(io, descriptor); in DescriptorIO()
267 return FormattedIntegerIO<std::int32_t, DIR>(io, descriptor); in DescriptorIO()
269 return FormattedIntegerIO<std::int64_t, DIR>(io, descriptor); in DescriptorIO()
271 return FormattedIntegerIO<common::uint128_t, DIR>(io, descriptor); in DescriptorIO()
274 "DescriptorIO: Unimplemented INTEGER kind (%d) in descriptor", in DescriptorIO()
281 return FormattedRealIO<2, DIR>(io, descriptor); in DescriptorIO()
283 return FormattedRealIO<3, DIR>(io, descriptor); in DescriptorIO()
285 return FormattedRealIO<4, DIR>(io, descriptor); in DescriptorIO()
287 return FormattedRealIO<8, DIR>(io, descriptor); in DescriptorIO()
289 return FormattedRealIO<10, DIR>(io, descriptor); in DescriptorIO()
292 return FormattedRealIO<16, DIR>(io, descriptor); in DescriptorIO()
295 "DescriptorIO: Unimplemented REAL kind (%d) in descriptor", kind); in DescriptorIO()
301 return FormattedComplexIO<2, DIR>(io, descriptor); in DescriptorIO()
303 return FormattedComplexIO<3, DIR>(io, descriptor); in DescriptorIO()
305 return FormattedComplexIO<4, DIR>(io, descriptor); in DescriptorIO()
307 return FormattedComplexIO<8, DIR>(io, descriptor); in DescriptorIO()
309 return FormattedComplexIO<10, DIR>(io, descriptor); in DescriptorIO()
312 return FormattedComplexIO<16, DIR>(io, descriptor); in DescriptorIO()
315 "DescriptorIO: Unimplemented COMPLEX kind (%d) in descriptor", in DescriptorIO()
322 return FormattedCharacterIO<char, DIR>(io, descriptor); in DescriptorIO()
326 "DescriptorIO: Unimplemented CHARACTER kind (%d) in descriptor", in DescriptorIO()
333 return FormattedLogicalIO<std::int8_t, DIR>(io, descriptor); in DescriptorIO()
335 return FormattedLogicalIO<std::int16_t, DIR>(io, descriptor); in DescriptorIO()
337 return FormattedLogicalIO<std::int32_t, DIR>(io, descriptor); in DescriptorIO()
339 return FormattedLogicalIO<std::int64_t, DIR>(io, descriptor); in DescriptorIO()
342 "DescriptorIO: Unimplemented LOGICAL kind (%d) in descriptor", in DescriptorIO()
349 static_cast<int>(descriptor.type().raw())); in DescriptorIO()
353 io.GetIoErrorHandler().Crash("DescriptorIO: Bad type code (%d) in descriptor", in DescriptorIO()
354 static_cast<int>(descriptor.type().raw())); in DescriptorIO()