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