bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESPlugin< M > Class Template Reference

#include <BESPlugin.h>

Inheritance diagram for BESPlugin< M >:
Inheritance graph
Collaboration diagram for BESPlugin< M >:
Collaboration graph

Public Member Functions

 BESPlugin (const BESPlugin &p)=delete
 
 BESPlugin (const std::string &filename)
 
void dump (std::ostream &strm) const override
 dump the contents of this object to the specified ostream
 
M * instantiate ()
 
BESPluginoperator= (const BESPlugin &p)=delete
 

Detailed Description

template<typename M>
class BESPlugin< M >

BESPlugin provides a mechanism that can load C++ classes at runtime. Classes are compiled and stored in shareable-object libraries. This class binds the name of that class (which is used by Plugin's client) to the name of the library.

Each class/library must contain at least one function. The function must have the name and type signature ‘extern "C" M* maker()’ and must return a pointer to a new instance of the class M. Note that M is the parameter of the Plugin template. Suppose you have a base class Base and a collection of specializations S1, S2, ..., Sn. You would use N instances of BESPlugin<Base> to provide access to the implementations in those
N shareable-object libraries. The exectuable that loads the libraries must have been compiled and linked with Base.

External symbols defined in the library will be made available to subsequently loaded libraries.

Author
James Gallagher

Definition at line 92 of file BESPlugin.h.

Constructor & Destructor Documentation

◆ BESPlugin()

template<typename M>
BESPlugin< M >::BESPlugin ( const std::string & filename)
inlineexplicit

Create a new BESPlugin.

Parameters
filenameThe name of the sharable object library that holds the class' implementation.

Definition at line 119 of file BESPlugin.h.

Member Function Documentation

◆ dump()

template<typename M>
void BESPlugin< M >::dump ( std::ostream & strm) const
inlineoverridevirtual

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 OPeNDAPObj 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...

Parameters
strmC++ i/o stream to dump the object to

Implements BESObj.

Definition at line 143 of file BESPlugin.h.

◆ instantiate()

template<typename M>
M * BESPlugin< M >::instantiate ( )
inline

Instantiate the object. Using the maker function found in the shareable-object library, create a new instance of class M where M was the template parameter of BESPlugin.

Returns
A pointer to the new instance.

Definition at line 130 of file BESPlugin.h.


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