BESPluginFactory< C > Class Template Reference

A Factory for objects whose implementations reside in shared objects designed to be loaded at run time. More...

#include <BESPluginFactory.h>

Inheritance diagram for BESPluginFactory< C >:
Inheritance graph
[legend]
Collaboration diagram for BESPluginFactory< C >:
Collaboration graph
[legend]

List of all members.

Classes

struct  DeletePlugins

Public Member Functions

void add_mapping (const string &name, const string &library_name)
 Add a mapping of name to library_name to the BESPluginFactory.
 BESPluginFactory ()
 Create an empty BESPluginFactory.
 BESPluginFactory (const string &name, const string &library_name)
 Create a BESPluginFactory and set up a single entry.
virtual void dump (ostream &strm) const
C * get (const string &name) throw (NoSuchObject, NoSuchLibrary)
 Use the BESPlugingFactory to get an instance of the class C matched to name.
virtual ~BESPluginFactory ()

Detailed Description

template<typename C>
class BESPluginFactory< C >

A Factory for objects whose implementations reside in shared objects designed to be loaded at run time.

This uses the BESPlugin class to perform the actual instantiation of those objects; the role of this class is to maintain a mapping between the names of the SO libraries and the names of the C++ object implementations they hold.

See also:
BESPlugin

Definition at line 61 of file BESPluginFactory.h.


Constructor & Destructor Documentation

template<typename C>
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.

Parameters:
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.
See also:
add_mapping.

Definition at line 106 of file BESPluginFactory.h.

template<typename C>
BESPluginFactory< C >::BESPluginFactory (  )  [inline]

Create an empty BESPluginFactory.

Definition at line 113 of file BESPluginFactory.h.

template<typename C>
virtual BESPluginFactory< C >::~BESPluginFactory (  )  [inline, virtual]

Definition at line 115 of file BESPluginFactory.h.


Member Function Documentation

template<typename C>
void BESPluginFactory< C >::add_mapping ( const string &  name,
const string &  library_name 
) [inline]

Add a mapping of name to library_name to the BESPluginFactory.

Parameters:
name The child object's name.
library_name The name of the library which holds its implementation.

Definition at line 125 of file BESPluginFactory.h.

Referenced by BESPluginFactory< BESAbstractModule >::BESPluginFactory().

template<typename C>
virtual void BESPluginFactory< C >::dump ( ostream &  strm  )  const [inline, virtual]

Definition at line 154 of file BESPluginFactory.h.

template<typename C>
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.

Parameters:
name The name registered with the implementation of a child of the class C using either the PlugFactory ctor or the add_mapping method.
Exceptions:
NoSuchObject thrown if name has not been registered.
NoSuchLibrary thrown if the library matched to name cannot be found.

Definition at line 146 of file BESPluginFactory.h.

Referenced by BESModuleApp::terminate().


The documentation for this class was generated from the following file:

Generated on Sat Aug 22 06:06:08 2009 for OPeNDAP Hyrax Back End Server (BES) by  doxygen 1.6.0