mc_rtc::LTDLHandle Class Reference

Wrapper around lt_dlhandle. More...

#include <mc_rtc/loader.h>

Public Member Functions

 LTDLHandle (const std::string &class_name, const std::string &path, const std::string &rpath, bool verbose)
 
 ~LTDLHandle ()
 
 LTDLHandle (const LTDLHandle &)=delete
 
LTDLHandleoperator= (const LTDLHandle &)=delete
 
template<typename SymT >
SymT get_symbol (const std::string &name)
 
bool valid () const
 
const std::vector< std::string > & classes () const
 
const std::string & path () const
 
std::string dir () const
 

Detailed Description

Wrapper around lt_dlhandle.

On creation it will load the library to check:

  • if a provided symbol is defined in the library
  • if it should be loaded globally

After that the library will be closed and opened when symbols are requested by the user

Constructor & Destructor Documentation

◆ LTDLHandle() [1/2]

mc_rtc::LTDLHandle::LTDLHandle ( const std::string &  class_name,
const std::string &  path,
const std::string &  rpath,
bool  verbose 
)

Create the handle wrapper

Parameters
class_nameSymbol that should be checked for
pathPath to the library
rpathPath(s) used to search for libraries, this is only used on Windows, on Linux/macOS one is advised to use RPATH capabilties
verboseIf true, output debug information

◆ ~LTDLHandle()

mc_rtc::LTDLHandle::~LTDLHandle ( )

◆ LTDLHandle() [2/2]

mc_rtc::LTDLHandle::LTDLHandle ( const LTDLHandle )
delete

Member Function Documentation

◆ classes()

const std::vector<std::string>& mc_rtc::LTDLHandle::classes ( ) const
inline

Returns a list of available classes provided by this library

◆ dir()

std::string mc_rtc::LTDLHandle::dir ( ) const

Access the library folder location

◆ get_symbol()

template<typename SymT >
SymT mc_rtc::LTDLHandle::get_symbol ( const std::string &  name)

Get a symbol, returns nullptr if the symbol is not found

Parameters
nameName of the symbol to get

◆ operator=()

LTDLHandle& mc_rtc::LTDLHandle::operator= ( const LTDLHandle )
delete

◆ path()

const std::string& mc_rtc::LTDLHandle::path ( ) const
inline

Access the path to the library

◆ valid()

bool mc_rtc::LTDLHandle::valid ( ) const
inline

True if the library is valid


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