Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PackageC.cpp
Go to the documentation of this file.
1 #include "PackageC.hpp"
2 
3 namespace C {
4 
5  // Creating an instance of this "object" registers C::FactoryC<MV,
6  // OP> with the central registry of packages' factories. That lets
7  // C::getLinearSolver create solvers from package C.
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 FactoryC<MV, OP, NormType> ());
19  Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> ("C", factory);
20  }
21  };
22 
23 } // namespace C
24 
25 namespace { // (anonymous)
26  //
27  // See PackageA.cpp for an explanation of the macro and its use.
28  //
29 #define INSTMACRO( SCALAR ) \
30  C::RegisterFactoryC< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
31 
32  //C::RegisterFactoryC< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
33  INSTMACRO( double )
34 
35  //C::RegisterFactoryC< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
36  INSTMACRO( float )
37 
38 } // namespace (anonymous)
39 
#define INSTMACRO(SCALAR)
Definition: PackageC.cpp:29
Smart reference counting pointer class for automatic garbage collection.