shlibpp::SharedLibrary Class Reference

Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it. More...

`#include <robottestingframework/dll/SharedLibrary.h>`

## Public Member Functions

| SharedLibrary ()
| Initialize, without opening a shared library yet. More...
| SharedLibrary (const char *filename)
| Load the named shared library / DLL. More...
virtual | ~SharedLibrary ()
| Destructor. More...
bool | open (const char *filename)
| Load the named shared library / DLL. More...
bool | close ()
| Shared library no longer needed, unload if not in use elsewhere. More...
std::string | error ()
| Returns a human-readable string describing the most recent error that occurred from a call to one of its functions. More...
void * | getSymbol (const char *symbolName)
| Look up a symbol in the shared library. More...
bool | isValid () const
| Check if the shared library is valid. More...

## Private Member Functions

| SharedLibrary (const SharedLibrary &)
SharedLibrary & | operator= (const SharedLibrary &)

## Private Attributes

void * | implementation
std::string | err_message

## Detailed Description

Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it.

Definition at line 35 of file SharedLibrary.h.

## Constructor & Destructor Documentation

## SharedLibrary() [1/3]

shlibpp::SharedLibrary::SharedLibrary | ( |  | ) |

Initialize, without opening a shared library yet.

## SharedLibrary() [2/3]

shlibpp::SharedLibrary::SharedLibrary | ( | const char * | filename | ) |

Load the named shared library / DLL.

Parameters

  filename | name of file (see open method)

## ~SharedLibrary()

virtual shlibpp::SharedLibrary::~SharedLibrary | ( |  | ) |

virtual

Destructor.

Will close() if needed.

## SharedLibrary() [3/3]

shlibpp::SharedLibrary::SharedLibrary | ( | const SharedLibrary & |  | ) |

private

## Member Function Documentation

## close()

bool shlibpp::SharedLibrary::close | ( |  | ) |

Shared library no longer needed, unload if not in use elsewhere.

Returns
  true on success

## error()

std::string shlibpp::SharedLibrary::error | ( |  | ) |

Returns a human-readable string describing the most recent error that occurred from a call to one of its functions.

Returns
  the most recent error

## getSymbol()

void* shlibpp::SharedLibrary::getSymbol | ( | const char * | symbolName | ) |

Look up a symbol in the shared library.

## isValid()

bool shlibpp::SharedLibrary::isValid | ( |  | ) | const

Check if the shared library is valid.

Returns
  true iff a valid library has been loaded.

## open()

bool shlibpp::SharedLibrary::open | ( | const char * | filename | ) |

Load the named shared library / DLL.

The library is found using the algoithm of ACE::ldfind. Operating-system-specific extensions will be tried, and the relevant path for shared libraries.

Parameters

  filename | name of file.

Returns
  true on success

## operator=()

SharedLibrary& shlibpp::SharedLibrary::operator= | ( | const SharedLibrary & |  | ) |

private

## Member Data Documentation

## err_message

std::string shlibpp::SharedLibrary::err_message

private

Definition at line 94 of file SharedLibrary.h.

## implementation

void* shlibpp::SharedLibrary::implementation

private

Definition at line 93 of file SharedLibrary.h.

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

- src/plugins/dll/include/robottestingframework/dll/SharedLibrary.h