λ61
Loading...
Searching...
No Matches
ExtensionManager.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Tetex7
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18//
19// Created by tete on 05/08/2025.
20//
21#pragma once
22#ifndef L61_EXTENSIONMANAGER_HPP
23#define L61_EXTENSIONMANAGER_HPP
24
27
29{
31{
32private:
34public:
35 explicit ExtensionManager();
37
38 NativeExtension& lookupAndLoadExtension(const std::vector<std::string>& spaths, const std::string& extensionPath, l61_api_extension_ptr api, bool loadEntryPoint = true);
39
40 void unload(const std::string& plugin);
41
42 bool has(const std::string& exName) const;
43
45
46 const NativeExtension& get(const std::string& exName) const;
47 const NativeExtension& operator[](const std::string& exName) const;
48
52};
53}
54
55
56#endif //EXTENSIONMANAGER_HPP
ExtensionManager(ExtensionManager &&)=delete
const NativeExtension & operator[](const std::string &exName) const
Definition ExtensionManager.cpp:65
HashMap< std::string, std::unique_ptr< NativeExtension > > extension_map
Definition ExtensionManager.hpp:33
ExtensionManager(const ExtensionManager &)=delete
ExtensionManager(ExtensionManager &)=delete
void unload(const std::string &plugin)
Definition ExtensionManager.cpp:44
NativeExtension & lookupAndLoadExtension(const std::vector< std::string > &spaths, const std::string &extensionPath, l61_api_extension_ptr api, bool loadEntryPoint=true)
Definition ExtensionManager.cpp:29
NativeExtension & registerExtension(NativeExtension &extension)
Definition ExtensionManager.cpp:57
const NativeExtension & get(const std::string &exName) const
Definition ExtensionManager.cpp:74
bool has(const std::string &exName) const
Definition ExtensionManager.cpp:52
Handling native extensions.
Definition NativeExtension.hpp:41
Definition defs.hpp:137
l61_api_extension_t * l61_api_extension_ptr
Definition ExtensionHeaders.hpp:53
std::unordered_map< K, V > HashMap
Definition defs.hpp:78