Tomato
OxFactoryOfStartPointCalculators.hxx
Go to the documentation of this file.
1 
7 #ifndef Tomato_OXFACTORYOFStartPointCalculators_HXX
8 #define Tomato_OXFACTORYOFStartPointCalculators_HXX
9 
12 
13 namespace Ox {
14 
15  template < typename TYPE >
16  StartPointCalculator<TYPE>*
17  FactoryOfStartPointCalculators<TYPE>
18  ::newByFactory(TomatoOptions<TYPE> *opts){
19  switch (opts->start_point_calc_method){
20  case Basic: {
21  return new StartPointCalculatorBasic<TYPE>();
22  }
23  case StartPointSHMOLLI: {
24  return new StartPointCalculatorShmolli<TYPE>();
25  }
26  case NoStartPointCalculators: {
27  return 0;
28  }
29  default:
30  throw std::runtime_error("start_point_calc_method object not available");
31  }
32  }
33 
34  template < typename TYPE >
35  void
36  FactoryOfStartPointCalculators<TYPE>
37  ::disp(int start_point_calc_method){
38 
39  if (start_point_calc_method >= 0) {
40  printf("%-28s%-22s", " start_point_calc_method: ", startPointCalculatorsTypeNames[start_point_calc_method]);
41  }
42 
43  printf("options: [ ");
44 
45  for (int i = 0; i < lastStartPointCalculatorType+1; i++){
46 
47  if(startPointCalculatorsAvailability[i]){
48  printf("%s ", startPointCalculatorsTypeNames[i]);
49  }
50  }
51 
52  printf("] \n");
53  }
54 
55 } // namespace Ox
56 
57 #endif //Tomato_OXFACTORYOFStartPointCalculators_HXX
Definition: OxCalculator.h:19