mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 02:19:58 +02:00
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
//
|
|
// Created by Anthony Thibault on 2015/12/18
|
|
// Copyright 2015 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#include <mutex>
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QtPlugin>
|
|
#include <QtCore/QStringList>
|
|
|
|
#include <plugins/RuntimePlugin.h>
|
|
#include <plugins/InputPlugin.h>
|
|
|
|
#include "NeuronPlugin.h"
|
|
|
|
class NeuronProvider : public QObject, public InputProvider
|
|
{
|
|
Q_OBJECT
|
|
Q_PLUGIN_METADATA(IID InputProvider_iid FILE "plugin.json")
|
|
Q_INTERFACES(InputProvider)
|
|
|
|
public:
|
|
NeuronProvider(QObject* parent = nullptr) : QObject(parent) {}
|
|
virtual ~NeuronProvider() {}
|
|
|
|
virtual InputPluginList getInputPlugins() override {
|
|
static std::once_flag once;
|
|
std::call_once(once, [&] {
|
|
InputPluginPointer plugin(std::make_shared<NeuronPlugin>());
|
|
if (plugin->isSupported()) {
|
|
_inputPlugins.push_back(plugin);
|
|
}
|
|
});
|
|
return _inputPlugins;
|
|
}
|
|
|
|
virtual void destroyInputPlugins() override {
|
|
_inputPlugins.clear();
|
|
}
|
|
|
|
private:
|
|
InputPluginList _inputPlugins;
|
|
};
|
|
|
|
#include "NeuronProvider.moc"
|