]> git.stg.codes - stg.git/blob - include/stg/plugin_creator.h
755c20686cc8a2cca398be740a9b93a057aea011
[stg.git] / include / stg / plugin_creator.h
1 #ifndef __PLUGIN_CREATOR_H__
2 #define __PLUGIN_CREATOR_H__
3
4 template <class T>
5 class PLUGIN_CREATOR
6 {
7 public:
8     PLUGIN_CREATOR() : plugin(new T()) {}
9     ~PLUGIN_CREATOR() { delete plugin; }
10
11     T * GetPlugin() { return plugin; }
12
13 private:
14     T * plugin;
15
16     PLUGIN_CREATOR(const PLUGIN_CREATOR<T> & rvalue);
17     PLUGIN_CREATOR<T> & operator=(const PLUGIN_CREATOR<T> & rvalue);
18 };
19
20 #endif