Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
PackageB.cpp
Go to the documentation of this file.
1 #include "PackageB.hpp"
2 
3 namespace B {
4 
5  // Creating an instance of this "object" registers B::FactoryB<MV,
6  // OP> with the central registry of packages' factories. That lets
7  // B::getLinearSolver create solvers from package B.
8  template<class MV, class OP, class NormType>
10  public:
12 #ifdef HAVE_TEUCHOSCORE_CXX11
13  typedef std::shared_ptr<Trilinos::Details::LinearSolverFactory<MV, OP, NormType> > ptr_type;
14 #else
16 #endif // HAVE_TEUCHOSCORE_CXX11
17 
18  ptr_type factory (new FactoryB<MV, OP, NormType> ());
19  Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> ("B", factory);
20  }
21  };
22 
23 } // namespace B
24 
25 namespace { // (anonymous)
26  //
27  // See PackageA.cpp for an explanation of the macro and its use.
28  //
29 #define INSTMACRO( SCALAR ) \
30  B::RegisterFactoryB< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
31 
32  //B::RegisterFactoryB< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
33  INSTMACRO( double )
34 
35  //B::RegisterFactoryB< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
36  INSTMACRO( float )
37 
38 } // namespace (anonymous)
39 
Definition: PackageB.cpp:3
#define INSTMACRO(SCALAR)
Definition: PackageB.cpp:29
Smart reference counting pointer class for automatic garbage collection.