Public Member Functions | Private Attributes | List of all members
WireCell::Plugin Class Reference

#include <PluginManager.h>

Public Member Functions

 Plugin (void *lib)
 
 ~Plugin ()
 
void * raw (const std::string &symbol_name)
 
bool contains (const std::string &symbol_name)
 
template<typename T >
bool symbol (const std::string &symbol_name, T &ret)
 

Private Attributes

void * m_lib
 

Detailed Description

Definition at line 11 of file PluginManager.h.

Constructor & Destructor Documentation

Plugin::Plugin ( void *  lib)

Definition at line 10 of file PluginManager.cxx.

10 : m_lib(lib) {}
Plugin::~Plugin ( )

Definition at line 11 of file PluginManager.cxx.

11 { dlclose(m_lib); }

Member Function Documentation

bool Plugin::contains ( const std::string symbol_name)

Definition at line 19 of file PluginManager.cxx.

20 {
21  return nullptr != raw(symbol_name);
22 }
void * raw(const std::string &symbol_name)
void * Plugin::raw ( const std::string symbol_name)

Definition at line 13 of file PluginManager.cxx.

14 {
15  void* ret= dlsym(m_lib, symbol_name.c_str());
16  return ret;
17 }
template<typename T >
bool WireCell::Plugin::symbol ( const std::string symbol_name,
T &  ret 
)
inline

Definition at line 21 of file PluginManager.h.

21  {
22  void* thing = raw(symbol_name);
23  if (!thing) { return false; }
24  ret = reinterpret_cast<T>(thing);
25  return true;
26  }
void * raw(const std::string &symbol_name)

Member Data Documentation

void* WireCell::Plugin::m_lib
private

Definition at line 28 of file PluginManager.h.


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