• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- HashEntry.tcc ------------------------------------------------------===//
2 //
3 //                     The MCLinker Project
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 //===--------------------------------------------------------------------===//
11 // template implementation of HashEntry
12 template <typename KeyType, typename ValueType, typename KeyCompare>
HashEntry(const KeyType & pKey)13 HashEntry<KeyType, ValueType, KeyCompare>::HashEntry(const KeyType& pKey)
14     : m_Key(pKey) {
15 }
16 
17 template <typename KeyType, typename ValueType, typename KeyCompare>
~HashEntry()18 HashEntry<KeyType, ValueType, KeyCompare>::~HashEntry() {
19 }
20 
21 template <typename KeyType, typename ValueType, typename KeyCompare>
compare(const KeyType & pKey)22 bool HashEntry<KeyType, ValueType, KeyCompare>::compare(const KeyType& pKey) {
23   static KeyCompare comparator;
24   return comparator(m_Key, pKey);
25 }
26 
27 //===--------------------------------------------------------------------===//
28 // template implementation of EntryFactory
29 template <typename HashEntryTy>
EntryFactory()30 EntryFactory<HashEntryTy>::EntryFactory() {
31 }
32 
33 template <typename HashEntryTy>
~EntryFactory()34 EntryFactory<HashEntryTy>::~EntryFactory() {
35 }
36 
37 template <typename HashEntryTy>
destroy(HashEntryTy * pEntry)38 void EntryFactory<HashEntryTy>::destroy(HashEntryTy* pEntry) {
39   delete pEntry;
40 }
41 
42 template <typename HashEntryTy>
produce(const typename EntryFactory<HashEntryTy>::key_type & pKey)43 HashEntryTy* EntryFactory<HashEntryTy>::produce(
44     const typename EntryFactory<HashEntryTy>::key_type& pKey) {
45   return new HashEntryTy(pKey);
46 }
47