| 1 |
tim |
1819 |
#ifndef IO_DUMPWRITER_HPP |
| 2 |
|
|
#define IO_DUMPWRITER_HPP |
| 3 |
|
|
|
| 4 |
|
|
#define _LARGEFILE_SOURCE64 |
| 5 |
|
|
#ifndef _FILE_OFFSET_BITS |
| 6 |
|
|
#define _FILE_OFFSET_BITS 64 |
| 7 |
|
|
#endif |
| 8 |
|
|
#include <iostream> |
| 9 |
|
|
#include <fstream> |
| 10 |
|
|
#include <string> |
| 11 |
|
|
#include <string.h> |
| 12 |
|
|
#include <stdio.h> |
| 13 |
|
|
#include <stdlib.h> |
| 14 |
|
|
#include <unistd.h> |
| 15 |
|
|
#include <sys/types.h> |
| 16 |
|
|
#include <sys/stat.h> |
| 17 |
|
|
|
| 18 |
|
|
#include "primitives/Atom.hpp" |
| 19 |
|
|
#include "brains/SimInfo.hpp" |
| 20 |
|
|
#include "brains/Thermo.hpp" |
| 21 |
|
|
#include "primitives/StuntDouble.hpp" |
| 22 |
|
|
|
| 23 |
|
|
namespace oopse { |
| 24 |
|
|
|
| 25 |
|
|
/** |
| 26 |
|
|
* @class DumpWriter DumpWriter.hpp "io/DumpWriter.hpp" |
| 27 |
|
|
* @todo |
| 28 |
|
|
*/ |
| 29 |
|
|
class DumpWriter{ |
| 30 |
|
|
|
| 31 |
|
|
public: |
| 32 |
|
|
DumpWriter(SimInfo* info, const std::string& filename); |
| 33 |
|
|
~DumpWriter(); |
| 34 |
|
|
|
| 35 |
|
|
void write() { |
| 36 |
|
|
writeFrame(dumpFile_); |
| 37 |
|
|
} |
| 38 |
|
|
|
| 39 |
|
|
private: |
| 40 |
|
|
void writeFrame(std::ostream& os); |
| 41 |
|
|
void writeCommentLine(std::ostream& os, Snapshot* s); |
| 42 |
|
|
SimInfo* info_; |
| 43 |
|
|
std::string filename_; |
| 44 |
|
|
std::ofstream dumpFile_; |
| 45 |
|
|
|
| 46 |
|
|
}; |
| 47 |
|
|
|
| 48 |
|
|
} |
| 49 |
|
|
#endif //#define IO_DUMPWRITER_HPP |