Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
source.h
Go to the documentation of this file.
1 
14 #ifndef SOURCE_INCLUDED
15 #define SOURCE_INCLUDED
16 
17 #include "Parameters/parameters.h"
18 #include "Field/field.h"
19 #include "IO/bridgeIO.h"
20 
21 #ifdef USE_FACTORY
22 #include "Tools/factory.h"
23 #endif
24 
26 
35 class Source
36 {
37  protected:
39 
40  public:
42  : m_vl(CommonParameters::Vlevel()) {}
43 
44  virtual ~Source() {}
45 
46  private:
47  // non-copyable
48  Source(const Source&);
49  Source& operator=(const Source&);
50 
51  public:
52 
53  virtual void set_parameters(const Parameters&) = 0;
54 
56 
57  virtual void set(Field&, int) = 0;
58 
59 #ifdef USE_FACTORY
60  public:
61  typedef Source *(*ProductCreator)();
63 
64  static Source *New(const IdentifierType& subtype)
65  {
66  ProductCreator p = Factory::Find(subtype);
67 
68  return p ? (*p)() : 0;
69  }
70 #endif
71 };
72 #endif /* SOURCE_INCLUDED */
Container of Field-type object.
Definition: field.h:39
Class for parameters.
Definition: parameters.h:46
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: source.h:55
virtual ~Source()
Definition: source.h:44
Common parameter class: provides parameters as singleton.
virtual void set(Field &, int)=0
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:42
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 source for a linear solver.
Definition: source.h:35
Source & operator=(const Source &)
virtual void set_parameters(const Parameters &)=0