1 |
#ifndef _LATTICEFACTORY_H_ |
2 |
#define _LATTICEFACTORY_H_ |
3 |
#include <map> |
4 |
#include <string> |
5 |
|
6 |
|
7 |
|
8 |
class BaseLatticeCreator; |
9 |
class BaseLattice; |
10 |
|
11 |
class LatticeFactory{ |
12 |
public: |
13 |
~LatticeFactory(); |
14 |
|
15 |
static LatticeFactory* getInstance(); |
16 |
|
17 |
bool registerCreator( BaseLatticeCreator* latCreator ); |
18 |
|
19 |
|
20 |
bool hasLatticeCreator( const std::string& latticeType ); |
21 |
|
22 |
const std::string toString(); |
23 |
|
24 |
BaseLattice* createLattice( const std::string& latticeType ); |
25 |
|
26 |
private: |
27 |
LatticeFactory(){} |
28 |
static LatticeFactory* instance; |
29 |
std::map<string, BaseLatticeCreator*> creatorMap; |
30 |
}; |
31 |
#endif |