-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoader.h
34 lines (29 loc) · 885 Bytes
/
Loader.h
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
#pragma once
#include <Windows.h>
#include <map>
#include <vector>
#include <filesystem>
#include <vector>
#include "Operator.h"
class Loader
{
private:
std::vector< HINSTANCE> libraries;
std::string folder;
std::string extension;
public:
Loader(const std::string& folder, const std::string& extension) : libraries({}), folder(folder), extension(extension) {};
Loader() = default;
Loader(const Loader&) = default;
Loader(Loader&&) = default;
Loader& operator = (const Loader&) = default;
Loader& operator = (Loader&&) = default;
~Loader()
{
for (const auto& lib : libraries)
FreeLibrary(lib);
libraries.clear();
}
void getOperatorFromDll(std::map<std::string, std::unique_ptr<Operator>>& operations, const HINSTANCE& load);
void loadDll(std::map<std::string, std::unique_ptr<Operator>>& operations, const std::string& folder, const std::string& extension);
};