#include <PlugInRegistration.h>
Public Member Functions | |
| DynamicPlugInFactory () | |
| virtual | ~DynamicPlugInFactory () |
| virtual void | init (bool locate, std::vector< std::string > &dynamicPlugIns)=0 |
| virtual PlugIn * | createPlugIn (const std::string &name)=0 |
To perform dynamic plug-in registration, a subclass of this class must be created that performs the actual dynamic plug-in registration. The subclass must then be provided as the second argument to the REGISTER_DYNAMIC_MODULE() macro. Please read Advanced Plug-In Registration for more details.
Definition at line 219 of file PlugInRegistration.h.
| DynamicPlugInFactory::DynamicPlugInFactory | ( | ) |
Constructor.
Definition at line 228 of file PlugInRegistration.h.
| virtual DynamicPlugInFactory::~DynamicPlugInFactory | ( | ) | [virtual] |
Definition at line 229 of file PlugInRegistration.h.
| virtual void DynamicPlugInFactory::init | ( | bool | locate, | |
| std::vector< std::string > & | dynamicPlugIns | |||
| ) | [pure virtual] |
Subclasses should perform any dynamic plug-in lookup in this function.
This function will be called once per application run, with a true value passed for the locate parameter. It is during this invocation, that this function should locate all dynamic plug-ins and insert unique string identifiers for each plug-in into the dynamicPlugIns vector. Every other time this function is invoked, the locate parameter will be passed a value of false. When this is done the previously located identifiers (those found when this function was called with a value of true for locate) will be provided to the dynamicPlugIns argument. The purpose of performing the additional calls to init() with locate having a value of false, is to allow the class instance to re-initialize any member state that might be necessary to implement the createPlugIn() function.
| locate | When true, this function should perform dynamic plug-in lookup and populate dynamicPlugIns with unique string identifiers for each plug-in. When false, this class can re-initialize any member state required for createPlugIn() to work properly. When false, the dynamicPlugIns argument will be pre-populated with the string identifiers located when function was called with this paramter having a value of true. | |
| dynamicPlugIns | The list of unique string identifiers for the dynamically located plug-ins. When the locate parameter is true, this list should be populated. When the locate parameter is false, this list will be pre-populated with the earlier values. When the locate paramter is false, any changes to this vector will be ignored by the invoking class. The string identifiers populated into this list, will be used when invoking createPlugIn(). |
| virtual PlugIn* DynamicPlugInFactory::createPlugIn | ( | const std::string & | name | ) | [pure virtual] |
Construct the given PlugIn instance.
| name | Construct the PlugIn instance associated with the unique string identifier. The string identifiers provided will be those returned from the init() function. |
NULL.