/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FRUIT_HASH_HELPERS_H #define FRUIT_HASH_HELPERS_H #include #include #if !IN_FRUIT_CPP_FILE // We don't want to include it in public headers to save some compile time. #error "hash_helpers included in non-cpp file." #endif #if FRUIT_USES_BOOST #include #include #else #include #include #endif namespace fruit { namespace impl { #if FRUIT_USES_BOOST template , typename EqualityComparator = std::equal_to> using HashSet = boost::unordered_set; template , typename EqualityComparator = std::equal_to> using HashSetWithArenaAllocator = boost::unordered_set>; template > using HashMap = boost::unordered_map; template , typename EqualityComparator = std::equal_to> using HashMapWithArenaAllocator = boost::unordered_map>>; #else template , typename EqualityComparator = std::equal_to> using HashSet = std::unordered_set; template , typename EqualityComparator = std::equal_to> using HashSetWithArenaAllocator = std::unordered_set>; template > using HashMap = std::unordered_map; template , typename EqualityComparator = std::equal_to> using HashMapWithArenaAllocator = std::unordered_map>>; #endif template HashSet createHashSet(); template HashSet createHashSet(size_t capacity); template HashSetWithArenaAllocator createHashSetWithArenaAllocator(size_t capacity, MemoryPool& memory_pool); template HashSetWithArenaAllocator createHashSetWithArenaAllocatorAndCustomFunctors(size_t capacity, MemoryPool& memory_pool, Hasher, EqualityComparator); template HashMap createHashMap(); template HashMap createHashMap(size_t capacity); template HashMapWithArenaAllocator createHashMapWithArenaAllocator(size_t capacity, MemoryPool& memory_pool); template HashMapWithArenaAllocator createHashMapWithArenaAllocatorAndCustomFunctors(size_t capacity, MemoryPool& memory_pool, Hasher, EqualityComparator); } // namespace impl } // namespace fruit #include #endif // FRUIT_HASH_HELPERS_H