MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / writeMemdump

Method writeMemdump

src/openms/source/FORMAT/HANDLERS/CachedMzMLHandler.cpp:32–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 void CachedMzMLHandler::writeMemdump(const MapType& exp, const String& out) const
33 {
34 std::ofstream ofs(out.c_str(), std::ios::binary);
35 Size exp_size = exp.size();
36 Size chrom_size = exp.getChromatograms().size();
37 int file_identifier = CACHED_MZML_FILE_IDENTIFIER;
38 ofs.write((char*)&file_identifier, sizeof(file_identifier));
39
40 startProgress(0, exp.size() + exp.getChromatograms().size(), "storing binary data");
41 for (Size i = 0; i < exp.size(); i++)
42 {
43 setProgress(i);
44 writeSpectrum_(exp[i], ofs);
45 }
46
47 for (Size i = 0; i < exp.getChromatograms().size(); i++)
48 {
49 setProgress(i);
50 writeChromatogram_(exp.getChromatograms()[i], ofs);
51 }
52
53 ofs.write((char*)&exp_size, sizeof(exp_size));
54 ofs.write((char*)&chrom_size, sizeof(chrom_size));
55 ofs.close();
56 endProgress();
57 }
58
59 void CachedMzMLHandler::readMemdump(MapType& exp_reading, const String& filename) const
60 {

Callers 5

main_Method · 0.80
main_Method · 0.80
storeMethod · 0.80
cacheFileFunction · 0.80

Calls 4

getChromatogramsMethod · 0.80
sizeMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by 1

cacheFileFunction · 0.64