1 e76eebc6SAndrew Rist/************************************************************** 2 cdf0e10cSrcweir * 3 e76eebc6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4 e76eebc6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5 e76eebc6SAndrew Rist * distributed with this work for additional information 6 e76eebc6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7 e76eebc6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8 e76eebc6SAndrew Rist * "License"); you may not use this file except in compliance 9 e76eebc6SAndrew Rist * with the License. You may obtain a copy of the License at 10 e76eebc6SAndrew Rist * 11 e76eebc6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12 e76eebc6SAndrew Rist * 13 e76eebc6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14 e76eebc6SAndrew Rist * software distributed under the License is distributed on an 15 e76eebc6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 e76eebc6SAndrew Rist * KIND, either express or implied. See the License for the 17 e76eebc6SAndrew Rist * specific language governing permissions and limitations 18 e76eebc6SAndrew Rist * under the License. 19 e76eebc6SAndrew Rist * 20 e76eebc6SAndrew Rist *************************************************************/ 21 cdf0e10cSrcweir 22 cdf0e10cSrcweir#ifndef SYSTEM_STL_HASHMAP 23 cdf0e10cSrcweir#define SYSTEM_STL_HASHMAP 24 cdf0e10cSrcweir 25 dee715a7SHerbert Dürr#ifdef HAVE_STL_INCLUDE_PATH 26 03841fbaSAndre Fischer // TODO: use computed include file name 27 03841fbaSAndre Fischer #include_next <unordered_map> 28 a718d426SHerbert Dürr#elif defined(__cplusplus) && (__cplusplus >= 201103L) 29 03841fbaSAndre Fischer #include <unordered_map> 30 dee715a7SHerbert Dürr#elif defined(_MSC_VER) 31 03841fbaSAndre Fischer #pragma warning(push) 32 03841fbaSAndre Fischer #pragma warning(disable:4555) 33 03841fbaSAndre Fischer #include <../../VC/include/unordered_map> 34 03841fbaSAndre Fischer #pragma warning(pop) 35 03841fbaSAndre Fischer #define STLP4_EMUBASE_NS ::std::tr1 36 dee715a7SHerbert Dürr#else // fall back to boost/tr1 37 03841fbaSAndre Fischer #include <boost/tr1/tr1/unordered_map> 38 03841fbaSAndre Fischer #define STLP4_EMUBASE_NS ::boost 39 dee715a7SHerbert Dürr#endif 40 cdf0e10cSrcweir 41 cdf0e10cSrcweir 42 dee715a7SHerbert Dürr#ifndef NO_STLPORT4_EMULATION 43 cdf0e10cSrcweir 44 dee715a7SHerbert Dürrnamespace std 45 cdf0e10cSrcweir{ 46 dee715a7SHerbert Dürr#ifdef STLP4_EMUBASE_NS 47 dee715a7SHerbert Dürr using STLP4_EMUBASE_NS::hash; 48 dee715a7SHerbert Dürr using STLP4_EMUBASE_NS::unordered_map; 49 dee715a7SHerbert Dürr using STLP4_EMUBASE_NS::unordered_multimap; 50 dee715a7SHerbert Dürr #undef STLP4_EMUBASE_NS 51 dee715a7SHerbert Dürr#endif 52 cdf0e10cSrcweir 53 dee715a7SHerbert Dürr 54 dee715a7SHerbert Dürrtemplate< 55 dee715a7SHerbert Dürr typename __K, 56 dee715a7SHerbert Dürr typename __T, 57 dee715a7SHerbert Dürr typename __H = hash<__K>, 58 *ae5c9b6cSHerbert Dürr typename __E = equal_to<__K> > 59 dee715a7SHerbert Dürrclass hash_map 60 *ae5c9b6cSHerbert Dürr: public unordered_map<__K,__T,__H,__E> 61 dee715a7SHerbert Dürr{ 62 dee715a7SHerbert Dürrpublic: 63 *ae5c9b6cSHerbert Dürr typedef unordered_map<__K,__T,__H,__E> _super; 64 dee715a7SHerbert Dürr 65 dee715a7SHerbert Dürr hash_map( void) {} 66 dee715a7SHerbert Dürr hash_map( size_t n) : _super( n) {} 67 dee715a7SHerbert Dürr 68 dee715a7SHerbert Dürrprivate: 69 dee715a7SHerbert Dürr // setting the hasher dynamically is not supported in the emulation! 70 *ae5c9b6cSHerbert Dürr hash_map( size_t, const __H&, const __E& rE=__E()); // not implemented 71 dee715a7SHerbert Dürr}; 72 dee715a7SHerbert Dürr 73 dee715a7SHerbert Dürrtemplate< 74 dee715a7SHerbert Dürr typename __K, 75 dee715a7SHerbert Dürr typename __T, 76 dee715a7SHerbert Dürr typename __H = hash<__K>, 77 *ae5c9b6cSHerbert Dürr typename __E = equal_to<__K> > 78 dee715a7SHerbert Dürrclass hash_multimap 79 *ae5c9b6cSHerbert Dürr: public unordered_multimap<__K,__T,__H,__E> 80 cdf0e10cSrcweir{ 81 dee715a7SHerbert Dürrpublic: 82 *ae5c9b6cSHerbert Dürr typedef unordered_multimap<__K,__T,__H,__E> _super; 83 dee715a7SHerbert Dürr 84 dee715a7SHerbert Dürr hash_multimap( void) {} 85 dee715a7SHerbert Dürr hash_multimap( size_t n) : _super( n) {} 86 dee715a7SHerbert Dürr 87 dee715a7SHerbert Dürrprivate: 88 dee715a7SHerbert Dürr // setting the hasher dynamically is not supported in the emulation! 89 *ae5c9b6cSHerbert Dürr hash_multimap( size_t, const __H&, const __E& rE=__E()); // not implemented 90 dee715a7SHerbert Dürr}; 91 dee715a7SHerbert Dürr 92 dee715a7SHerbert Dürr} // namespace std 93 dee715a7SHerbert Dürr 94 dee715a7SHerbert Dürr#endif // NO_STLPORT4_EMULATION 95 cdf0e10cSrcweir 96 cdf0e10cSrcweir#endif 97 dee715a7SHerbert Dürr 98