00001 #ifndef IGUANA_FRAMEWORK_IG_PLUGIN_DEF_H
00002 # define IGUANA_FRAMEWORK_IG_PLUGIN_DEF_H
00003
00004
00005
00006 # include "Iguana/Framework/interface/config.h"
00007 # include <string>
00008
00009
00010
00011
00012
00013 class IgModuleDef;
00014
00015
00016
00017
00018
00020 template <class Factory, class Type>
00021 struct IgPluginDef
00022 {
00023 static void declare (IgModuleDef *def);
00024 static void declareName (IgModuleDef *def, std::string name);
00025 static void installFactory (IgModuleDef *def);
00026 static void installFactoryName (IgModuleDef *def, std::string name);
00027 };
00028
00029
00030
00031
00034 template <class Factory, class Type>
00035 inline void
00036 IgPluginDef<Factory,Type>::declare (IgModuleDef *def)
00037 { Factory::get ()->declare (def, Type::catalogLabel ()); }
00038
00041 template <class Factory, class Type>
00042 inline void
00043 IgPluginDef<Factory,Type>::declareName (IgModuleDef *def, std::string name)
00044 { Factory::get ()->declare (def, name); }
00045
00049 template <class Factory, class Type>
00050 inline void
00051 IgPluginDef<Factory,Type>::installFactory (IgModuleDef *def)
00052 {
00053 typedef typename Factory::Types::template AutoFactory<Type> AutoFactory;
00054 Factory::get ()->installFactory (def, Type::catalogLabel (), new AutoFactory);
00055 }
00056
00060 template <class Factory, class Type>
00061 inline void
00062 IgPluginDef<Factory,Type>::installFactoryName (IgModuleDef *def, std::string name)
00063 {
00064 typedef typename Factory::Types::template AutoFactory<Type> AutoFactory;
00065 Factory::get ()->installFactory (def, name, new AutoFactory);
00066 }
00067
00068 #endif // IGUANA_FRAMEWORK_IG_PLUGIN_DEF_H