FileWriterInterface.hpp 1.25 KB
Newer Older
1
2
3
4
#pragma once

#include <string>

5
6
#include <amdis/Initfile.hpp>
#include <amdis/Output.hpp>
7
#include <amdis/common/Filesystem.hpp>
8
9
10
11
12
13
14
15
16

namespace AMDiS
{
  // forward declaration
  class AdaptInfo;

  class FileWriterInterface
  {
  public:
17
    explicit FileWriterInterface(std::string const& base)
18
19
20
21
22
23
    {
      Parameters::get(base + "->filename", filename_);
      Parameters::get(base + "->output directory", dir_);
      Parameters::get(base + "->name", name_);
    }

24
    virtual ~FileWriterInterface() = default;
25

26
27
28
29

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

30
  public: // getter and setter
31

32
    std::string const& filename() const
33
34
35
36
    {
      return filename_;
    }

37
    std::string const& dir() const
38
    {
39
      return dir_;
40
41
    }

Praetorius, Simon's avatar
Praetorius, Simon committed
42
    std::string const& name() const
43
44
45
46
    {
      return name_;
    }

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
    void setFilename(std::string const& filename)
    {
      filename_ = filename;
    }

    void setDir(std::string const& dir)
    {
      dir_ = dir;
    }

    void setName(std::string const& name)
    {
      name_ = name;
    }

62
  protected:
63
    std::string filename_ = "solution";
64
    std::string dir_ = ".";
65
    std::string name_ = "solution";
66
67
68
  };

} // end namespace AMDiS