MySQL 9.1.0
Source Code Documentation
mysql_harness::DynamicLibrary Class Reference

A DynamicLibrary. More...

#include <dynamic_loader.h>

Public Types

using native_handle_type = void *
 

Public Member Functions

 DynamicLibrary ()=default
 
 DynamicLibrary (const DynamicLibrary &)=delete
 
 DynamicLibrary (DynamicLibrary &&rhs)
 
DynamicLibraryoperator= (const DynamicLibrary &)=delete
 
DynamicLibraryoperator= (DynamicLibrary &&rhs)
 
 ~DynamicLibrary ()
 destruct a DynamicLibrary. More...
 
void unload ()
 unload a DynamicLibary if it is loaded. More...
 
native_handle_type native_handle () const
 get the native handle to the shared object. More...
 
stdx::expected< void *, std::error_code > symbol (const std::string &name) const
 get a symbol from the dynamic library. More...
 
std::string error_msg () const
 get error message if symbol() failed with DynamicLoaderErrc::DlError. More...
 
std::string filename () const
 get filename of the loaded module. More...
 

Private Member Functions

 DynamicLibrary (std::string filename, native_handle_type handle)
 construct DynamicLibrary from native_handle. More...
 

Private Attributes

std::string filename_
 
native_handle_type handle_ {}
 
std::string error_msg_
 

Friends

class DynamicLoader
 

Detailed Description

A DynamicLibrary.

Member Typedef Documentation

◆ native_handle_type

Constructor & Destructor Documentation

◆ DynamicLibrary() [1/4]

mysql_harness::DynamicLibrary::DynamicLibrary ( )
default

◆ DynamicLibrary() [2/4]

mysql_harness::DynamicLibrary::DynamicLibrary ( const DynamicLibrary )
delete

◆ DynamicLibrary() [3/4]

mysql_harness::DynamicLibrary::DynamicLibrary ( DynamicLibrary &&  rhs)
inline

◆ ~DynamicLibrary()

mysql_harness::DynamicLibrary::~DynamicLibrary ( )
inline

destruct a DynamicLibrary.

unloads dynamic library if it is loaded

◆ DynamicLibrary() [4/4]

mysql_harness::DynamicLibrary::DynamicLibrary ( std::string  filename,
native_handle_type  handle 
)
inlineprivate

construct DynamicLibrary from native_handle.

Parameters
filenamefilename on the loaded library
handlehandle to the loaded library

Member Function Documentation

◆ error_msg()

std::string mysql_harness::DynamicLibrary::error_msg ( ) const
inline

get error message if symbol() failed with DynamicLoaderErrc::DlError.

◆ filename()

std::string mysql_harness::DynamicLibrary::filename ( ) const
inline

get filename of the loaded module.

◆ native_handle()

native_handle_type mysql_harness::DynamicLibrary::native_handle ( ) const
inline

get the native handle to the shared object.

◆ operator=() [1/2]

DynamicLibrary & mysql_harness::DynamicLibrary::operator= ( const DynamicLibrary )
delete

◆ operator=() [2/2]

DynamicLibrary & mysql_harness::DynamicLibrary::operator= ( DynamicLibrary &&  rhs)
inline

◆ symbol()

stdx::expected< void *, std::error_code > mysql_harness::DynamicLibrary::symbol ( const std::string &  name) const

get a symbol from the dynamic library.

◆ unload()

void mysql_harness::DynamicLibrary::unload ( )

unload a DynamicLibary if it is loaded.

Friends And Related Function Documentation

◆ DynamicLoader

friend class DynamicLoader
friend

Member Data Documentation

◆ error_msg_

std::string mysql_harness::DynamicLibrary::error_msg_
mutableprivate

◆ filename_

std::string mysql_harness::DynamicLibrary::filename_
private

◆ handle_

native_handle_type mysql_harness::DynamicLibrary::handle_ {}
private

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