Panda3D
 All Classes Functions Variables Enumerations
indexRemapper.h
1 // Filename: indexRemapper.h
2 // Created by: drose (05Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef INDEXREMAPPER_H
16 #define INDEXREMAPPER_H
17 
18 #include "dtoolbase.h"
19 
20 #include <map>
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : IndexRemapper
24 // Description : This class manages a mapping of integers to integers.
25 // It's used in this package to resequence some or all
26 // of the index numbers in the database to a different
27 // sequence.
28 //
29 // This class is just a wrapper around STL map. The
30 // only reason it exists is because Microsoft can't
31 // export STL map outside of the DLL.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_DTOOLCONFIG IndexRemapper {
34 public:
35  IndexRemapper();
36  ~IndexRemapper();
37 
38  void clear();
39  void add_mapping(int from, int to);
40 
41  bool in_map(int from) const;
42  int map_from(int from) const;
43 
44 private:
45  map<int, int> _map_int;
46 };
47 
48 #endif
This class manages a mapping of integers to integers.
Definition: indexRemapper.h:33