• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014 Google Inc. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef FRUIT_NORMALIZED_COMPONENT_STORAGE_DEFN_H
18 #define FRUIT_NORMALIZED_COMPONENT_STORAGE_DEFN_H
19 
20 #include <fruit/impl/normalized_component_storage/normalized_component_storage.h>
21 
22 namespace fruit {
23 namespace impl {
24 
25 inline NormalizedComponentStorage::LazyComponentWithNoArgsSet
createLazyComponentWithNoArgsSet(size_t capacity,MemoryPool & memory_pool)26 NormalizedComponentStorage::createLazyComponentWithNoArgsSet(size_t capacity, MemoryPool& memory_pool) {
27   return createHashSetWithArenaAllocatorAndCustomFunctors<LazyComponentWithNoArgs>(
28       capacity, memory_pool, NormalizedComponentStorage::HashLazyComponentWithNoArgs(),
29       std::equal_to<LazyComponentWithNoArgs>());
30 }
31 
32 inline NormalizedComponentStorage::LazyComponentWithArgsSet
createLazyComponentWithArgsSet(size_t capacity,MemoryPool & memory_pool)33 NormalizedComponentStorage::createLazyComponentWithArgsSet(size_t capacity, MemoryPool& memory_pool) {
34   return createHashSetWithArenaAllocatorAndCustomFunctors<LazyComponentWithArgs>(
35       capacity, memory_pool, NormalizedComponentStorage::HashLazyComponentWithArgs(),
36       NormalizedComponentStorage::LazyComponentWithArgsEqualTo());
37 }
38 
39 inline NormalizedComponentStorage::LazyComponentWithNoArgsReplacementMap
createLazyComponentWithNoArgsReplacementMap(size_t capacity,MemoryPool & memory_pool)40 NormalizedComponentStorage::createLazyComponentWithNoArgsReplacementMap(size_t capacity, MemoryPool& memory_pool) {
41   return createHashMapWithArenaAllocatorAndCustomFunctors<LazyComponentWithNoArgs, ComponentStorageEntry>(
42       capacity, memory_pool, NormalizedComponentStorage::HashLazyComponentWithNoArgs(),
43       std::equal_to<LazyComponentWithNoArgs>());
44 }
45 
46 inline NormalizedComponentStorage::LazyComponentWithArgsReplacementMap
createLazyComponentWithArgsReplacementMap(size_t capacity,MemoryPool & memory_pool)47 NormalizedComponentStorage::createLazyComponentWithArgsReplacementMap(size_t capacity, MemoryPool& memory_pool) {
48   return createHashMapWithArenaAllocatorAndCustomFunctors<LazyComponentWithArgs, ComponentStorageEntry>(
49       capacity, memory_pool, NormalizedComponentStorage::HashLazyComponentWithArgs(),
50       NormalizedComponentStorage::LazyComponentWithArgsEqualTo());
51 }
52 
53 } // namespace impl
54 } // namespace fruit
55 
56 #endif // FRUIT_NORMALIZED_COMPONENT_STORAGE_DEFN_H
57