-
-
Notifications
You must be signed in to change notification settings - Fork 288
/
Copy pathplugin.h
94 lines (83 loc) · 1.77 KB
/
plugin.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef f3d_plugin_h
#define f3d_plugin_h
#include "reader.h"
#include <memory>
#include <string>
#include <vector>
namespace f3d
{
/**
* @class plugin
* @brief The base class of plugins
*
* Plugins implementation are automatically generated with CMake macros.
* This is the base class of every plugin.
*
* See ``f3d_plugin_init``, ``f3d_plugin_declare_reader``, and ``f3d_plugin_build`` in
* the ``f3dPlugin.cmake`` module.
*
* @warning This file is used internally by the plugin SDK, it should not be included
* directly by libf3d users.
*/
class plugin
{
public:
plugin(const std::string& name, const std::string& desc, const std::string& vers,
const std::vector<std::shared_ptr<reader>>& readers)
: Name(name)
, Description(desc)
, Version(vers)
, Readers(readers)
{
}
/**
* Get the name of this plugin
*/
const std::string& getName() const
{
return this->Name;
}
/**
* Get the description of this plugin
*/
const std::string& getDescription() const
{
return this->Description;
}
/**
* Get the version of this plugin
*/
const std::string& getVersion() const
{
return this->Version;
}
/**
* Get the list of readers created by this plugin
*/
const std::vector<std::shared_ptr<reader>>& getReaders() const
{
return this->Readers;
}
///@{
/**
* Set/Get the origin of this plugin, usually static, system or an actual path
* Set by the engine.
*/
const std::string& getOrigin() const
{
return this->Origin;
}
void setOrigin(const std::string& origin)
{
this->Origin = origin;
}
///@}
private:
std::string Name;
std::string Description;
std::string Version;
std::vector<std::shared_ptr<reader>> Readers;
std::string Origin = "undefined";
};
}
#endif