BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 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 00047 TrajectoryFile(const String& filename, 00048 File::OpenMode open_mode = std::ios::in); 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 00113 virtual bool flushToDisk(const std::vector<SnapShot>& buffer); 00115 00116 private: 00117 const TrajectoryFile& operator = (const TrajectoryFile& file); 00118 00119 protected: 00120 00121 //_ @name Protected Members 00123 00124 //_ The number of snapshots stored in that file 00125 Size number_of_snapshots_; 00126 00127 //_ The number of atoms covered by the snapshots 00128 Size number_of_atoms_; 00129 00131 00132 }; 00133 } // namespace BALL 00134 00135 #endif // BALL_FORMAT_TRAJECTORYFILE_H