Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_AbstractFactory.hpp
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
15namespace Teuchos {
16
28template<class T>
30public:
31
32#ifndef DOXYGEN_COMPILE
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
Reference-counted pointer class and non-member templated function implementations.
Simple, universal "Abstract Factory" interface for the dynamic creation of objects.
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.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...