Orxonox  0.0.5 Codename: Arcturus
Core.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Fabian 'x3n' Landau
24  * Reto Grieder
25  * Co-authors:
26  * ...
27  *
28  */
29 
41 #ifndef _Core_H__
42 #define _Core_H__
43 
44 #include "CorePrereqs.h"
45 
46 #include <string>
47 #include <list>
48 #include "util/DestructionHelper.h"
49 #include "util/Singleton.h"
50 #include "CoreConfig.h"
51 
52 namespace orxonox
53 {
60  class _CoreExport Core : public Singleton<Core>
61  {
62  friend class Singleton<Core>;
63 
64  public:
72  Core(const std::string& cmdLine);
73 
75  ~Core() = default;
77  void destroy();
78 
79  void preUpdate(const Clock& time);
80  void postUpdate(const Clock& time);
81 
82  void loadGraphics();
83  void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true);
84 
85  void loadModules();
86  void unloadModules();
87  void loadModule(ModuleInstance* module);
88  void unloadModule(ModuleInstance* module);
89 
90  inline CoreConfig* getConfig() const
91  { return this->config_; }
92 
93  private:
94  // non-copyable:
95  Core(const Core&) = delete;
96  Core& operator=(const Core&) = delete;
97 
98  void setThreadAffinity(int limitToCPU);
99 
111  // graphical
117 
121  std::list<ModuleInstance*> modules_;
122 
125 
128 
130  };
131 }
132 
133 #endif /* _Core_H__ */
std::list< ModuleInstance * > modules_
Definition: Core.h:121
CoreStaticInitializationHandler * staticInitHandler_
Definition: Core.h:118
Provides a simple interface to CEGUI with tolua methods and console commands.
Definition: GUIManager.h:91
bool bGraphicsLoaded_
Definition: Core.h:116
ModuleInstance * rootModule_
Definition: Core.h:120
The ApplicationPaths class is a singleton which provides static paths of the application.
Definition: ApplicationPaths.h:57
ConfigFileManager * configFileManager_
Definition: Core.h:104
DynLibManager * dynLibManager_
Definition: Core.h:102
IOConsole * ioConsole_
Definition: Core.h:107
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
Definition: Loader.h:52
static Core * singletonPtr_s
Static pointer to the singleton.
Definition: Core.h:129
The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile...
Definition: SignalHandler.h:73
The Language class manges the language files and entries and stores the LanguageEntry objects in a ma...
Definition: Language.h:160
The MetaPickup destroys all the PickupCarriers&#39; Pickupables.
Definition: ModuleInstance.h:42
Manages the different config files (settings, calibration, etc).
Definition: ConfigFileManager.h:52
Scope< ScopeID::GRAPHICS > * graphicsScope_
Definition: Core.h:115
Definition: CoreConfig.h:38
GraphicsManager * graphicsManager_
Interface to OGRE.
Definition: Core.h:112
TclThreadManager * tclThreadManager_
Definition: Core.h:109
The Core class is a singleton used to configure the program basics.
Definition: Core.h:60
InputManager * inputManager_
Interface to OIS.
Definition: Core.h:113
Base for singleton classes.
Definition: Singleton.h:114
A wrapper class for a Tcl interpreter.
Definition: TclBind.h:98
Graphics engine manager class.
Definition: GraphicsManager.h:65
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Definition: CoreStaticInitializationHandler.h:38
#define _CoreExport
Definition: CorePrereqs.h:61
Utility class that helps to create a special kind of destructor that also executes if the destruction...
Definition: DestructionHelper.h:75
ApplicationPaths * applicationPaths_
Definition: Core.h:100
GUIManager * guiManager_
Interface to GUI.
Definition: Core.h:114
Definition: PluginManager.h:41
ConfigurablePaths * configurablePaths_
Definition: Core.h:101
The ConfigurablePaths class is a singleton used to configure different paths.
Definition: ConfigurablePaths.h:55
Definition of the Singleton template that is used as base class for classes that allow only one insta...
Loader * loaderInstance_
Definition: Core.h:106
PluginManager * pluginManager_
Definition: Core.h:119
CoreConfig * getConfig() const
Definition: Core.h:90
Simple real time clock based on Ogre::Timer.
Definition: Clock.h:57
SignalHandler * signalHandler_
Definition: Core.h:103
Definition: TclThreadManager.h:51
Scope< ScopeID::ROOT > * rootScope_
Definition: Core.h:110
TclBind * tclBind_
Definition: Core.h:108
Definition: IOConsolePOSIX.h:50
CoreConfig * config_
Helper object that stores the config values.
Definition: Core.h:124
Manages the input devices (mouse, keyboard, joy sticks) and the input states.
Definition: InputManager.h:66
DestructionHelper< Core > destructionHelper_
Helper object that executes the surrogate destructor destroy()
Definition: Core.h:127
Language * languageInstance_
Definition: Core.h:105
Manager for Dynamic-loading Libraries.
Definition: DynLibManager.h:55