#include <Plugin.hpp>
Public Member Functions | |
PluginDescriptor (const std::string &name, Plugin::Type type) | |
Constructor. | |
virtual | ~PluginDescriptor () |
Destructor. | |
const std::string & | getName () const |
Get plugin name. | |
const Plugin::Type | getType () const |
Get plugin type. | |
Plugin * | create (Core::Logger *pLogger) const |
Create an instance of the plugin. | |
void | release (Plugin *pInstance, Core::Logger *pLogger) const |
Release an instance of the plugin. | |
Protected Member Functions | |
virtual Plugin * | createInstance (Core::Logger *pLogger) const =0 |
Create an instance of the plugin. | |
virtual void | releaseInstance (Plugin *pInstance, Core::Logger *pLogger) const =0 |
Release an instance of the plugin. | |
Private Attributes | |
Core::Logger * | m_pLogger |
Pointer to the logger to be used. | |
std::string | m_name |
Name of the plugin. | |
Plugin::Type | m_type |
Type of the plugin. | |
std::vector< Plugin * > | m_vPluginInstances |
List of created plugin instances. |
syBR::Game::PluginDescriptor::PluginDescriptor | ( | const std::string & | name, | |
Plugin::Type | type | |||
) |
Constructor.
Initialize name and type of the plugin
name | Name of the plugin | |
type | Type of the plugin |
syBR::Game::PluginDescriptor::~PluginDescriptor | ( | ) | [virtual] |
const std::string & syBR::Game::PluginDescriptor::getName | ( | ) | const |
Get plugin name.
const Plugin::Type syBR::Game::PluginDescriptor::getType | ( | ) | const |
Get plugin type.
Plugin * syBR::Game::PluginDescriptor::create | ( | Core::Logger * | pLogger | ) | const |
Create an instance of the plugin.
Create a new instance of the plugin and keep track of it.
pLogger | Pointer to the instance of the logger to use |
void syBR::Game::PluginDescriptor::release | ( | Plugin * | pInstance, | |
Core::Logger * | pLogger | |||
) | const |
Release an instance of the plugin.
Check if the instance has been created by this plugin descriptor and then release it if it is the case.
pInstance | Instance of the plugin to release | |
pLogger | Pointer to the instance of the logger to use |
virtual Plugin* syBR::Game::PluginDescriptor::createInstance | ( | Core::Logger * | pLogger | ) | const [protected, pure virtual] |
Create an instance of the plugin.
The create() function will take care of keeping a copy of the created instance of the plugin. This function must be overridden to create an instance of a subclass of Plugin().
pLogger | Pointer to the instance of the logger to use |
Implemented in syBR::InputOIS::PluginDescriptor.
virtual void syBR::Game::PluginDescriptor::releaseInstance | ( | Plugin * | pInstance, | |
Core::Logger * | pLogger | |||
) | const [protected, pure virtual] |
Release an instance of the plugin.
The release() function will take care of verifying that pInstance is a valid instance of the plugin. This function must be overridden to delete an instance of a subclass of Plugin().
pInstance | Instance of the plugin to release | |
pLogger | Pointer to the instance of the logger to use |
Implemented in syBR::InputOIS::PluginDescriptor.
Pointer to the logger to be used.
std::string syBR::Game::PluginDescriptor::m_name [private] |
Name of the plugin.
Type of the plugin.
std::vector<Plugin *> syBR::Game::PluginDescriptor::m_vPluginInstances [mutable, private] |
List of created plugin instances.
Copyright © 2008 by Sebastien Frippiat
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008