00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __XVR2_HASH_MAP_H__
00015 #define __XVR2_HASH_MAP_H__
00016 #ifdef __GNUC__
00017 #include<xvr2/CoreExceptions.h>
00018 #include<xvr2/String.h>
00019 #include<xvr2/Mutex.h>
00020 #include<ext/hash_map>
00021
00022 namespace xvr2 {
00023
00026 template <class _Key,
00027 class _Tp,
00028 class _HashFcn,
00029 class _EqualKey,
00030 class _Alloc
00031 >
00032 class HashMap : public xvr2::Object ,
00033 public __gnu_cxx::hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> {
00034 private:
00035 protected:
00036 xvr2::Mutex hmm;
00037 public:
00038 HashMap():
00039 __gnu_cxx::hash_map<_Key,_Tp,_HashFcn,_EqualKey,_Alloc>() { }
00040 HashMap(size_t n):
00041 __gnu_cxx::hash_map<_Key,_Tp,_HashFcn,_EqualKey,_Alloc>(n) { }
00042 template <class _InputIterator>
00043 HashMap(_InputIterator f, _InputIterator l):
00044 __gnu_cxx::hash_map<_Key,_Tp,_HashFcn,_EqualKey,_Alloc>(f, l){ }
00045 template <class _InputIterator>
00046 HashMap(_InputIterator f, _InputIterator l, size_t n):
00047 __gnu_cxx::hash_map<_Key,_Tp,_HashFcn,_EqualKey,_Alloc>(f, l, n){ }
00048
00049 void lock(){
00050 hmm.lock();
00051 }
00052
00053 void unlock(){
00054 hmm.unlock();
00055 }
00056 };
00057 }
00058 #else
00059 #warning This system doesnt support the HashMap classes
00060 #endif
00061
00062 #endif