jplus-0.4.5
src/trjfile.h
Go to the documentation of this file.
00001 #include <fstream>
00002 #include <string>
00003 
00005 class trjfile {
00006  protected:
00008   int neq;
00010   std::fstream trj;
00011  public:
00012   
00014   trjfile();
00015 
00022   bool open(std::string path, bool create=true);
00023   
00025   bool close();
00026 
00029   bool good();
00030 
00039   bool saveFrame(const int neq, const double &T, const double* data);
00040   
00043   bool hasNextFrame();
00044 
00048   int getNEQ();
00049 
00054   bool loadFrame(double &T, double* data);
00055 
00058   int size();
00059 
00063   bool toFrame(int frame);
00064 
00065  protected:
00067   std::streampos header_size();
00068   
00070   std::streampos frame_size();
00071 
00075   void setHeader(int id, int neq);
00076 
00077 };