00001 #ifndef K3DSDK_APPLICATION_PLUGIN_FACTORY_H
00002 #define K3DSDK_APPLICATION_PLUGIN_FACTORY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #include <k3dsdk/iapplication_plugin_factory.h>
00028 #include <k3dsdk/interface_list.h>
00029 #include <k3dsdk/plugin_factory.h>
00030
00031 namespace k3d
00032 {
00033
00035
00036
00037 template<typename plugin_t, typename interface_list = null_interface>
00038 class application_plugin_factory :
00039 public plugin_factory,
00040 public iapplication_plugin_factory
00041 {
00042 public:
00043 application_plugin_factory(const uuid& FactoryID, const std::string& Name, const std::string& ShortDescription, const std::string& Categories, const quality_t Quality = STABLE, const metadata_t& Metadata = metadata_t()) :
00044 plugin_factory(FactoryID, Name, ShortDescription, Categories, Quality, Metadata)
00045 {
00046 }
00047
00048 iunknown* create_plugin()
00049 {
00050 return new plugin_t();
00051 }
00052
00053 bool implements(const std::type_info& InterfaceType)
00054 {
00055 return implements_interface<interface_list>()(InterfaceType);
00056 }
00057
00058 const interfaces_t interfaces()
00059 {
00060 interfaces_t results;
00061 get_interfaces<interface_list>()(results);
00062 return results;
00063 }
00064 };
00065
00066 }
00067
00068 #endif // !K3DSDK_APPLICATION_PLUGIN_FACTORY_H
00069