Orxonox  0.0.5 Codename: Arcturus
ConfigFileManager.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  * Co-authors:
25  * ...
26  *
27  */
28 
35 #ifndef _ConfigFileManager_H__
36 #define _ConfigFileManager_H__
37 
38 #include "core/CorePrereqs.h"
39 
40 #include <array>
41 
42 #include "util/Singleton.h"
43 
44 namespace orxonox
45 {
47  // ConfigFileManager //
49 
52  class _CoreExport ConfigFileManager : public Singleton<ConfigFileManager>
53  {
55  public:
58 
59  void setFilename(ConfigFileType::Value type, const std::string& filename);
60 
63  {
64  // Check array bounds
65  return configFiles_.at(type);
66  }
67 
68  private:
69  // non-copyable:
70  ConfigFileManager(const ConfigFileManager&) = delete;
71  ConfigFileManager& operator=(const ConfigFileManager&) = delete;
72 
73  std::array<ConfigFile*, 3> configFiles_;
75  };
76 }
77 
78 #endif /* _ConfigFileManager_H__ */
std::array< ConfigFile *, 3 > configFiles_
Stores the config files for each type in an array (must have the same size like ConfigFileType::Value...
Definition: ConfigFileManager.h:73
Shared library macros, enums, constants and forward declarations for the core library ...
::std::string string
Definition: gtest-port.h:756
This class represents a config file, which is stored on the hard-disk and contains config values in d...
Definition: ConfigFile.h:51
Value
Definition: CorePrereqs.h:113
Manages the different config files (settings, calibration, etc).
Definition: ConfigFileManager.h:52
Base for singleton classes.
Definition: Singleton.h:114
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _CoreExport
Definition: CorePrereqs.h:61
Definition of the Singleton template that is used as base class for classes that allow only one insta...
static ConfigFileManager * singletonPtr_s
Stores the singleton-pointer.
Definition: ConfigFileManager.h:74
ConfigFile * getConfigFile(ConfigFileType::Value type)
Returns the config file of a given type (settings, calibration, etc.)
Definition: ConfigFileManager.h:62