Simpatico  v1.10
tools/trajectory/TrajectoryReader.h
1 #ifndef TOOLS_TRAJECTORY_IO_H
2 #define TOOLS_TRAJECTORY_IO_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/param/ParamComposite.h> // base class
12 
13 namespace Tools
14 {
15 
16  class Configuration;
17  using namespace Util;
18 
28  {
29 
30  public:
31 
38  TrajectoryReader(Configuration& configuration, bool isBinary = false);
39 
43  virtual ~TrajectoryReader();
44 
48  bool isBinary() const;
49 
55  virtual void readHeader(std::ifstream& file){}
56 
63  virtual bool readFrame(std::ifstream& file) = 0;
64 
65  protected:
66 
71  { return *configurationPtr_; }
72 
73  private:
74 
76  Configuration* configurationPtr_;
77 
79  bool isBinary_;
80 
81  };
82 
86  inline bool TrajectoryReader::isBinary() const
87  { return isBinary_; }
88 
89 }
90 #endif
Abstract trajectory file reader.
An instantaneous molecular dynamics configuration.
Definition: Configuration.h:40
virtual void readHeader(std::ifstream &file)
Read a header (if any).
Utility classes for scientific computation.
Definition: accumulators.mod:1
Single-processor classes for pre- and post-processing MD trajectories.
bool isBinary() const
Is the file format binary (true) or text (false)?
An object that can read multiple parameters from file.
Configuration & configuration()
Return parent Configuraiton by reference.