forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.h
More file actions
45 lines (35 loc) · 910 Bytes
/
Module.h
File metadata and controls
45 lines (35 loc) · 910 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
38
39
40
41
42
43
44
45
#pragma once
#ifdef WIN32
#include <wtypes.h>
#include <WinDef.h>
#endif
#include <string>
namespace System
{
class Module
{
protected:
#ifdef WIN32
::HMODULE lib_handle;
#elif POSIX
void *lib_handle;
#else
#error "Undefine platform"
#endif
public:
Module() noexcept;
Module(const std::string &libPath);
Module(const Module &obj) noexcept;
Module(Module &&obj) noexcept;
~Module() noexcept = default;
bool is_open() const noexcept;
bool open(const std::string &libPath);
void close() noexcept;
bool find(const std::string &symbolName, void *(**addr)(void *) ) const noexcept;
bool find(const char *symbolName, void *(**addr)(void *) ) const noexcept;
bool operator ==(const Module &obj) const noexcept;
bool operator !=(const Module &obj) const noexcept;
Module &operator =(const Module &obj) noexcept;
Module &operator =(Module &&obj) noexcept;
};
};