2023-08-28 12:31:18 +02:00
|
|
|
/* Loadable / plugin support.
|
2018-08-21 00:25:44 +02:00
|
|
|
*
|
2023-08-31 11:17:07 +02:00
|
|
|
* Author: Steffen Vogel <post@steffenvogel.de>
|
|
|
|
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2023-08-28 12:31:18 +02:00
|
|
|
*/
|
2018-08-21 00:25:44 +02:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
#include <dlfcn.h>
|
2018-08-21 00:25:44 +02:00
|
|
|
#include <iostream>
|
|
|
|
#include <new>
|
2023-09-07 13:19:19 +02:00
|
|
|
#include <string>
|
2018-08-21 00:25:44 +02:00
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
#include <villas/plugin.hpp>
|
|
|
|
|
2018-08-23 13:22:46 +02:00
|
|
|
using namespace villas::plugin;
|
2018-08-21 00:25:44 +02:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
Registry *villas::plugin::registry = nullptr;
|
2018-08-21 00:25:44 +02:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
Plugin::Plugin() {
|
|
|
|
if (registry == nullptr)
|
|
|
|
registry = new Registry();
|
2022-02-25 09:52:09 -05:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
registry->add(this);
|
2018-08-21 00:25:44 +02:00
|
|
|
}
|
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
Plugin::~Plugin() { registry->remove(this); }
|
2018-08-21 00:25:44 +02:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
void Plugin::dump() {
|
|
|
|
getLogger()->info("Name: '{}' Description: '{}'", getName(),
|
|
|
|
getDescription());
|
2018-08-21 00:25:44 +02:00
|
|
|
}
|