MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / writeIntData

Function writeIntData

Src/Base/AMReX_IntConv.H:23–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22 template <typename To, typename From>
23 void writeIntData (const From* data, std::size_t size, std::ostream& os,
24 const amrex::IntDescriptor& id)
25 {
26 To value;
27 bool swapEndian = (id.order() != amrex::FPC::NativeIntDescriptor().order());
28 for (std::size_t j = 0; j < size; ++j) {
29 value = static_cast<To>(data[j]);
30 if (swapEndian) { value = swapBytes(value); }
31 if (!os.write(reinterpret_cast<char const*>(&value), sizeof(To))) {
32 amrex::Error("Failed to write integer data.");
33 }
34 }
35 }
36
37 template <typename To, typename From>
38 void readIntData (To* data, std::size_t size, std::istream& is,

Callers 5

testIntIOFunction · 0.85
testFailedIntegerWriteFunction · 0.85
WriteParticlesMethod · 0.85
writeDataFunction · 0.85

Calls 3

swapBytesFunction · 0.85
orderMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected