1 /**
2  * @file
3  * @brief Global UMP interface
4  */
5 
6 /*
7  Copyright (C) 1999-2006 Id Software, Inc. and contributors.
8  For a list of contributors, see the accompanying CONTRIBUTORS file.
9 
10  This file is part of GtkRadiant.
11 
12  GtkRadiant is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16 
17  GtkRadiant is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with GtkRadiant; if not, write to the Free Software
24  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25  */
26 
27 #ifndef IUMP_H
28 #define IUMP_H
29 
30 #include "generic/constant.h"
31 
32 #include <string>
33 #include <set>
34 
35 class IUMPSystem
36 {
37 	public:
38 		INTEGER_CONSTANT(Version, 1);
39 		STRING_CONSTANT(Name, "ump");
40 
~IUMPSystem()41 		virtual ~IUMPSystem ()
42 		{
43 		}
44 
45 		virtual void editUMPDefinition () = 0;
46 
47 		/**
48 		 * @return The ump filename for the given map
49 		 */
50 		virtual std::string getUMPFilename (const std::string& map) = 0;
51 
52 		virtual void init () = 0;
53 
54 		/**
55 		 * @return A vector with ump filesnames
56 		 */
57 		virtual const std::set<std::string> getFiles () const = 0;
58 
59 };
60 #include "modulesystem.h"
61 
62 template<typename Type>
63 class GlobalModule;
64 typedef GlobalModule<IUMPSystem> GlobalUMPSystemModule;
65 
66 // A reference to the call above.
67 template<typename Type>
68 class GlobalModuleRef;
69 typedef GlobalModuleRef<IUMPSystem> GlobalUMPSystemModuleRef;
70 
71 // This is the accessor for the ump system
GlobalUMPSystem()72 inline IUMPSystem& GlobalUMPSystem() {
73 	return GlobalUMPSystemModule::getTable();
74 }
75 
76 #endif  /* IUMP_H */
77