Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/forks/sandbox_light/src/libraries/core/Core.h @ 7908

Last change on this file since 7908 was 7908, checked in by rgrieder, 13 years ago

Stripped down trunk to form a new light sandbox.

  • Property svn:eol-style set to native
File size: 2.7 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/**
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
41#ifndef _Core_H__
42#define _Core_H__
43
44#include "CorePrereqs.h"
45
46#include <string>
47#include <boost/scoped_ptr.hpp>
48
49#include "util/Singleton.h"
50
51namespace orxonox
52{
53    /**
54    @brief
55        The Core class is a singleton used to configure the program basics.
56    @remark
57        You should only create this singleton once because it destroys the identifiers!
58    */
59    class _CoreExport Core : public Singleton<Core>
60    {
61        friend class Singleton<Core>;
62
63        public:
64            /**
65            @brief
66                Determines the executable path, checks for build directory runs, creates
67                the output directories and sets up the other core library singletons.
68            @throws
69                GeneralException
70            */
71            Core(const std::string& cmdLine);
72            ~Core();
73
74        private:
75            Core(const Core&); //!< Don't use (undefined symbol)
76
77            void initRandomNumberGenerator();
78
79            void setThreadAffinity(int limitToCPU);
80
81            // MANAGED SINGLETONS/OBJECTS
82            // Mind the order for the destruction!
83            scoped_ptr<PathConfig>        pathConfig_;
84            scoped_ptr<SignalHandler>     signalHandler_;
85
86            int                           softDebugLevelLogFile_;      //!< The debug level for the log file (belongs to OutputHandler)
87            bool                          bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
88
89            static Core*                  singletonPtr_s;
90    };
91}
92
93#endif /* _Core_H__ */
Note: See TracBrowser for help on using the repository browser.