00001
00002
00003
00004
00005 #ifndef BALL_FORMAT_TRAJECTORYFILE_H
00006 #define BALL_FORMAT_TRAJECTORYFILE_H
00007
00008 #ifndef BALL_SYSTEM_FILE_H
00009 # include <BALL/SYSTEM/file.h>
00010 #endif
00011
00012 #ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
00013 # include <BALL/MOLMEC/COMMON/snapShot.h>
00014 #endif
00015
00016 namespace BALL
00017 {
00018 class SnapShot;
00019 class SnapShotManager;
00020
00028 class BALL_EXPORT TrajectoryFile
00029 : public File
00030 {
00031
00032 public:
00033
00035
00036
00038 TrajectoryFile();
00039
00046 TrajectoryFile(const String& filename,
00047 File::OpenMode open_mode = std::ios::in)
00048 throw(Exception::FileNotFound);
00049
00051 virtual ~TrajectoryFile();
00052
00054
00055
00056
00058 virtual void clear();
00059
00061
00062
00063
00065 bool operator == (const TrajectoryFile& file) const;
00066
00068
00069
00070
00074 Size getNumberOfSnapShots() const;
00075
00079 Size getNumberOfAtoms() const;
00080
00082
00083
00084
00088 virtual bool readHeader();
00089
00093 virtual bool writeHeader();
00094
00100 virtual bool append(const SnapShot& snapshot);
00101
00106 virtual bool read(SnapShot& snapshot);
00107
00112 virtual bool flushToDisk(const std::vector<SnapShot>& buffer)
00113 throw(File::CannotWrite);
00115
00116 private:
00117 const TrajectoryFile& operator = (const TrajectoryFile& file);
00118
00119 protected:
00120
00121
00123
00124
00125 Size number_of_snapshots_;
00126
00127
00128 Size number_of_atoms_;
00129
00131
00132 };
00133 }
00134
00135 #endif // BALL_FORMAT_TRAJECTORYFILE_H