-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathMockInputModulePlugin.cpp
33 lines (26 loc) · 1.11 KB
/
MockInputModulePlugin.cpp
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "MockInputModulePlugin.h"
#include "CoreRegistry.h"
#include "InputStreamManager.h"
#include <Corrade/PluginManager/AbstractManager.h>
#include <Corrade/Utility/FormatStl.h>
CORRADE_PLUGIN_REGISTER(VisorInputMock, visor::input::mock::MockInputModulePlugin,
"visor.module.input/1.0")
namespace visor::input::mock {
void MockInputModulePlugin::setup_routes([[maybe_unused]] HttpServer *svr)
{
}
std::unique_ptr<InputStream> MockInputModulePlugin::instantiate(const std::string name, const Configurable *config, const Configurable *filter)
{
auto input_stream = std::make_unique<MockInputStream>(name);
input_stream->config_merge(*config);
input_stream->config_merge(*filter);
return input_stream;
}
std::string MockInputModulePlugin::generate_input_name(std::string prefix, const Configurable &config, [[maybe_unused]] const Configurable &filter)
{
return prefix + "-" + config.config_hash();
}
}