trajectoryFile.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: trajectoryFile.h,v 1.21.18.1 2007/03/25 21:23:42 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_FORMAT_TRAJECTORYFILE_H
00008 #define BALL_FORMAT_TRAJECTORYFILE_H
00009 
00010 #ifndef BALL_SYSTEM_FILE_H
00011 # include <BALL/SYSTEM/file.h>
00012 #endif
00013 
00014 #ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
00015 # include <BALL/MOLMEC/COMMON/snapShot.h>
00016 #endif
00017 
00018 namespace BALL
00019 {
00020   class SnapShot;
00021   class SnapShotManager;
00022 
00030   class BALL_EXPORT TrajectoryFile
00031     : public File
00032   {
00033 
00034     public:
00035 
00037 
00038 
00040     TrajectoryFile()
00041       ;
00042 
00044     TrajectoryFile(const TrajectoryFile& file)
00045       ;
00046 
00053     TrajectoryFile(const String& filename,
00054       File::OpenMode open_mode = std::ios::in)
00055       throw(Exception::FileNotFound);
00056 
00058     virtual ~TrajectoryFile()
00059       ;
00060 
00062 
00063 
00064     
00066     const TrajectoryFile& operator = (const TrajectoryFile& file)
00067       ;
00068 
00070     virtual void clear()
00071       ;
00072 
00074 
00075 
00076 
00078     bool operator == (const TrajectoryFile& file) const
00079       ;
00080 
00082 
00083 
00084 
00088     Size getNumberOfSnapShots() const
00089       ;
00090 
00094     Size getNumberOfAtoms() const
00095       ;
00096 
00098 
00099 
00100 
00104     virtual bool readHeader()
00105       ;
00106 
00110     virtual bool writeHeader()
00111       ;
00112 
00118     virtual bool append(const SnapShot& snapshot)
00119       ;
00120 
00125     virtual bool read(SnapShot& snapshot)
00126       ;
00127 
00132     virtual bool flushToDisk(const std::vector<SnapShot>& buffer)
00133       throw(File::CannotWrite);
00135 
00136     protected:
00137 
00138     //_ @name Protected Members
00140 
00141     //_ The number of snapshots stored in that file
00142     Size number_of_snapshots_;
00143     
00144     //_ The number of atoms covered by the snapshots
00145     Size number_of_atoms_;
00146     
00148     
00149   };
00150 } // namespace BALL
00151 
00152 #endif //  BALL_FORMAT_TRAJECTORYFILE_H