| 39 |
|
* such damages. |
| 40 |
|
*/ |
| 41 |
|
|
| 42 |
< |
#ifndef LATTICE_LATTICECREATOR_HPP |
| 42 |
> |
#ifndef LATTICE_LATTICECREATOR_HPP |
| 43 |
|
#define LATTICE_LATTICECREATOR_HPP |
| 44 |
+ |
|
| 45 |
|
#include <string> |
| 45 |
– |
#include "lattice/BaseLattice.hpp" |
| 46 |
|
|
| 47 |
– |
|
| 47 |
|
namespace oopse { |
| 48 |
|
|
| 49 |
< |
class BaseLatticeCreator{ |
| 50 |
< |
public: |
| 51 |
< |
virtual BaseLattice* createLattice() = 0; |
| 52 |
< |
const std::string& getType() {return latticeType;} |
| 53 |
< |
|
| 54 |
< |
protected: |
| 55 |
< |
BaseLatticeCreator(const std::string& latType); |
| 56 |
< |
private: |
| 57 |
< |
std::string latticeType; |
| 49 |
> |
class Lattice; |
| 50 |
> |
|
| 51 |
> |
/** |
| 52 |
> |
* @class Lattice |
| 53 |
> |
* @todo document |
| 54 |
> |
*/ |
| 55 |
> |
class LatticeCreator { |
| 56 |
> |
public: |
| 57 |
> |
LatticeCreator(const std::string& ident) : ident_(ident) {} |
| 58 |
> |
virtual ~LatticeCreator() {} |
| 59 |
> |
|
| 60 |
> |
const std::string& getIdent() const { return ident_; } |
| 61 |
> |
|
| 62 |
> |
virtual Lattice* create() const = 0; |
| 63 |
> |
|
| 64 |
> |
private: |
| 65 |
> |
std::string ident_; |
| 66 |
|
}; |
| 67 |
|
|
| 68 |
< |
template<class LatticeClass> |
| 69 |
< |
class LatticeCreator : public BaseLatticeCreator |
| 70 |
< |
{ |
| 71 |
< |
public: |
| 72 |
< |
LatticeCreator(const std::string& latticeType): BaseLatticeCreator(latticeType) {} |
| 73 |
< |
virtual BaseLattice* createLattice() { return new LatticeClass();} |
| 68 |
> |
/** |
| 69 |
> |
* @class LatticeBuilder |
| 70 |
> |
* @todo document |
| 71 |
> |
*/ |
| 72 |
> |
template<class ConcreteLattice> |
| 73 |
> |
class LatticeBuilder : public LatticeCreator { |
| 74 |
> |
public: |
| 75 |
> |
LatticeBuilder(const std::string& ident) : LatticeCreator(ident) {} |
| 76 |
> |
virtual Lattice* create() const {return new ConcreteLattice();} |
| 77 |
|
}; |
| 78 |
|
|
| 79 |
|
} |
| 80 |
< |
#endif |
| 80 |
> |
|
| 81 |
> |
#endif //USETHEFORCE_FORCEFIELDCREATOR_HPP |