Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
PluginManager.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Core module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_PLUGINMANAGER_HPP
8 #define NAZARA_PLUGINMANAGER_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/Enums.hpp>
12 #include <Nazara/Core/String.hpp>
13 #include <set>
14 #include <unordered_map>
15 
17 namespace Nz
18 {
19  class DynLib;
20 
21  class NAZARA_CORE_API PluginManager
22  {
23  public:
24  PluginManager() = delete;
25  ~PluginManager() = delete;
26 
27  static void AddDirectory(const String& directoryPath);
28 
29  static bool Initialize();
30 
31  static bool Mount(Plugin plugin);
32  static bool Mount(const String& pluginPath, bool appendExtension = true);
33 
34  static void RemoveDirectory(const String& directoryPath);
35 
36  static void Unmount(Plugin plugin);
37  static void Unmount(const String& pluginPath);
38 
39  static void Uninitialize();
40 
41  private:
42  static std::set<String> s_directories;
43  static std::unordered_map<String, DynLib*> s_plugins;
44  static bool s_initialized;
45  };
46 }
47 
48 #endif // NAZARA_PLUGINMANAGER_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents a string.
Definition: String.hpp:22
Core class that represents a manager for plugin.
Definition: PluginManager.hpp:21