1#ifndef MSTL_PLUGIN_IPLUGIN_HPP__
2#define MSTL_PLUGIN_IPLUGIN_HPP__
3#include "MSTL/core/string/string.hpp"
16 virtual ~iplugin() =
default;
17 virtual const plugin_info& get_info()
const = 0;
19 virtual void execute() = 0;
20 virtual void shutdown() = 0;
23struct plugin_deleter {
25 void(* func_)(iplugin*) =
nullptr;
28 plugin_deleter() noexcept = default;
29 ~plugin_deleter() = default;
31 explicit plugin_deleter(
void(* func)(iplugin*)) noexcept : func_(func) {}
33 plugin_deleter(
const plugin_deleter&) =
delete;
34 plugin_deleter& operator =(
const plugin_deleter&) =
delete;
35 plugin_deleter(plugin_deleter&& pd) noexcept : func_(pd.func_) {
38 plugin_deleter& operator =(plugin_deleter&& pd)
noexcept {
44 void operator ()(iplugin* p)
const {
48 plugin_deleter rebind() &&
noexcept {
49 return plugin_deleter(
move(*
this));
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result)
移动范围元素
constexpr T initialize() noexcept(is_nothrow_default_constructible< T >::value)
返回类型T的默认初始化值