Home | History | Annotate | Download | only in ADT
      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>
     13 HashEntry<KeyType, ValueType, KeyCompare>::HashEntry(const KeyType& pKey)
     14   : m_Key(pKey) {
     15 }
     16 
     17 template <typename KeyType, typename ValueType, typename KeyCompare>
     18 HashEntry<KeyType, ValueType, KeyCompare>::~HashEntry()
     19 {
     20 }
     21 
     22 template <typename KeyType, typename ValueType, typename KeyCompare>
     23 bool HashEntry<KeyType, ValueType, KeyCompare>::compare(const KeyType& pKey)
     24 {
     25   static KeyCompare comparator;
     26   return comparator(m_Key, pKey);
     27 }
     28 
     29 //===--------------------------------------------------------------------===//
     30 // template implementation of EntryFactory
     31 template <typename HashEntryTy>
     32 EntryFactory<HashEntryTy>::EntryFactory()
     33 {
     34 }
     35 
     36 template <typename HashEntryTy>
     37 EntryFactory<HashEntryTy>::~EntryFactory()
     38 {
     39 }
     40 
     41 template <typename HashEntryTy>
     42 void EntryFactory<HashEntryTy>::destroy(HashEntryTy* pEntry)
     43 {
     44   delete pEntry;
     45 }
     46 
     47 template <typename HashEntryTy>
     48 HashEntryTy*
     49 EntryFactory<HashEntryTy>::produce(const typename EntryFactory<HashEntryTy>::key_type& pKey)
     50 {
     51   return new HashEntryTy(pKey);
     52 }
     53 
     54