Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sortField.h
Go to the documentation of this file.
1 
15 #ifndef SORTFIELD_INCLUDED
16 #define SORTFIELD_INCLUDED
17 
18 #include <valarray>
19 #include "field.h"
20 
21 #ifdef USE_FACTORY
22 #include "factory.h"
23 #endif
24 
26 
34 class SortField
35 {
36  public:
37  virtual ~SortField() {}
38  virtual void sort(int, std::valarray<double>&) = 0;
39  virtual void sort(int, std::valarray<double>&, std::valarray<Field>&) = 0;
40  virtual int converged(double v, double v_thrs) = 0;
41 
42 #ifdef USE_FACTORY
43  public:
44  typedef SortField *(*ProductCreator)();
46 
47  static SortField *New(const IdentifierType& subtype)
48  {
49  ProductCreator p = Factory::Find(subtype);
50 
51  return p ? (*p)() : 0;
52  }
53 #endif
54 };
55 #endif