6 |
|
|
7 |
|
LatticeFactory* LatticeFactory::instance = NULL; |
8 |
|
LatticeFactory::~LatticeFactory(){ |
9 |
< |
std::map<string, BaseLatticeCreator*>::iterator mapIter; |
9 |
> |
std::map<std::string, BaseLatticeCreator*>::iterator mapIter; |
10 |
|
for (mapIter = creatorMap.begin(); mapIter == creatorMap.end(); ++mapIter) { |
11 |
|
delete mapIter->second; |
12 |
|
} |
21 |
|
|
22 |
|
bool LatticeFactory::registerCreator( BaseLatticeCreator* latCreator ){ |
23 |
|
std::string latticeType = latCreator->getType(); |
24 |
< |
std::map<string, BaseLatticeCreator*>::iterator mapIter; |
24 |
> |
std::map<std::string, BaseLatticeCreator*>::iterator mapIter; |
25 |
|
|
26 |
|
mapIter = creatorMap.find(latticeType); |
27 |
|
|
37 |
|
} |
38 |
|
|
39 |
|
BaseLattice* LatticeFactory::createLattice( const std::string& latticeType ){ |
40 |
< |
std::map<string, BaseLatticeCreator*>::iterator mapIter; |
40 |
> |
std::map<std::string, BaseLatticeCreator*>::iterator mapIter; |
41 |
|
|
42 |
|
mapIter = creatorMap.find(latticeType); |
43 |
|
|
49 |
|
} |
50 |
|
|
51 |
|
bool LatticeFactory::hasLatticeCreator( const std::string& latticeType ){ |
52 |
< |
std::map<string, BaseLatticeCreator*>::iterator mapIter; |
52 |
> |
std::map<std::string, BaseLatticeCreator*>::iterator mapIter; |
53 |
|
|
54 |
|
mapIter = creatorMap.find(latticeType); |
55 |
|
|
61 |
|
|
62 |
|
const std::string LatticeFactory::toString(){ |
63 |
|
std::string result; |
64 |
< |
std::map<string, BaseLatticeCreator*>::iterator mapIter; |
64 |
> |
std::map<std::string, BaseLatticeCreator*>::iterator mapIter; |
65 |
|
|
66 |
|
result = "Avaliable lattice creators in LatticeFactory are:\n"; |
67 |
|
|