DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ers::PluginManager::SharedLibrary Class Reference

Public Member Functions

 SharedLibrary (const std::string &name)
 
 ~SharedLibrary ()
 

Private Attributes

void * handle_
 

Detailed Description

Definition at line 39 of file PluginManager.hpp.

Constructor & Destructor Documentation

◆ SharedLibrary()

ers::PluginManager::SharedLibrary::SharedLibrary ( const std::string & name)

Loads a shared library and locates the create function. Stores a pointer to the create function in the map indexed by the library name.

Parameters
nameName of the class to be loaded (library name excluding lib prefix and .so suffix).

Definition at line 21 of file PluginManager.cpp.

22 {
23#ifndef __rtems__
24 std::string library = "lib" + name + ".so" ;
25
26 handle_ = dlopen( library.c_str(), RTLD_LAZY|RTLD_GLOBAL );
27 char * error = dlerror();
28
29 if ( !handle_ )
30 {
31 throw PluginException( error );
32 }
33#endif
34 }
Factory couldn t std::string alg_name Invalid configuration error
Definition Issues.hpp:34

◆ ~SharedLibrary()

ers::PluginManager::SharedLibrary::~SharedLibrary ( )

Unloads dynamic library and removes it from the map.

Definition at line 36 of file PluginManager.cpp.

37 {
39 // Library should be unloaded, but with some compilers (e.g gcc323)
40 // this results in crash of program, because it is not recognized
41 // that the library is still in use
43
44 //dlclose( handle_ );
45 }

Member Data Documentation

◆ handle_

void* ers::PluginManager::SharedLibrary::handle_
private

Definition at line 54 of file PluginManager.hpp.


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