PSCF v1.4.0
fts/trajectory/TrajectoryReader.h
1#ifndef RP_TRAJECTORY_READER_H
2#define RP_TRAJECTORY_READER_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <string>
12
13namespace Pscf {
14namespace Rp {
15
31 template <int D, class T>
33 {
34
35 public:
36
37 // Protected constructor and destructor (see below).
38
49 virtual void open(std::string filename) = 0;
50
56 virtual void readHeader()
57 {};
58
67 virtual bool readFrame() = 0;
68
72 virtual void close() = 0;
73
74 protected:
75
81 TrajectoryReader(typename T::System& system)
82 : systemPtr_(&system)
83 {}
84
88 ~TrajectoryReader() = default;
89
93 typename T::System& system()
94 { return *systemPtr_; }
95
96 private:
97
101 typename T::System* systemPtr_;
102
103 };
104
105}
106}
107#endif
~TrajectoryReader()=default
Destructor.
T::System & system()
Return reference to parent system.
virtual void open(std::string filename)=0
Open trajectory file and allocate memory if necessary.
virtual void readHeader()
Read header of trajectory file (if any).
virtual bool readFrame()=0
Read a single frame.
virtual void close()=0
Close the trajectory file.
TrajectoryReader(typename T::System &system)
Constructor.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.