Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
remainder
example
SolverFactory
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>
9
class
RegisterFactoryC
{
10
public
:
11
RegisterFactoryC
() {
12
#ifdef HAVE_TEUCHOSCORE_CXX11
13
typedef
std::shared_ptr<Trilinos::Details::LinearSolverFactory<MV, OP, NormType> > ptr_type;
14
#else
15
typedef
Teuchos::RCP<Trilinos::Details::LinearSolverFactory<MV, OP, NormType>
> ptr_type;
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
PackageC.hpp
C
Definition:
core/example/RefCountPtr/cxx_main.cpp:55
C::RegisterFactoryC::RegisterFactoryC
RegisterFactoryC()
Definition:
PackageC.cpp:11
INSTMACRO
#define INSTMACRO(SCALAR)
Definition:
PackageC.cpp:29
C::FactoryC
Definition:
PackageC.hpp:54
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:429
C::RegisterFactoryC
Definition:
PackageC.cpp:9
Generated by
1.8.5