FileWriterInterface.hpp 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <string>

#include <dune/amdis/Initfile.hpp>
#include <dune/amdis/Output.hpp>
#include <dune/amdis/utility/Filesystem.hpp>

namespace AMDiS
{
  // forward declaration
  class AdaptInfo;

  class FileWriterInterface
  {
  public:
17
    explicit FileWriterInterface(std::string base)
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    {
      filename_ = "solution";
      Parameters::get(base + "->filename", filename_);
      dir_ = "output";
      Parameters::get(base + "->output directory", dir_);
      name_ = "solution";
      Parameters::get(base + "->name", name_);
    }


    // pure virtual method to be implemented by derived classes
    virtual void writeFiles(AdaptInfo& adaptInfo, bool force) = 0;


    std::string getFilename() const
    {
      return filename_;
    }

    void setFilename(std::string const& filename)
    {
      filename_ = filename;
    }

    std::string getName() const
    {
      return name_;
    }

  protected:
    std::string filename_;
    std::string dir_;
    std::string name_;
  };

} // end namespace AMDiS