Bridge++  Ver. 1.3.x
source.h
Go to the documentation of this file.
1 
14 #ifndef SOURCE_INCLUDED
15 #define SOURCE_INCLUDED
16 
17 #include "defs.h"
18 #include "parameters.h"
19 #include "commonParameters.h"
20 #include "field.h"
21 #include "bridgeIO.h"
22 
23 #ifdef USE_FACTORY
24 #include "factory.h"
25 #endif
26 
28 
35 class Source
36 {
37  protected:
39 
40  public:
41  Source() {}
42  virtual ~Source() {}
43 
44  private:
45  // non-copyable
46  Source(const Source&);
47  Source& operator=(const Source&);
48 
49  public:
50 
51  virtual void set_parameters(const Parameters&) = 0;
52 
54 
55  virtual void set(Field&, int) = 0;
56 
57 #ifdef USE_FACTORY
58  public:
59  typedef Source *(*ProductCreator)();
61 
62  static Source *New(const IdentifierType& subtype)
63  {
64  ProductCreator p = Factory::Find(subtype);
65 
66  return p ? (*p)() : 0;
67  }
68 #endif
69 };
70 #endif /* SOURCE_INCLUDED */
Container of Field-type object.
Definition: field.h:39
Class for parameters.
Definition: parameters.h:38
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: source.h:53
virtual ~Source()
Definition: source.h:42
virtual void set(Field &, int)=0
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:39
Source()
Definition: source.h:41
Bridge::VerboseLevel m_vl
Definition: source.h:38
std::string IdentifierType
Factory template class.
Definition: factory.h:33
Base class of sources for a linear solver.
Definition: source.h:35
Source & operator=(const Source &)
virtual void set_parameters(const Parameters &)=0