OSDN Git Service

factory.hpp
authormyun2 <myun2@nwhite.info>
Sun, 8 Jul 2012 13:18:30 +0000 (22:18 +0900)
committermyun2 <myun2@nwhite.info>
Sun, 8 Jul 2012 13:18:30 +0000 (22:18 +0900)
roast/include/roast/tp/krass/factory.hpp

index cc924bb..a39dd41 100644 (file)
@@ -5,6 +5,18 @@
 
 namespace roast
 {
+       class factory_base {
+               virtual void* create_instance() = 0;
+       };
+       
+       template <typename T>
+       class factory : public factory_base
+       {
+       public:
+               void* create_instance(){
+                       return new T;
+               }
+       }
 }
 
 #endif//__SFJP_ROAST___tp__krass__factory_HPP__