Noise Modeler Library  0.1
Library for procedurally generating noise-based terrains and other content
 All Classes Files Functions Variables Enumerations Enumerator Groups Pages
concretemodulegenerator.hpp
1 #ifndef NM_CONCRETEMODULEGENERATOR_HPP
2 #define NM_CONCRETEMODULEGENERATOR_HPP
3 
4 #include <nmlib/codegeneration/modulegenerator.hpp>
5 
6 #include <memory>
7 
8 namespace nm {
9 
10 class InlineGenerator;
11 
17 {
18 public:
19  ConcreteModuleGenerator(std::unique_ptr<BodyGenerator> bodyGenerator,
20  std::unique_ptr<DefaultsGenerator> defaultsGenerator = {}):
21  m_bodyGenerator(std::move(bodyGenerator)),
22  m_defaultsGenerator(std::move(defaultsGenerator))
23  {
24  }
25 
26  // BodyGenerator interface
27  virtual void generateBody(InlineGenerator &gen, std::ostream &out) override {m_bodyGenerator->generateBody(gen, out);}
28 
29  // DefaultsGenerator interface
30  virtual void generateDefaults(InlineGenerator &gen, std::ostream &out) override {m_defaultsGenerator->generateDefaults(gen, out);}
31 
32 private:
33  std::unique_ptr<BodyGenerator> m_bodyGenerator;
34  std::unique_ptr<DefaultsGenerator> m_defaultsGenerator;
35 };
36 
37 } // namespace nm
38 
39 #endif // NM_CONCRETEMODULEGENERATOR_HPP
The ModuleGenerator class.
Definition: modulegenerator.hpp:13
The ConcreteModuleGenerator class.
Definition: concretemodulegenerator.hpp:16
Abstract base class for code generators.
Definition: inlinegenerator.hpp:34