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 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "PackageC.hpp"
11 
12 namespace C {
13 
14  // Creating an instance of this "object" registers C::FactoryC<MV,
15  // OP> with the central registry of packages' factories. That lets
16  // C::getLinearSolver create solvers from package C.
17  template<class MV, class OP, class NormType>
19  public:
21 #ifdef HAVE_TEUCHOSCORE_CXX11
22  typedef std::shared_ptr<Trilinos::Details::LinearSolverFactory<MV, OP, NormType> > ptr_type;
23 #else
25 #endif // HAVE_TEUCHOSCORE_CXX11
26 
27  ptr_type factory (new FactoryC<MV, OP, NormType> ());
28  Trilinos::Details::registerLinearSolverFactory<MV, OP, NormType> ("C", factory);
29  }
30  };
31 
32 } // namespace C
33 
34 namespace { // (anonymous)
35  //
36  // See PackageA.cpp for an explanation of the macro and its use.
37  //
38 #define INSTMACRO( SCALAR ) \
39  C::RegisterFactoryC< Common::MultiVector< SCALAR >, Common::Operator< SCALAR >, SCALAR > registerer_##SCALAR;
40 
41  //C::RegisterFactoryC< Common::MultiVector<double>, Common::Operator<double>, double > registerer_double;
42  INSTMACRO( double )
43 
44  //C::RegisterFactoryC< Common::MultiVector<float>, Common::Operator<float>, float > registerer_float;
45  INSTMACRO( float )
46 
47 } // namespace (anonymous)
48 
#define INSTMACRO(SCALAR)
Definition: PackageC.cpp:38
Smart reference counting pointer class for automatic garbage collection.