1 |
#ifndef APPLICATIONS_SIMPLEBUILDER_LATTICECREATOR_HPP |
2 |
#define APPLICATIONS_SIMPLEBUILDER_LATTICECREATOR_HPP |
3 |
#include <string> |
4 |
#include "applications/simpleBuilder/BaseLattice.hpp" |
5 |
|
6 |
|
7 |
namespace oopse { |
8 |
|
9 |
class BaseLatticeCreator{ |
10 |
public: |
11 |
virtual BaseLattice* createLattice() = 0; |
12 |
const std::string& getType() {return latticeType;} |
13 |
|
14 |
protected: |
15 |
BaseLatticeCreator(const std::string& latType); |
16 |
private: |
17 |
std::string latticeType; |
18 |
}; |
19 |
|
20 |
template<class LatticeClass> |
21 |
class LatticeCreator : public BaseLatticeCreator |
22 |
{ |
23 |
public: |
24 |
LatticeCreator(const std::string& latticeType): BaseLatticeCreator(latticeType) {} |
25 |
virtual BaseLattice* createLattice() { return new LatticeClass();} |
26 |
}; |
27 |
|
28 |
} |
29 |
#endif |