-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathDynamicLibrary.h
More file actions
38 lines (30 loc) · 782 Bytes
/
DynamicLibrary.h
File metadata and controls
38 lines (30 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @file DynamicLibrary.h
* @brief This class implements a C++ wrapper to load shared libraries (.so)
*/
#pragma once
#include <exception>
#include <string>
class DynamicLibrary
{
public:
DynamicLibrary(const char *fileName);
~DynamicLibrary();
/**
* @brief getFunctionPtr Resolve the symbol name
* @param name The symbol name to resolve
* @return The resolved function
*/
void *getFunctionPtr(const char *name) const;
DynamicLibrary(const DynamicLibrary &) = delete;
DynamicLibrary & operator = (const DynamicLibrary &other) = delete;
private:
void *libHandle;
};
class OpenLibFailedException: public std::exception
{
virtual const char* what() const throw()
{
return "Failed to open Library";
}
};