00001 00006 /* 00007 Copyright (C) 1999-2006 Id Software, Inc. and contributors. 00008 For a list of contributors, see the accompanying CONTRIBUTORS file. 00009 00010 This file is part of GtkRadiant. 00011 00012 GtkRadiant is free software; you can redistribute it and/or modify 00013 it under the terms of the GNU General Public License as published by 00014 the Free Software Foundation; either version 2 of the License, or 00015 (at your option) any later version. 00016 00017 GtkRadiant is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with GtkRadiant; if not, write to the Free Software 00024 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00025 */ 00026 00027 #ifndef IUMP_H 00028 #define IUMP_H 00029 00030 #include "modulesystem.h" 00031 #include "modulesystem/moduleregistry.h" 00032 #include "generic/constant.h" 00033 #include <string> 00034 #include <set> 00035 #include "ifilesystem.h" 00036 00037 class UMPSystem 00038 { 00039 private: 00040 00041 std::set<std::string> _umpFiles; 00042 typedef std::set<std::string>::iterator UMPFilesIterator; 00043 00044 public: 00045 INTEGER_CONSTANT(Version, 1); 00046 STRING_CONSTANT(Name, "ump"); 00047 00048 virtual ~UMPSystem () 00049 { 00050 } 00051 00055 UMPSystem (); 00056 00057 void editUMPDefinition (); 00058 00062 const std::string getUMPFilename (const std::string& map); 00063 00064 void init (); 00065 00069 const std::set<std::string> getFiles () const 00070 { 00071 return _umpFiles; 00072 } 00073 00074 }; 00075 00076 class UMPSystemDependencies: public GlobalFileSystemModuleRef 00077 { 00078 }; 00079 00080 // This is needed to be registered as a Radiant dependency 00081 template<typename Type> 00082 class GlobalModule; 00083 typedef GlobalModule<UMPSystem> GlobalUMPSystemModule; 00084 00085 // A reference to the call above. 00086 template<typename Type> 00087 class GlobalModuleRef; 00088 typedef GlobalModuleRef<UMPSystem> GlobalUMPSystemModuleRef; 00089 00090 // Accessor method 00091 inline UMPSystem * GlobalUMPSystem () 00092 { 00093 Module * umpSystem = globalModuleServer().findModule(UMPSystem::Name_CONSTANT_::evaluate(), 00094 UMPSystem::Version_CONSTANT_::evaluate(), "*"); 00095 ASSERT_MESSAGE(umpSystem, 00096 "Couldn't retrieve GlobalUMPSystem, is not registered and/or initialized."); 00097 return (UMPSystem *) umpSystem->getTable(); // findModule returns the pointer to the valid value, DO NOT DELETE! 00098 } 00099 00100 #endif /* IUMP_H */