Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_AbstractFactory.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 TEUCHOS_ABSTRACT_FACTORY_HPP
11 #define TEUCHOS_ABSTRACT_FACTORY_HPP
12 
13 #include "Teuchos_RCP.hpp"
14 
15 namespace Teuchos {
16 
28 template<class T>
30 public:
31 
32 #ifndef DOXYGEN_COMPILE
33 
34  typedef Teuchos::RCP<T> obj_ptr_t;
35 #endif
36 
38  virtual ~AbstractFactory() {}
39 
43  virtual obj_ptr_t create() const = 0;
44 
45 }; // class AbstractFactory
46 
47 } // end Teuchos
48 
49 #endif // TEUCHOS_ABSTRACT_FACTORY_HPP
virtual obj_ptr_t create() const =0
Create an object of type T returned as a smart reference counting pointer object. ...
Smart reference counting pointer class for automatic garbage collection.
Simple, universal &quot;Abstract Factory&quot; interface for the dynamic creation of objects.
Reference-counted pointer class and non-member templated function implementations.