Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

keywordtable.h

Go to the documentation of this file.
00001 /*
00002     Sheep - A Rigid Body Dynamics Engine
00003     Copyright (C) 2001-2004 Francois Beaune
00004     Contact: http://toxicengine.sourceforge.net/
00005 
00006     This file is part of Sheep.
00007 
00008     Sheep is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Sheep is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Sheep; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 */
00022 
00023 #ifndef SHEEP_MESHIO_KEYWORDTABLE_H
00024 #define SHEEP_MESHIO_KEYWORDTABLE_H
00025 
00026 #include "common/misc/config.h"
00027 
00028 #include <cassert>
00029 #include <map>
00030 #include <string>
00031 
00032 namespace sheep {
00033 
00034     class KeywordTable {
00035     public:
00036         void Insert(const std::string &keyword, int symbol);
00037 
00038         //! Returns -1 if the specified keyword does not exist.
00039         int GetSymbol(const std::string &keyword) const;
00040 
00041         const std::string &GetKeyword(int symbol) const;
00042 
00043         bool IsKeyword(int symbol) const;
00044 
00045     private:
00046         std::map<std::string, int> m_symbols;
00047         std::map<int, std::string> m_keywords;
00048         std::map<int, bool> m_iskeyword;
00049     };
00050 
00051 #include "keywordtable.inl"
00052 
00053 }
00054 
00055 #endif  // !SHEEP_MESHIO_KEYWORDTABLE_H

Generated on Tue May 11 01:31:50 2004 for toxic by doxygen 1.3.6