ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/utils/sysbuilder/LatticeFactory.cpp
(Generate patch)

Comparing trunk/OOPSE-1.0/utils/sysbuilder/LatticeFactory.cpp (file contents):
Revision 1423 by tim, Wed Jul 28 04:58:20 2004 UTC vs.
Revision 1432 by tim, Thu Jul 29 03:31:50 2004 UTC

# Line 2 | Line 2
2   #include "BaseLattice.hpp"
3   #include "LatticeCreator.hpp"
4  
5 + LatticeFactory* LatticeFactory::instance = NULL;
6   LatticeFactory::~LatticeFactory(){
7    map<string, BaseLatticeCreator*>::iterator mapIter;
8          for (mapIter = creatorMap.begin(); mapIter == creatorMap.end(); ++mapIter) {
# Line 9 | Line 10 | LatticeFactory::~LatticeFactory(){
10          }  
11   }
12  
13 < static LatticeFactory::LatticeFactory* getInstance(){
13 > LatticeFactory* LatticeFactory::getInstance(){
14          if (instance == NULL)
15        instance = new LatticeFactory();
16          
17          return instance;
18   }
19  
20 < bool LatticeFactory::registerCreator( const LatticeCreator*  latCreator ){  
21 <  string latticeType = latCreator->GetType();
20 > bool LatticeFactory::registerCreator( BaseLatticeCreator*  latCreator ){  
21 >  string latticeType = latCreator->getType();
22    map<string, BaseLatticeCreator*>::iterator mapIter;
23  
24    mapIter = creatorMap.find(latticeType);
# Line 33 | Line 34 | bool LatticeFactory::registerCreator( const LatticeCre
34    }
35   }
36  
37 < BaseLattice* LatticeFactory::createLattice( const string& latticeType ){
38 <  string latticeType = latCreator->GetType();
38 <  map<string, BaseLatticeCreator*>::iterator mapIter;
39 <  BaseLatticeCreator* creator;
37 > BaseLattice* LatticeFactory::createLattice( const string& latticeType ){
38 >  map<string, BaseLatticeCreator*>::iterator mapIter;
39    
40    mapIter = creatorMap.find(latticeType);
41  
42    if (mapIter != creatorMap.end()) {
43 <    creator = mapIter->second;
45 <    return creator->createLattice();
43 >     return (mapIter->second)->createLattice();
44    }
45    else
46      return NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines