OSDecompSolverFactory.cpp
Go to the documentation of this file.
1 /* $Id: OSDecompSolverFactory.cpp 3038 2009-11-07 11:43:44Z kmartin $ */
15 // --------------------------------------------------------------------- //
16 #include "OSInstance.h"
17 #include "OSResult.h"
18 #include "OSDataStructures.h"
19 #include "OSErrorClass.h"
20 #include <vector>
21 #include <string>
22 #include <map>
23 
24 #include "OSDecompSolverFactory.h"
25 
26 
27 
28 std::map<std::string, OSDecompSolverFactory*> OSDecompSolverFactory::factories;
29 
31 
32 
33  if( factories.find(solverName) != factories.end() ){
34 
35  return factories[ solverName]->create();
36 
37  }else{
38  throw ErrorClass( solverName + " is not a valid OSDecompSolver");
39  }
40 
41 }//end
42 
43 
49 
50 }
51 
53  }
54 
55 
OSDecompSolverFactory()
Default Constructor.
virtual ~OSDecompSolverFactory()=0
Default destructor.
static OSDecompSolver * createOSDecompSolver(const std::string &solverName)
static std::map< std::string, OSDecompSolverFactory * > factories
used for throwing exceptions.
Definition: OSErrorClass.h:31