HashMap.h

Go to the documentation of this file.
00001 /*
00002  * $Id: HashMap.h 562 2007-12-02 08:04:16Z mindstorm2600 $
00003  *
00004  * X-VR2 
00005  * 
00006  * Copyright (C) Juan V. Guerrero 2007
00007  * 
00008  * Juan V. Guerrero <mindstorm2600@users.sourceforge.net>
00009  * 
00010  * This program is free software, distributed under the terms of
00011  * the GNU General Public License Version 2. See the LICENSE file
00012  * at the top of the source tree.
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

Generated on Fri Jun 20 22:55:47 2008 for X-VR2 SDK by  doxygen 1.5.5