43 #include "BESInternalFatalError.h" 44 #include "BESInternalError.h" 47 #undef UNPLUG_HANDLERS 58 NoSuchLibrary(
const string &msg,
const string &file,
int line) :
69 NoSuchObject(
const string &msg,
const string &file,
int line) :
134 d_lib = dlopen(d_filename.c_str(), RTLD_NOW | RTLD_GLOBAL);
135 BESDEBUG(
"bes",
"BESPlugin: plug in handler:" << d_filename <<
", " << d_lib << endl);
150 d_filename(filename), d_lib(0)
158 BESDEBUG(
"bes",
"BESPlugin: unplugging handler:" << d_filename <<
", " << d_lib << endl);
159 #ifdef UNPLUG_HANDLERS 175 void *maker = dlsym(get_lib(),
"maker");
177 throw NoSuchObject(
string(dlerror()), __FILE__, __LINE__);
180 typedef M *(*maker_func_ptr)();
181 maker_func_ptr my_maker = *
reinterpret_cast<maker_func_ptr*
>(&maker);
182 M *my_M = (my_maker)();
187 virtual void dump(ostream &strm)
const 189 strm <<
"BESPlugin::dump - (" << (
void *)
this <<
")" << endl;
190 strm <<
" plugin name: " << d_filename << endl;
191 strm <<
" library handle: " << (
void *) d_lib << endl;
195 #endif // T_BESPlugin_h exception thrown if an internal error is found and is fatal to the BES
exception thrown if inernal error encountered
Base object for bes objects.
virtual void dump(ostream &strm) const
dump the contents of this object to the specified ostream
BESPlugin(const string &filename)