Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/libraries/core/Core.h @ 7401

Last change on this file since 7401 was 7401, checked in by landauf, 14 years ago

merged doc branch back to trunk

  • Property svn:eol-style set to native
File size: 4.4 KB
RevLine 
[1505]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
[2896]24 *      Reto Grieder
[1505]25 *   Co-authors:
[2896]26 *      ...
[1505]27 *
28 */
29
[7401]30/**
31    @defgroup CoreGame Core and Game
32    @ingroup Management
33*/
34
35/**
36    @file
37    @ingroup Management CoreGame
38    @brief Declaration of the Core singleton which is used to configure the program basics.
39*/
40
[1531]41#ifndef _Core_H__
42#define _Core_H__
[1505]43
44#include "CorePrereqs.h"
45
[6417]46#include <string>
[3370]47#include <boost/scoped_ptr.hpp>
[7266]48#include <loki/ScopeGuard.h>
49
[3370]50#include "util/Singleton.h"
[6746]51#include "OrxonoxClass.h"
[1505]52
53namespace orxonox
54{
[3196]55    /**
56    @brief
57        The Core class is a singleton used to configure the program basics.
[3370]58    @remark
59        You should only create this singleton once because it destroys the identifiers!
[3196]60    */
[6417]61    class _CoreExport Core : public Singleton<Core>, public OrxonoxClass
[1505]62    {
[3370]63        typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard;
64        friend class Singleton<Core>;
[5695]65        friend class Game;
[3370]66
[1505]67        public:
[3196]68            /**
69            @brief
70                Determines the executable path, checks for build directory runs, creates
71                the output directories and sets up the other core library singletons.
72            @throws
73                GeneralException
74            */
[3323]75            Core(const std::string& cmdLine);
[2662]76            ~Core();
[2896]77
[1505]78            void setConfigValues();
79
[6417]80            //! Returns the configured language.
81            const std::string& getLanguage()
82                { return this->language_; }
83            void resetLanguage();
[1505]84
85        private:
[3196]86            Core(const Core&); //!< Don't use (undefined symbol)
[2896]87
[6417]88            void languageChanged();
89            void initRandomNumberGenerator();
90
[5695]91            void preUpdate(const Clock& time);
92            void postUpdate(const Clock& time);
93
[5781]94            void loadGraphics();
95            void unloadGraphics();
96
[2896]97            void setThreadAffinity(int limitToCPU);
[6417]98            // MANAGED SINGLETONS/OBJECTS
[3370]99            // Mind the order for the destruction!
[5929]100            scoped_ptr<PathConfig>        pathConfig_;
[5693]101            scoped_ptr<DynLibManager>     dynLibManager_;
[3370]102            scoped_ptr<SignalHandler>     signalHandler_;
103            SimpleScopeGuard              identifierDestroyer_;
[5781]104            SimpleScopeGuard              consoleCommandDestroyer_;
[3370]105            scoped_ptr<ConfigFileManager> configFileManager_;
106            scoped_ptr<Language>          languageInstance_;
[6105]107            scoped_ptr<IOConsole>         ioConsole_;
[5781]108            scoped_ptr<TclBind>           tclBind_;
109            scoped_ptr<TclThreadManager>  tclThreadManager_;
[6746]110            scoped_ptr<Scope<ScopeID::Root> > rootScope_;
[5781]111            // graphical
112            scoped_ptr<GraphicsManager>   graphicsManager_;     //!< Interface to OGRE
113            scoped_ptr<InputManager>      inputManager_;        //!< Interface to OIS
114            scoped_ptr<GUIManager>        guiManager_;          //!< Interface to GUI
[5929]115            scoped_ptr<Scope<ScopeID::Graphics> > graphicsScope_;
[2710]116
[5781]117            bool                          bGraphicsLoaded_;
[6417]118            int                           softDebugLevelLogFile_;      //!< The debug level for the log file (belongs to OutputHandler)
119            std::string                   language_;                   //!< The language
120            bool                          bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
[6746]121            bool                          bStartIOConsole_;            //!< Set to false if you don't want to use the IOConsole
[6417]122
123            static Core*                  singletonPtr_s;
[1505]124    };
125}
126
[1531]127#endif /* _Core_H__ */
Note: See TracBrowser for help on using the repository browser.