-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCppPluginInterfaceTest.cpp
More file actions
41 lines (32 loc) · 1.14 KB
/
CppPluginInterfaceTest.cpp
File metadata and controls
41 lines (32 loc) · 1.14 KB
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
#include <iostream>
#include "PluginInterface.h"
// Testbed for Plugin Interface
int main()
{
{
// Load the plugin -> Check std::cout for various init/deinit messages etc.
auto pPlugin = createPluginInterface("./Plugins/PluginA.dll");
if (pPlugin == nullptr)
return -1;
auto pLinescan = pPlugin->getLinescan();
if (pLinescan == nullptr)
return -1;
auto PrintLinescan = [](const decltype(pLinescan)& pLinescan)
{
std::cout << "Linescan:\t";
for (int val : *pLinescan)
std::cout << val << '\t';
std::cout << '\n';
};
PrintLinescan(pLinescan);
pLinescan = pPlugin->getLinescan();
if (pLinescan == nullptr)
return -1;
PrintLinescan(pLinescan);
auto pExampleClass = pPlugin->createExampleClass("Foo");
std::cout << "Hey: " << pExampleClass->getName() << '\n';
pExampleClass = pPlugin->createExampleClass("Bar");
std::cout << "Hey: " << pExampleClass->getName() << '\n';
}
return 0;
}