Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EvilBase_def.hpp
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 #ifndef EVIL_BASE_DEF_HPP
11 #define EVIL_BASE_DEF_HPP
12 
13 
14 #include "EvilBase_decl.hpp"
15 
16 // Include the subclasses that we are going to instantiate in the factory
17 // (i.e. evil)! NOTE: We need to include the possible function definitions
18 // here in case we are doing implicit instantiation!
19 #include "AEvil.hpp"
20 #include "BEvil.hpp"
21 
22 
23 namespace EvilPack {
24 
25 
26 template<class T>
28 {}
29 
30 
31 template<class T>
33 EvilBase<T>::createEvil(const std::string& concreteEvilName)
34 {
35  if (concreteEvilName == "AEvil") {
36  return aEvil<T>();
37  }
38  else if (concreteEvilName == "BEvil") {
39  return bEvil<T>();
40  }
41  else {
43  }
44  return Teuchos::null; // Never be executed
45 }
46 
47 
48 } // namespace EvilPack
49 
50 
51 #endif // EVIL_BASE_DEF_HPP
static RCP< EvilBase< T > > createEvil(const std::string &concreteEvilName)
The factory in the interface.
virtual ~EvilBase()
. Required virtual destructor.
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call...