$Date: 2004/06/28 11:58:13 $ |
PluginManager
Main holder of plug-in information. It is a singleton in the application.
Collection of PluginFactories (one per each plug-in category). Collection
of Modules. [equivalent to IgPluginDB]
PluginCache
Maintains the [raw] plug-in information up to date. Scans the list (using
the PluginPath) of directories where plug-in modules can reside and loads the
raw information found in there (in form of manifests) and checks their
validity. [equivalent to IgPluginCache]
PluginFactoryBase
Base class for all the plug-in factories for each category. It is only needed
because in general each plug-in category requires a different (templated)
factory since the arguments and return type of the instanciate() method are
dependent on the category. [equivalent to IgPluginDBViewBase]
PluginFactory<T>
Templated plug-in factory in the type of PluginInfo specific to a plug-in
category. Collection of PluginInfo for all available plug-ins for a given
category. [equivalent to IgPluginDBView<T>]
PluginInfo
Information about a given plug-in (plug-in name, category name) that can be
reconstructed from the cache (from the found manifests). It
encapsulates the "real factory" that is able to instantiate objects of this
plug-in type. [equivalent to IgPluginDBInfo]
Module
Module represents a dynamic library that contains one or more plug-ins. It
contains the information like filename, and the behavior on how to load and
unload the library. The Module exists even before the dynamic library it
represents is loaded into memory. It has a ModuleDef associated to it
when the library is loaded. [equivalent to IgPlugin]
ModuleDef
An instance of a specific ModuleDef is created statically when the dynamic
library gets loaded. It provides the support methods attach(), detach() and
declare(). [equivalent to IgPluginDef]
// Module provider DEFINE_SEAL_MODULE( MyModuleDef ) void MyModuleDef::declare(void) { MyCategoryFactory::Def<MyPlugin>::declare(this); MyCategoryFactory::Def<MyOtherPlugin>::declare(this); } void MyModuleDef::attach(void) { MyCategoryFactory::Def<MyPlugin>::installFactory(this); MyCategoryFactory::Def<MyOtherPlugin>::installFactory(this); } |
// Factory client IMyInterface* p = MyCategoryFactory::get()->instantiate("MyPlugin", arg1, arg2); |