Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EvilBase_decl.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_DECL_HPP
11 #define EVIL_BASE_DECL_HPP
12 
13 
14 #include "Teuchos_RCP.hpp"
15 
16 
17 namespace EvilPack {
18 
19 
21 using Teuchos::RCP;
22 
23 
27 template<class T>
28 class EvilBase {
29 public:
30 
32  virtual ~EvilBase();
33 
35  virtual void soundOff(const T& obj) const = 0;
36 
38  static RCP<EvilBase<T> >
39  createEvil(const std::string& concreteEvilName);
40 
41 };
42 
43 
44 } // namespace EvilPack
45 
46 
47 #endif // EVIL_BASE_DECL_HPP
static RCP< EvilBase< T > > createEvil(const std::string &concreteEvilName)
The factory in the interface.
virtual void soundOff(const T &obj) const =0
The virtual function.
virtual ~EvilBase()
. Required virtual destructor.
Smart reference counting pointer class for automatic garbage collection.
Evil base class that people often write with a factory function to all of the subclasses in the inter...
Reference-counted pointer class and non-member templated function implementations.