| 1 | 
gezelter | 
1447 | 
#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 | 
  | 
  | 
        bool registerCreator( BaseLatticeCreator*  latCreator ); | 
| 18 | 
  | 
  | 
 | 
| 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 | 
  | 
  | 
    map<string,  BaseLatticeCreator*> creatorMap; | 
| 30 | 
  | 
  | 
}; | 
| 31 | 
  | 
  | 
#endif  |