Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
factory.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This file is part of the gobelijn software.
4  * Gobelijn is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or any later
7  * version. Gobelijn is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for details. You should have received
11  * a copy of the GNU General Public License along with the software. If not,
12  * see <http://www.gnu.org/licenses/>.
13  *
14  * Copyright 2016, Jan Broeckhove.
15  */
21 namespace AbstractFactory {
26 template <typename TResult, typename... TArgs>
27 class Factory
28 {
29 public:
31  virtual ~Factory() {}
32 
34  virtual TResult Create(TArgs... args) = 0;
35 };
36 } // namespace AbstractFactory
virtual ~Factory()
Destructor needs to be virtual.
Definition: factory.h:31
A class template for abstract factories: objects that construct values based on their internal state...
Definition: factory.h:27
virtual TResult Create(TArgs...args)=0
Instructs this factory to create a value.