ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/integrators/IntegratorFactory.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/integrators/IntegratorFactory.cpp (file contents):
Revision 1836 by tim, Wed Dec 1 22:45:49 2004 UTC vs.
Revision 1837 by tim, Thu Dec 2 22:15:31 2004 UTC

# Line 1 | Line 1
1  
2   #include "integrators/IntegratorFactory.hpp"
3 + #include "integrators/IntegratorCreator.hpp"
4 +
5   namespace oopse {
6  
7   //initialize instance of IntegratorFactory
8   IntegratorFactory* IntegratorFactory::instance_ = NULL;
9  
10 < bool IntegratorFactory::registerIntegrator(const std::string& id, IntegratorCreatorType creator) {
10 > bool IntegratorFactory::registerIntegrator(IntegratorCreator* creator) {
11 >    //std::cout << "register " << creator->getIdent() << std::endl;
12      return creatorMap_.insert(
13 <        CreatorMapType::value_type(id, creator)).second;
13 >        CreatorMapType::value_type(creator->getIdent(), creator)).second;
14   }
15  
16   bool IntegratorFactory::unregisterIntegrator(const std::string& id) {
# Line 18 | Line 21 | Integrator* IntegratorFactory::createIntegrator(const
21      CreatorMapType::iterator i = creatorMap_.find(id);
22      if (i != creatorMap_.end()) {
23          //invoke functor to create object
24 <        return (i->second)(info);
24 >        return (i->second)->create(info);
25      } else {
26          return NULL;
27      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines