MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_FactoryBase.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_FACTORYBASE_HPP
11 #define MUELU_FACTORYBASE_HPP
12 
13 #include "MueLu_config.hpp"
14 #include "MueLu_BaseClass.hpp"
15 #include "MueLu_Level_fwd.hpp"
16 
17 namespace MueLu {
18 
24 class FactoryBase : public virtual BaseClass {
25  public:
27 
31 
33  virtual ~FactoryBase() {}
35 
37 
39  virtual void CallBuild(Level& requestedLevel) const = 0;
40 
41  virtual void CallDeclareInput(Level& requestedLevel) const = 0;
43 
45 
48  int GetID() const { return id_; };
49 
51 
52 #ifdef HAVE_MUELU_DEBUG
53  virtual void ResetDebugData() const = 0;
54 #endif
55 
56  private:
57  static int GenerateUniqueId();
58 
59  const int id_;
60 
61 }; // class FactoryBase
62 
63 } // namespace MueLu
64 
65 #define MUELU_FACTORYBASE_SHORT
66 #endif // ifndef MUELU_FACTORYBASE_HPP
virtual void CallDeclareInput(Level &requestedLevel) const =0
virtual ~FactoryBase()
Destructor.
virtual void CallBuild(Level &requestedLevel) const =0
static int GenerateUniqueId()
int GetID() const
return unique factory id
Base class for factories (e.g., R, P, and A_coarse).
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
Base class for MueLu classes.
FactoryBase()
Constructor.