Jlm
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual > Class Template Reference

#include <intrusive-hash.hpp>

Collaboration diagram for jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >:
Collaboration graph
[legend]

Classes

struct  BucketType
 
class  ConstIterator
 
class  Iterator
 

Public Types

typedef ElementType value_type
 
typedef ElementType mapped_type
 
typedef KeyType key_type
 
typedef size_t size_type
 

Public Member Functions

constexpr IntrusiveHash () noexcept
 
 IntrusiveHash (const IntrusiveHash &other)=delete
 
void operator= (const IntrusiveHash &other)=delete
 
 IntrusiveHash (IntrusiveHash &&other) noexcept
 
void swap (IntrusiveHash &other) noexcept
 
void clear () noexcept
 
Iterator insert (ElementType *element)
 
void erase (ElementType *element) noexcept
 
void erase (Iterator i) noexcept
 
void erase (const KeyType &key) noexcept
 
void erase (Iterator begin, Iterator end) noexcept
 
size_type size () const noexcept
 
bool empty () const noexcept
 
Iterator begin () noexcept
 
Iterator end () noexcept
 
ConstIterator cbegin () const noexcept
 
ConstIterator cend () const noexcept
 
ConstIterator begin () const noexcept
 
ConstIterator end () const noexcept
 
Iterator find (const KeyType &key) noexcept
 
ConstIterator find (const KeyType &key) const noexcept
 

Private Member Functions

ElementType * first_object () const noexcept
 
void private_insert_into (std::vector< BucketType > &bucket_types, size_t mask, ElementType *element) noexcept
 
void rehash ()
 
ElementType * lookup (const KeyType &key) const noexcept
 

Private Attributes

size_t size_
 
size_t mask_
 
std::vector< BucketTypebuckets_
 
Accessor accessor_
 
KeyHash hash_
 
KeyEqual equal_
 

Detailed Description

template<typename KeyType, typename ElementType, typename Accessor, typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
class jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >

Definition at line 129 of file intrusive-hash.hpp.

Member Typedef Documentation

◆ key_type

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
typedef KeyType jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::key_type

Definition at line 327 of file intrusive-hash.hpp.

◆ mapped_type

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
typedef ElementType jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::mapped_type

Definition at line 326 of file intrusive-hash.hpp.

◆ size_type

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
typedef size_t jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::size_type

Definition at line 328 of file intrusive-hash.hpp.

◆ value_type

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
typedef ElementType jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::value_type

Definition at line 325 of file intrusive-hash.hpp.

Constructor & Destructor Documentation

◆ IntrusiveHash() [1/3]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
constexpr jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::IntrusiveHash ( )
inlineconstexprnoexcept

Definition at line 330 of file intrusive-hash.hpp.

◆ IntrusiveHash() [2/3]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::IntrusiveHash ( const IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual > &  other)
delete

◆ IntrusiveHash() [3/3]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::IntrusiveHash ( IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual > &&  other)
inlinenoexcept

Definition at line 340 of file intrusive-hash.hpp.

Member Function Documentation

◆ begin() [1/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ConstIterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::begin ( ) const
inlinenoexcept

Definition at line 468 of file intrusive-hash.hpp.

◆ begin() [2/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
Iterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::begin ( )
inlinenoexcept

Definition at line 444 of file intrusive-hash.hpp.

◆ cbegin()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ConstIterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::cbegin ( ) const
inlinenoexcept

Definition at line 456 of file intrusive-hash.hpp.

◆ cend()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ConstIterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::cend ( ) const
inlinenoexcept

Definition at line 462 of file intrusive-hash.hpp.

◆ clear()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::clear ( )
inlinenoexcept

Definition at line 355 of file intrusive-hash.hpp.

◆ empty()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
bool jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::empty ( ) const
inlinenoexcept

Definition at line 438 of file intrusive-hash.hpp.

◆ end() [1/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ConstIterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::end ( ) const
inlinenoexcept

Definition at line 474 of file intrusive-hash.hpp.

◆ end() [2/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
Iterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::end ( )
inlinenoexcept

Definition at line 450 of file intrusive-hash.hpp.

◆ erase() [1/4]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::erase ( const KeyType &  key)
inlinenoexcept

Definition at line 411 of file intrusive-hash.hpp.

◆ erase() [2/4]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::erase ( ElementType *  element)
inlinenoexcept

Definition at line 379 of file intrusive-hash.hpp.

◆ erase() [3/4]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::erase ( Iterator  begin,
Iterator  end 
)
inlinenoexcept

Definition at line 421 of file intrusive-hash.hpp.

◆ erase() [4/4]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::erase ( Iterator  i)
inlinenoexcept

Definition at line 405 of file intrusive-hash.hpp.

◆ find() [1/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ConstIterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::find ( const KeyType &  key) const
inlinenoexcept

Definition at line 486 of file intrusive-hash.hpp.

◆ find() [2/2]

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
Iterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::find ( const KeyType &  key)
inlinenoexcept

Definition at line 480 of file intrusive-hash.hpp.

◆ first_object()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ElementType* jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::first_object ( ) const
inlineprivatenoexcept

Definition at line 493 of file intrusive-hash.hpp.

◆ insert()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
Iterator jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::insert ( ElementType *  element)
inline

Definition at line 366 of file intrusive-hash.hpp.

◆ lookup()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
ElementType* jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::lookup ( const KeyType &  key) const
inlineprivatenoexcept

Definition at line 553 of file intrusive-hash.hpp.

◆ operator=()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::operator= ( const IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual > &  other)
delete

◆ private_insert_into()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::private_insert_into ( std::vector< BucketType > &  bucket_types,
size_t  mask,
ElementType *  element 
)
inlineprivatenoexcept

Definition at line 510 of file intrusive-hash.hpp.

◆ rehash()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::rehash ( )
inlineprivate

Definition at line 530 of file intrusive-hash.hpp.

◆ size()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
size_type jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::size ( ) const
inlinenoexcept

Definition at line 432 of file intrusive-hash.hpp.

◆ swap()

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
void jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::swap ( IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual > &  other)
inlinenoexcept

Definition at line 347 of file intrusive-hash.hpp.

Member Data Documentation

◆ accessor_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
Accessor jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::accessor_
private

Definition at line 570 of file intrusive-hash.hpp.

◆ buckets_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
std::vector<BucketType> jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::buckets_
private

Definition at line 507 of file intrusive-hash.hpp.

◆ equal_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
KeyEqual jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::equal_
private

Definition at line 572 of file intrusive-hash.hpp.

◆ hash_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
KeyHash jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::hash_
private

Definition at line 571 of file intrusive-hash.hpp.

◆ mask_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
size_t jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::mask_
private

Definition at line 506 of file intrusive-hash.hpp.

◆ size_

template<typename KeyType , typename ElementType , typename Accessor , typename KeyHash = std::hash<KeyType>, typename KeyEqual = SafeEqual<KeyType>>
size_t jlm::util::IntrusiveHash< KeyType, ElementType, Accessor, KeyHash, KeyEqual >::size_
private

Definition at line 505 of file intrusive-hash.hpp.


The documentation for this class was generated from the following file: