Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | List of all members
datatools::library_loader Class Reference

A DLL loader class. More...

#include <bayeux/datatools/library_loader.h>

Inheritance diagram for datatools::library_loader:

Public Types

typedef datatools::detail::DynamicLoader::SymbolPointer symbol_ptr
 

Public Member Functions

 library_loader ()
 Default constructor. More...
 
 library_loader (const std::string &config_file_)
 Construct with path to config file. More...
 
 library_loader (const datatools::multi_properties &config_)
 Construct and instance with default flags and multi_properties. More...
 
virtual ~library_loader ()
 Destructor. More...
 
bool has (const std::string &name_) const
 Return true if the DLL with name is setup. More...
 
bool is_loaded (const std::string &name_) const
 Return true if the DLL with name is loaded. More...
 
int registration (const std::string &name_, const std::string &directory_="", const std::string &filename_="", const std::string &full_path_="", const std::string &version_="", bool autoload_=false)
 Register a DLL. More...
 
int load (const std::string &name_, const std::string &directory_="", const std::string &filename_="", const std::string &full_path_="", const std::string &version_="")
 Load a DLL. More...
 
int close (const std::string &name_)
 Close a DLL. More...
 
int close_all ()
 Close all DLLs. More...
 
void print (std::ostream &out_=std::clog) const
 Smart print libraries configured/loaded to supplied stream. More...
 
symbol_ptr get_symbol_address (const std::string &name_, const std::string &symbol_)
 Return pointer to symbol in named library. More...
 

Protected Member Functions

void _init ()
 Protected initialization. More...
 

Detailed Description

A DLL loader class.

Member Typedef Documentation

◆ symbol_ptr

Constructor & Destructor Documentation

◆ library_loader() [1/3]

datatools::library_loader::library_loader ( )

Default constructor.

◆ library_loader() [2/3]

datatools::library_loader::library_loader ( const std::string &  config_file_)
explicit

Construct with path to config file.

◆ library_loader() [3/3]

datatools::library_loader::library_loader ( const datatools::multi_properties config_)

Construct and instance with default flags and multi_properties.

◆ ~library_loader()

virtual datatools::library_loader::~library_loader ( )
virtual

Destructor.

Member Function Documentation

◆ _init()

void datatools::library_loader::_init ( )
protected

Protected initialization.

◆ close()

int datatools::library_loader::close ( const std::string &  name_)

Close a DLL.

◆ close_all()

int datatools::library_loader::close_all ( )

Close all DLLs.

◆ get_symbol_address()

symbol_ptr datatools::library_loader::get_symbol_address ( const std::string &  name_,
const std::string &  symbol_ 
)

Return pointer to symbol in named library.

◆ has()

bool datatools::library_loader::has ( const std::string &  name_) const

Return true if the DLL with name is setup.

◆ is_loaded()

bool datatools::library_loader::is_loaded ( const std::string &  name_) const

Return true if the DLL with name is loaded.

◆ load()

int datatools::library_loader::load ( const std::string &  name_,
const std::string &  directory_ = "",
const std::string &  filename_ = "",
const std::string &  full_path_ = "",
const std::string &  version_ = "" 
)

Load a DLL.

  • name the name of the library if the directory is empty, then the name can use the following format: name@directory
  • directory the directory where the shared library file is stored
  • filename the name of the shared library file
  • full_path the full path of the shared library file
  • version the version of the shared library

◆ print()

void datatools::library_loader::print ( std::ostream &  out_ = std::clog) const

Smart print libraries configured/loaded to supplied stream.

◆ registration()

int datatools::library_loader::registration ( const std::string &  name_,
const std::string &  directory_ = "",
const std::string &  filename_ = "",
const std::string &  full_path_ = "",
const std::string &  version_ = "",
bool  autoload_ = false 
)

Register a DLL.


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