#include <Iguana/Framework/interface/IgPluginInfo.h>
Public Member Functions | |
virtual void | cache (IgModuleDescriptor *to) const |
const std::string & | category (void) const |
virtual void | detach (void) |
IgPluginInfo (IgModule *module, const std::string &name, const std::string &category) | |
IgModule * | module (void) const |
const std::string & | name (void) const |
virtual | ~IgPluginInfo (void) |
Protected Member Functions | |
void | finish (bool needCache) |
void | noFactory (void) const |
Private Attributes | |
const std::string & | m_category |
IgModule * | m_module |
std::string | m_name |
The derived class should provide:
Object
for the type of things created through this factory category. Normally this would be some abstract base class, but it can be anything you want.
Factory
with method create()
. The create()
parameters define the constructor arguments passed to the instantiated objects. The list can be anything you want. The return value of the create()
method should be a "Object *". There can be multiple create()
methods if multiple constructor argument lists are neded. If you don't want to create any objects at all, i.e. the category describes a capability or some other side-effect, typedef Factory
to void
.
AutoFactory
which inherits Factory
. An instance of this templated class will be created for the actual plug-in types; the template argument T
will be the actual type, which must inherit from Object
. Override the create()
method to do "return new T (args)".
Definition at line 44 of file IgPluginInfo.h.
IgPluginInfo::IgPluginInfo | ( | IgModule * | module, | |
const std::string & | name, | |||
const std::string & | category | |||
) |
Definition at line 21 of file IgPluginInfo.cc.
References ASSERT, LFplugin_manager, LOG, m_category, m_module, m_name, and GsfMatrixTools::trace().
00024 : m_module (module), 00025 m_name (name), 00026 m_category (category) 00027 { 00028 ASSERT (m_module); 00029 ASSERT (! m_name.empty ()); 00030 ASSERT (! m_category.empty ()); 00031 LOG (0, trace, LFplugin_manager, "defining " << m_category 00032 << ' ' << m_name << '\n'); 00033 }
IgPluginInfo::~IgPluginInfo | ( | void | ) | [virtual] |
Definition at line 35 of file IgPluginInfo.cc.
References ASSERT, IgModule::detachInfo(), m_category, m_module, and m_name.
00036 { 00037 ASSERT (m_module); 00038 ASSERT (! m_name.empty ()); 00039 ASSERT (! m_category.empty ()); 00040 m_module->detachInfo (this); 00041 }
void IgPluginInfo::cache | ( | IgModuleDescriptor * | to | ) | const [virtual] |
Definition at line 84 of file IgPluginInfo.cc.
References ASSERT, m_category, m_module, and m_name.
Referenced by IgModule::addInfo().
00085 { 00086 ASSERT (m_module); 00087 ASSERT (! m_name.empty ()); 00088 ASSERT (! m_category.empty ()); 00089 ASSERT (to); 00090 new IgModuleDescriptor (to, m_category, m_name); 00091 }
const std::string & IgPluginInfo::category | ( | void | ) | const |
Definition at line 75 of file IgPluginInfo.cc.
References ASSERT, m_category, m_module, and m_name.
Referenced by IgPluginManager::addInfo(), and IgPluginManager::removeInfo().
00076 { 00077 ASSERT (m_module); 00078 ASSERT (! m_name.empty ()); 00079 ASSERT (! m_category.empty ()); 00080 return m_category; 00081 }
Reimplemented in IgPluginFactoryImplTypes< R *(void)>::Info, IgPluginFactoryImplTypes< R *(T1)>::Info, IgPluginFactoryImplTypes< R *(T1, T2)>::Info, IgPluginFactoryImplTypes< R *(T1, T2, T3)>::Info, and IgPluginFactoryImplTypes< R *(T1, T2, T3, T4)>::Info.
Definition at line 94 of file IgPluginInfo.cc.
References ASSERT, m_category, m_module, and m_name.
00095 { 00096 ASSERT (m_module); 00097 ASSERT (! m_name.empty ()); 00098 ASSERT (! m_category.empty ()); 00099 }
Definition at line 44 of file IgPluginInfo.cc.
References IgModule::addInfo(), and m_module.
00045 { 00046 // Derived constructor is complete, tell the module I exist. This 00047 // adds myself to the module and propagates the notification to 00048 // the relevant factory. Note that the factory must already exist, so 00049 // it will get notified immediately. However it might still be in 00050 // the middle of construction, which is why we propagate the 00051 // notification through the base classes and not directly to the 00052 // factory from the derived class. 00053 m_module->addInfo (this, needCache); 00054 }
Definition at line 57 of file IgPluginInfo.cc.
References ASSERT, m_category, m_module, and m_name.
00058 { 00059 ASSERT (m_module); 00060 ASSERT (! m_name.empty ()); 00061 ASSERT (! m_category.empty ()); 00062 return m_module; 00063 }
const std::string & IgPluginInfo::name | ( | void | ) | const |
Definition at line 66 of file IgPluginInfo.cc.
References ASSERT, m_category, m_module, and m_name.
Referenced by IgPluginFactoryImplBase< Types >::addInfo(), and IgPluginFactoryImplBase< Types >::removeInfo().
00067 { 00068 ASSERT (m_module); 00069 ASSERT (! m_name.empty ()); 00070 ASSERT (! m_category.empty ()); 00071 return m_name; 00072 }
Definition at line 102 of file IgPluginInfo.cc.
References ASSERT, IgPluginManager::ErrorNoFactory, IgPluginManager::feedback(), IgModule::libraryName(), m_module, m_name, IgModule::manager(), and lat::Filename::name().
00103 { 00104 m_module->manager ()->feedback 00105 (IgPluginManager::ErrorNoFactory, 00106 m_name + " (" + m_module->libraryName ().name () + ")"); 00107 ASSERT (false); 00108 }
const std::string& IgPluginInfo::m_category [private] |
Definition at line 67 of file IgPluginInfo.h.
Referenced by cache(), category(), detach(), IgPluginInfo(), module(), name(), and ~IgPluginInfo().
IgModule* IgPluginInfo::m_module [private] |
Definition at line 65 of file IgPluginInfo.h.
Referenced by cache(), category(), detach(), finish(), IgPluginInfo(), module(), name(), noFactory(), and ~IgPluginInfo().
std::string IgPluginInfo::m_name [private] |
Definition at line 66 of file IgPluginInfo.h.
Referenced by cache(), category(), detach(), IgPluginInfo(), module(), name(), noFactory(), and ~IgPluginInfo().