xoreos  0.0.5
enginemanager.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_ENGINEMANAGER_H
26 #define ENGINES_ENGINEMANAGER_H
27 
28 #include <list>
29 
30 #include <boost/noncopyable.hpp>
31 
32 #include "src/common/singleton.h"
33 #include "src/common/ustring.h"
34 
35 namespace Common {
36  class SeekableReadStream;
37  class FileList;
38 }
39 
40 namespace Engines {
41 
42 class EngineProbe;
43 
44 class GameInstance : boost::noncopyable {
45 public:
46  virtual ~GameInstance();
47 
48  virtual Common::UString getGameName(bool platform) const = 0;
49 
50 protected:
51  GameInstance();
52 };
53 
55 class EngineManager : public Common::Singleton<EngineManager> {
56 public:
58  GameInstance *probeGame(const Common::UString &target,
59  const std::list<const EngineProbe *> &probes) const;
60 
62  void run(GameInstance &game) const;
63 
65  void listLanguages(GameInstance &game) const;
66 
67 private:
68  void cleanup() const;
69 };
70 
71 } // End of namespace Engines
72 
74 #define EngineMan Engines::EngineManager::instance()
75 
76 #endif // ENGINES_ENGINEMANAGER_H
Class and macro for implementing singletons.
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
virtual Common::UString getGameName(bool platform) const =0
The global engine manager.
Definition: enginemanager.h:55
Generic template base class for implementing the singleton design pattern.
Definition: singleton.h:61
void run(GameInstance &game) const
Run this game instance.
Unicode string handling.
GameInstance * probeGame(const Common::UString &target, const std::list< const EngineProbe *> &probes) const
Return a game instance capable of running the game in this directory.
void listLanguages(GameInstance &game) const
List all available languages supported by this GameInstance&#39;s target.