35 #ifndef plugin_factory_h
36 #define plugin_factory_h
47 using std::unary_function;
64 map<string, BESPlugin<C> *> d_children;
88 :
public unary_function<pair<string, BESPlugin<C> *>, void>
117 for_each(d_children.begin(), d_children.end(), DeletePlugins());
128 d_children.insert(std::make_pair(name, child_class));
149 if (!child_implementation)
150 throw NoSuchObject(
string(
"No class is bound to ") + name, __FILE__, __LINE__ );
154 virtual void dump( ostream &strm )
const
156 strm <<
"BESPluginFactory::dump - (" << (
void *)
this <<
")" << endl ;
exception thrown if inernal error encountered
Thrown as an exception when BESPlugin cannot find the named shareable library.
Thrown as an exception when BESPlugin cannot find or run the maker() function in a shared library alr...
BESPluginFactory()
Create an empty BESPluginFactory.
M * instantiate()
Instantiate the object.
Base object for bes objects.
BESPluginFactory(const string &name, const string &library_name)
Create a BESPluginFactory and set up a single entry.
virtual ~BESPluginFactory()
A Factory for objects whose implementations reside in shared objects designed to be loaded at run tim...
virtual void dump(ostream &strm) const
dump the contents of this object to the specified ostream
void add_mapping(const string &name, const string &library_name)
Add a mapping of name to library_name to the BESPluginFactory.