#include <BESPluginFactory.h>
Inheritance diagram for BESPluginFactory< C >:
Public Member Functions | |
BESPluginFactory (const string &name, const string &library_name) | |
BESPluginFactory () | |
virtual | ~BESPluginFactory () |
void | add_mapping (const string &name, const string &library_name) |
C * | get (const string &name) throw (NoSuchObject, NoSuchLibrary) |
virtual void | dump (ostream &strm) const |
dump the contents of this object to the specified ostream | |
Classes | |
struct | DeletePlugins |
Definition at line 34 of file BESPluginFactory.h.
BESPluginFactory< C >::BESPluginFactory | ( | const string & | name, | |
const string & | library_name | |||
) | [inline] |
Create a BESPluginFactory and set up a single entry. configure other entries using the add_mapping() method.
name | Use name to get an instance of the child defined in library_name. | |
library_name | The name of the library which contains the child class implementation. |
Definition at line 79 of file BESPluginFactory.h.
BESPluginFactory< C >::BESPluginFactory | ( | ) | [inline] |
Create an empty BESPluginFactory.
Definition at line 86 of file BESPluginFactory.h.
virtual BESPluginFactory< C >::~BESPluginFactory | ( | ) | [inline, virtual] |
Definition at line 88 of file BESPluginFactory.h.
void BESPluginFactory< C >::add_mapping | ( | const string & | name, | |
const string & | library_name | |||
) | [inline] |
Add a mapping of name to library_name to the BESPluginFactory.
name | The child object's name. | |
library_name | The name of the library which holds its implementation. |
Definition at line 98 of file BESPluginFactory.h.
Referenced by BESPluginFactory< BESAbstractModule >::BESPluginFactory().
C* BESPluginFactory< C >::get | ( | const string & | name | ) | throw (NoSuchObject, NoSuchLibrary) [inline] |
Use the BESPlugingFactory to get an instance of the class C matched to name. Once the name name has been bound to a SO library library_name, this method can be used to get an instance of the object whose implementation is in the SO file using only the name name.
name | The name registered with the implementation of a child of the class C using either the PlugFactory ctor or the add_mapping method. |
NoSuchObject | thrown if name has not been registered. | |
NoSuchLibrary | thrown if the library matched to name cannot be found. |
Definition at line 119 of file BESPluginFactory.h.
Referenced by BESModuleApp::terminate().
virtual void BESPluginFactory< C >::dump | ( | ostream & | strm | ) | const [inline, virtual] |
dump the contents of this object to the specified ostream
This method is implemented by all derived classes to dump their contents, in other words, any state they might have, private variables, etc...
The inline function below can be used to dump the contents of an OPeNDAOObj object. For example, the object Animal is derived from BESObj. A user could do the following:
Animal *a = new dog( "Sparky" ) ; cout << a << endl ;
And the dump method for dog could display the name passed into the constructor, the (this) pointer of the object, etc...
strm | C++ i/o stream to dump the object to |
Implements BESObj.
Definition at line 127 of file BESPluginFactory.h.