aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flmap.h
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-10-26 20:03:50 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-10-26 20:03:50 +0000
commitc752987457f50c1adf5051e1fd8167a5637f1e34 (patch)
treee78349513f1c0c7f37bd6d96935f90d9c5257e15 /externals/grill/flext/source/flmap.h
parente44cd51e389696bc871ece7d9ea08d10a683382e (diff)
""
svn path=/trunk/; revision=2169
Diffstat (limited to 'externals/grill/flext/source/flmap.h')
-rw-r--r--externals/grill/flext/source/flmap.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/externals/grill/flext/source/flmap.h b/externals/grill/flext/source/flmap.h
index c20b5ade..64d4f565 100644
--- a/externals/grill/flext/source/flmap.h
+++ b/externals/grill/flext/source/flmap.h
@@ -21,18 +21,21 @@ WARRANTIES, see the file, "license.txt," in this distribution.
@{
*/
+//! Key/Value type for AnyMap... must have size of pointer!
+typedef size_t AnyMapType;
+
//! Base class for maps
class AnyMap:
- public std::map<unsigned int,unsigned int>
+ public std::map<AnyMapType,AnyMapType>
{
- typedef std::map<unsigned int,unsigned int> Parent;
+ typedef std::map<AnyMapType,AnyMapType> Parent;
public:
AnyMap();
~AnyMap();
- iterator find(unsigned int k);
- unsigned int &operator [](unsigned int k);
+ iterator find(AnyMapType k);
+ AnyMapType &operator [](AnyMapType k);
- typedef std::pair<unsigned int,unsigned int> pair;
+ typedef std::pair<AnyMapType,AnyMapType> pair;
};
//! Specialized map class for any 32-bit key/value types
@@ -66,9 +69,9 @@ public:
inline T &data() const { return *(T *)&second; }
};
- inline iterator find(K k) { return AnyMap::find(*(unsigned int *)&k); }
- inline T &operator [](K k) { return *(T *)&(AnyMap::operator [](*(unsigned int *)&k)); }
- inline void erase(K k) { AnyMap::erase(*(unsigned int *)&k); }
+ inline iterator find(K k) { return AnyMap::find(*(AnyMapType *)&k); }
+ inline T &operator [](K k) { return *(T *)&(AnyMap::operator [](*(AnyMapType *)&k)); }
+ inline void erase(K k) { AnyMap::erase(*(AnyMapType *)&k); }
};
//! @} // FLEXT_SUPPORT