rt-vamp-plugin-sdk
0.3.1
Real-time Vamp plugin SDK for C++20
Loading...
Searching...
No Matches
pluginsdk
include
rtvamp
pluginsdk
EntryPoint.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "vamp/vamp.h"
4
5
#include "
rtvamp/pluginsdk/Plugin.hpp
"
6
#include "rtvamp/pluginsdk/detail/PluginAdapter.hpp"
7
8
namespace
rtvamp::pluginsdk
{
9
24
template
<
IsPlugin
... Plugins>
25
class
EntryPoint
{
26
public
:
27
static
constexpr
const
VampPluginDescriptor
*
getDescriptor
(
28
unsigned
int
version,
unsigned
int
index
// NOLINT(*easily-swapped-parameters)
29
) {
30
if
(version < 1 || version > VAMP_API_VERSION || index >= pluginCount) {
31
return
nullptr
;
32
}
33
return
descriptors[index];
34
}
35
36
private
:
37
static
constexpr
auto
pluginCount =
sizeof
...(Plugins);
38
39
static
constexpr
std::array<const VampPluginDescriptor*, pluginCount> descriptors{
40
{detail::PluginAdapter<Plugins>::getDescriptor()...}
41
};
42
};
43
44
}
// namespace rtvamp::pluginsdk
45
46
/* -------------------------------------------- Macro ------------------------------------------- */
47
48
// NOLINTBEGIN(*macro-usage)
49
58
#ifdef _MSC_VER
59
#define RTVAMP_EXPORT_FUNCTION \
60
__pragma(comment(linker, "/EXPORT:" __FUNCTION__"=" __FUNCDNAME__))
61
#else
62
#define RTVAMP_EXPORT_FUNCTION
63
#endif
64
68
#define RTVAMP_ENTRY_POINT(...) \
69
extern "C" const VampPluginDescriptor* vampGetPluginDescriptor( \
70
unsigned int hostApiVersion, \
71
unsigned int index \
72
) { \
73
RTVAMP_EXPORT_FUNCTION \
74
return ::rtvamp::pluginsdk::EntryPoint<__VA_ARGS__>::getDescriptor(hostApiVersion, index); \
75
}
76
77
// NOLINTEND(*macro-usage)
VampPluginDescriptor
_VampPluginDescriptor VampPluginDescriptor
Definition
PluginHostAdapter.hpp:14
rtvamp::pluginsdk::EntryPoint
Helper class to create the entry point for plugin libraries.
Definition
EntryPoint.hpp:25
rtvamp::pluginsdk::EntryPoint::getDescriptor
static constexpr const VampPluginDescriptor * getDescriptor(unsigned int version, unsigned int index)
Definition
EntryPoint.hpp:27
rtvamp::pluginsdk::IsPlugin
Definition
Plugin.hpp:149
rtvamp::pluginsdk
Definition
EntryPoint.hpp:8
Plugin.hpp
Generated by
1.9.8