Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: sandbox_light/src/libraries/core/Core.h @ 6040

Last change on this file since 6040 was 6040, checked in by rgrieder, 15 years ago

Also synchronised sandbox_light with current trunk.

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
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
30#ifndef _Core_H__
31#define _Core_H__
32
33#include "CorePrereqs.h"
34
35#include <cassert>
36#include <boost/scoped_ptr.hpp>
37#include "util/OutputHandler.h"
38#include "util/ScopeGuard.h"
39#include "util/Singleton.h"
40
41namespace orxonox
42{
43    class CoreConfiguration;
44
45    /**
46    @brief
47        The Core class is a singleton used to configure the program basics.
48    @remark
49        You should only create this singleton once because it destroys the identifiers!
50    */
51    class _CoreExport Core : public Singleton<Core>
52    {
53        typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard;
54        friend class Singleton<Core>;
55
56        public:
57            /**
58            @brief
59                Determines the executable path, checks for build directory runs, creates
60                the output directories and sets up the other core library singletons.
61            @throws
62                GeneralException
63            */
64            Core(const std::string& cmdLine);
65            ~Core();
66
67            void setConfigValues();
68
69            static int   getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
70            static void  setSoftDebugLevel(OutputHandler::OutputDevice device, int level);
71
72        private:
73            Core(const Core&); //!< Don't use (undefined symbol)
74
75            void setThreadAffinity(int limitToCPU);
76
77            // Mind the order for the destruction!
78            scoped_ptr<PathConfig>        pathConfig_;
79            scoped_ptr<SignalHandler>     signalHandler_;
80            scoped_ptr<CoreConfiguration> configuration_;
81
82            static Core* singletonPtr_s;
83    };
84}
85
86#endif /* _Core_H__ */
Note: See TracBrowser for help on using the repository browser.