Simulant  21.12-194
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
cloneable.h
1 /* * Copyright (c) 2011-2017 Luke Benstead https://simulant-engine.appspot.com
2  *
3  * This file is part of Simulant.
4  *
5  * Simulant is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Simulant is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with Simulant. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef CLONEABLE_H
20 #define CLONEABLE_H
21 
22 namespace smlt {
23 
24 template<typename IDType>
25 class Cloneable {
26 public:
27  virtual ~Cloneable() {}
28 
29  IDType clone() {
30  return do_clone();
31  }
32 
33 private:
34  virtual IDType do_clone() = 0;
35 };
36 
37 }
38 
39 #endif // CLONABLE_H
smlt
Definition: animation.cpp:25
smlt::Cloneable
Definition: cloneable.h:25