Panda3D
|
00001 // Filename: indexRemapper.h 00002 // Created by: drose (05Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef INDEXREMAPPER_H 00016 #define INDEXREMAPPER_H 00017 00018 #include "dtoolbase.h" 00019 00020 #include <map> 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : IndexRemapper 00024 // Description : This class manages a mapping of integers to integers. 00025 // It's used in this package to resequence some or all 00026 // of the index numbers in the database to a different 00027 // sequence. 00028 // 00029 // This class is just a wrapper around STL map. The 00030 // only reason it exists is because Microsoft can't 00031 // export STL map outside of the DLL. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_DTOOLCONFIG IndexRemapper { 00034 public: 00035 IndexRemapper(); 00036 ~IndexRemapper(); 00037 00038 void clear(); 00039 void add_mapping(int from, int to); 00040 00041 bool in_map(int from) const; 00042 int map_from(int from) const; 00043 00044 private: 00045 map<int, int> _map_int; 00046 }; 00047 00048 #endif