Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/engine/PluginManager.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _PLUGIN_MANAGER_H_
00004 #define _PLUGIN_MANAGER_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Singleton.h>
00008 #include <engine/Object.h>
00009 
00010 #include <string>
00011 #include <map>
00012 
00013 namespace core
00014 {
00015 class ConfigFile;
00016 }
00017 
00018 namespace engine
00019 {
00020 
00021 class Plugin;
00022 
00027 class ENGINE_PUBLIC_EXPORT PluginManager: public Object, public core::Singleton<PluginManager>
00028 {
00029 public:
00030 
00032         PluginManager();
00033 
00035         virtual ~PluginManager();
00036 
00038         void createPlugins(const std::string& pluginsfile);
00039 
00041         Plugin* createPlugin(std::string name, std::string filename = "");
00042 
00044         void loadPlugins();
00046         void unloadPlugins();
00047 
00048         bool loadPlugin(Plugin* plugin);
00049         void unloadPlugin(Plugin* plugin);
00050         bool reloadPlugin(Plugin* plugin);
00051 
00053         void removePlugin(const u32& id);
00054 
00055         void removeAllPlugins();
00056         
00057         static PluginManager* getInstance();
00058 
00059 protected:
00060 
00061         core::ConfigFile* mConfigFile;
00062 
00063         std::list<Plugin*> mLoadPlugins;
00064 
00065         std::map<u32, Plugin*> mPlugins;
00066         std::map<std::string, u32> mCreatedFilenameIDs;
00067 };
00068 
00069 } // end namespace engine
00070 
00071 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)