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

Method readLongData

Src/Base/AMReX_VectorIO.cpp:90–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void amrex::readLongData (Long* data, std::size_t size, std::istream& is,
91 const IntDescriptor& id)
92{
93 if (id == FPC::NativeLongDescriptor())
94 {
95 if (!is.read(reinterpret_cast<char*>(data),
96 static_cast<std::streamsize>(size * id.numBytes())))
97 {
98 amrex::Error("Failed to read long integer data.");
99 }
100 }
101 else if (id.numBytes() == 2)
102 {
103 readIntData<Long, std::int16_t>(data, size, is, id);
104 }
105 else if (id.numBytes() == 4)
106 {
107 readIntData<Long, std::int32_t>(data, size, is, id);
108 }
109 else if (id.numBytes() == 8)
110 {
111 readIntData<Long, std::int64_t>(data, size, is, id);
112 }
113 else {
114 amrex::Error("Don't know how to work with this long type.");
115 }
116}
117
118void amrex::writeRealData (const Real* data, std::size_t size, std::ostream& os,
119 const RealDescriptor& rd)

Callers

nothing calls this directly

Calls 2

numBytesMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected