application.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Kutumov Alexey                                  *
00003  *   ru.pixel@gmail.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Thu Mar 5 22:36:42 2009 for gpucalc by  doxygen 1.5.6