Simpatico  v1.10
tools/config/ConfigWriter.h
1 #ifndef TOOLS_CONFIG_WRITER_H
2 #define TOOLS_CONFIG_WRITER_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 
35  ConfigWriter();
36 
43  ConfigWriter(Configuration& configuration, bool needsAuxiliaryFile = false);
44 
48  virtual ~ConfigWriter();
49 
55  virtual void writeConfig(std::ofstream& file) = 0;
56 
60  bool needsAuxiliaryFile() const;
61 
67  virtual void readAuxiliaryFile(std::ifstream& file)
68  {}
69 
70  protected:
71 
72  Configuration& configuration()
73  { return *configurationPtr_; }
74 
75  private:
76 
78  Configuration* configurationPtr_;
79 
81  bool needsAuxiliaryFile_;
82 
83  };
84 
85  /*
86  * Return true if an auxiliary file is needed.
87  */
88  inline
90  { return needsAuxiliaryFile_; }
91 
92 }
93 #endif
An instantaneous molecular dynamics configuration.
Definition: Configuration.h:40
Abstract reader/writer for configuration files.
Utility classes for scientific computation.
Definition: accumulators.mod:1
Single-processor classes for pre- and post-processing MD trajectories.
bool needsAuxiliaryFile() const
Return true if an auxiliary file is needed.
virtual void readAuxiliaryFile(std::ifstream &file)
Read auxiliary file (empty default implementation).
An object that can read multiple parameters from file.