![]() |
Diana Software
|
This class take care of plugin registration and creation. More...
Public Member Functions | |
| virtual | ~QGlobalRWFactory () |
| void | LoadPlugin (const std::string &name) |
| void | RegisterGlobalReader (QGlobalReaderFactory *GRF) |
| std::list< const QGlobalReaderFactory * > | GetListOfGlobalReaders () const |
| QGlobalReader * | CreateGlobalReader (const std::string &name) |
| void | RegisterGlobalWriter (QGlobalWriterFactory *GRF) |
| std::list< const QGlobalWriterFactory * > | GetListOfGlobalWriters () const |
| QGlobalWriter * | CreateGlobalWriter (const std::string &name) |
Public Member Functions inherited from QNamed | |
| QNamed () | |
| QNamed (const std::string &Name) | |
| virtual | ~QNamed () |
| const std::string & | GetName () const |
| void | SetName (const std::string &name) |
Static Public Member Functions | |
| static QGlobalRWFactory & | GetInstance () |
Private Member Functions | |
| QGlobalRWFactory () | |
Private Attributes | |
| Diana::QDLLLoader * | fDLLLoader |
| std::map< std::string, QGlobalReaderFactory * > | fGlobalReaders |
| std::map< std::string, QGlobalWriterFactory * > | fGlobalWriters |
This class take care of plugin registration and creation.
Each plugin (MyPlugin) must implement a function like this:
void registerInFactoryMyPlugin()
this function creates a MyPluginFactory and register it in the QGlobalRWFactory.
When at run time an application ask to LoadPlugin("MyPlugin") the QDll system
open the library that contains registerMyPlugin and executes it so that the MyPluginFactory
is automatically created and registered into the QGlobalRWFactory.
Once a plugin is registered other applications can call the CreatePluginType("MyPlugin") that
in turns call the MyPluginFactory and return a pointer to the newly created MyPlugin instance.
Reference: http://www.nuclex.org/articles/building-a-better-plugin-architecture (Option 1)
Definition at line 37 of file QGlobalRWFactory.hh.
|
virtual |
Definition at line 28 of file QGlobalRWFactory.cc.
References fGlobalReaders, and fGlobalWriters.
|
private |
Definition at line 15 of file QGlobalRWFactory.cc.
References QMessageHandler::Debug(), err, fDLLLoader, QNamed::GetName(), QMessageHandler::Panic(), Q_PLUGIN_PREFIX_STR, and QERR_SUCCESS.
| QGlobalReader * QGlobalRWFactory::CreateGlobalReader | ( | const std::string & | name | ) |
Definition at line 71 of file QGlobalRWFactory.cc.
References fGlobalReaders.
Referenced by QGlobalReaderDispatcher::GetReader().
| QGlobalWriter * QGlobalRWFactory::CreateGlobalWriter | ( | const std::string & | name | ) |
Definition at line 103 of file QGlobalRWFactory.cc.
References fGlobalWriters.
Referenced by QGlobalWriterDispatcher::GetWriter().
|
static |
Definition at line 9 of file QGlobalRWFactory.cc.
Referenced by QGlobalReaderDispatcher::GetReader(), QGlobalWriterDispatcher::GetWriter(), QModuleFactory::LoadLoadable(), and main().
| std::list< const QGlobalReaderFactory * > QGlobalRWFactory::GetListOfGlobalReaders | ( | ) | const |
Definition at line 62 of file QGlobalRWFactory.cc.
References fGlobalReaders.
Referenced by QGlobalReaderDispatcher::GetReader().
| std::list< const QGlobalWriterFactory * > QGlobalRWFactory::GetListOfGlobalWriters | ( | ) | const |
Definition at line 94 of file QGlobalRWFactory.cc.
References fGlobalWriters.
Referenced by QGlobalWriterDispatcher::GetWriter().
| void QGlobalRWFactory::LoadPlugin | ( | const std::string & | name | ) |
Definition at line 40 of file QGlobalRWFactory.cc.
References err, QMessageHandler::Error(), fDLLLoader, QNamed::GetName(), and QERR_SUCCESS.
Referenced by QGlobalReaderDispatcher::GetReader(), QGlobalWriterDispatcher::GetWriter(), QModuleFactory::LoadLoadable(), and main().
| void QGlobalRWFactory::RegisterGlobalReader | ( | QGlobalReaderFactory * | GRF | ) |
Definition at line 48 of file QGlobalRWFactory.cc.
References QMessageHandler::Debug(), fGlobalReaders, QNamed::GetName(), and QGlobalReaderFactory::GetName().
| void QGlobalRWFactory::RegisterGlobalWriter | ( | QGlobalWriterFactory * | GRF | ) |
Definition at line 80 of file QGlobalRWFactory.cc.
References QMessageHandler::Debug(), fGlobalWriters, QNamed::GetName(), and QGlobalWriterFactory::GetName().
|
private |
Definition at line 55 of file QGlobalRWFactory.hh.
Referenced by LoadPlugin(), and QGlobalRWFactory().
|
private |
Definition at line 57 of file QGlobalRWFactory.hh.
Referenced by CreateGlobalReader(), GetListOfGlobalReaders(), RegisterGlobalReader(), and ~QGlobalRWFactory().
|
private |
Definition at line 58 of file QGlobalRWFactory.hh.
Referenced by CreateGlobalWriter(), GetListOfGlobalWriters(), RegisterGlobalWriter(), and ~QGlobalRWFactory().