application.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00034 #ifndef __application__header__
00035 #define __application__header__
00036
00037 #include "gpucalc/singleton.h"
00038
00039 #include "gpucalc/input_argument_parser.h"
00040
00041 namespace gpucalc
00042 {
00043
00044
00045 const char _ApplicationClassName [] = "Application";
00046
00047
00054 class _GpuCalcExport Application: public Singleton<Application>
00055 {
00056
00057 OBJ_DISABLE_COPY(Application)
00058
00059
00060 public:
00066 Application(const InputArguments & InputArgs);
00067
00068
00075 ~Application();
00076
00077
00083 void loadLibrary(const std::string & LibraryFileName);
00084
00085
00086 void unloadLibrary(const std::string & LibraryFileName);
00087
00088
00094 void installPlugin(Plugin * plugin);
00095
00096
00100 void uninstallPlugin(Plugin * plugin);
00101
00102
00109 void addGraphicCore(GraphicCore * Core);
00110
00111
00115 GraphicCore * getDefaultGraphicCore()
00116 {
00117 assert(mDefaultGraphicCore && "Default GraphicCore does not exists!!!");
00118 return mDefaultGraphicCore;
00119 }
00120
00121
00127 GraphicCore * getCompatibleGraphicCore(const ShaderSystem * System = Application::getSingleton().getDefaultShaderSystem());
00128
00129
00136 void removeGraphicCore(GraphicCore * Core);
00137
00138
00145 void addShaderSystem(ShaderSystem * System);
00146
00147
00151 ShaderSystem * getDefaultShaderSystem()
00152 {
00153 assert(mDefaultGraphicCore && "Default ShaderSystem does not exists!!!");
00154 return mDefaultShaderSystem;
00155 }
00156
00157
00163 ShaderSystem * getCompatibleShaderSystem(const GraphicCore * Core = Application::getSingleton().getDefaultGraphicCore());
00164
00165
00172 void removeShaderSystem(ShaderSystem * System);
00173
00174
00178 void addTaskManager(TaskManager * TaskMgr);
00179
00180
00184 TaskManager * getDefaultTaskManager() const;
00185
00186
00190 TaskManager * getTaskManager(const std::string & TaskMgrName) const;
00191
00192
00196 void removeTaskManager(TaskManager * TaskMgr);
00197
00198
00204 bool supressWarnings() const
00205 {
00206 return mSupressWarnings;
00207 }
00208
00209
00213 void setWarningStatus(bool DisableWarning)
00214 {
00215 mSupressWarnings = DisableWarning;
00216 }
00217
00218
00219 const InputArguments & getInputArguments() const
00220 {
00221 return mInputArguments;
00222 }
00223
00224
00228 static Application * getSingletonPtr();
00229
00230
00234 static Application & getSingleton();
00235
00236
00237 private:
00238 LogManager * mLogManager;
00239 Timer * mTimer;
00240 Profiler * mProfiler;
00241 debugger::Debugger * mDebugger;
00242
00243
00244 GraphicCore * mDefaultGraphicCore;
00245 typedef std::list<GraphicCore *> GraphicCoreVector;
00246 GraphicCoreVector mGraphicCoreVector;
00247
00248
00249 ShaderSystem * mDefaultShaderSystem;
00250 typedef std::list<ShaderSystem *> ShaderSystemVector;
00251 ShaderSystemVector mShaderSystemVector;
00252
00253
00254 TaskManager * mDefaultTaskManager;
00255 typedef std::map<std::string, TaskManager *> TaskManagerMap;
00256 TaskManagerMap mTaskManagerMap;
00257
00258
00259 typedef std::map<std::string, Plugin *> PluginMap;
00260 PluginMap mPluginMap;
00261
00262
00263 typedef std::map<std::string, Library *>LibraryMap;
00264 LibraryMap mLibraryMap;
00265
00266
00267 bool mSupressWarnings;
00268
00269 InputArguments mInputArguments;
00270
00271
00272 void automaticUnloadLibraries();
00273 void automaticUninstallPlugins();
00274
00275 void applyInputArguments();
00276 };
00277 }
00278
00279 #endif