ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator Class Reference

Bidirectional iterator over occupied table entries. More...

#include <ConcurrentHashmapImpl.h>

Collaboration diagram for CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator:

Public Member Functions

 const_iterator (const Table &table, bool end)
 Constructor. More...
 
 const_iterator (const Table &table, size_t offset)
 Constructor. More...
 
void next ()
 Advance the iterator to the next occupied entry. More...
 
void prev ()
 Move the iterator back to the previous occupied entry. More...
 
val_t key () const
 Return the key for this iterator. More...
 
val_t value () const
 Return the value for this iterator. More...
 
bool operator!= (const const_iterator &other) const
 Compare two iterators. More...
 
bool valid () const
 Check that the iterator is valid (not pointing at the end). More...
 

Private Attributes

const Tablem_table
 The table over which we're iterating. More...
 
size_t m_offset
 The current position in the table. More...
 

Detailed Description

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
class CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator

Bidirectional iterator over occupied table entries.

This is not itself a compliant STL iterator. Derived classes are meant to build a user-facing iterator on top of this.

Definition at line 425 of file ConcurrentHashmapImpl.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::const_iterator ( const Table table,
bool  end 
)

Constructor.

Parameters
tableThe table instance we're referencing.
endIf true, initialize this to an end iterator. Otherwise, initialize it to a a begin iterator.

◆ const_iterator() [2/2]

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::const_iterator ( const Table table,
size_t  offset 
)

Constructor.

Parameters
tableThe table instance we're referencing.
offsetOffset of the iterator within the table. (Must point at an occupied entry.)

Member Function Documentation

◆ key()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
val_t CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::key ( ) const

Return the key for this iterator.

If deletions are allowed, then the key may change asynchronously to the tombstone value.

◆ next()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
void CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::next ( )

Advance the iterator to the next occupied entry.

◆ operator!=()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
bool CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::operator!= ( const const_iterator other) const

Compare two iterators.

◆ prev()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
void CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::prev ( )

Move the iterator back to the previous occupied entry.

◆ valid()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
bool CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::valid ( ) const

Check that the iterator is valid (not pointing at the end).

◆ value()

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
val_t CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::value ( ) const

Return the value for this iterator.

Member Data Documentation

◆ m_offset

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
size_t CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::m_offset
private

The current position in the table.

Set to -1 for an end iterator.

Definition at line 489 of file ConcurrentHashmapImpl.h.

◆ m_table

template<template< class > class UPDATER_, typename HASHER_ = std::hash<uintptr_t>, typename MATCHER_ = std::equal_to<uintptr_t>, uintptr_t NULLVAL_ = 0, uintptr_t TOMBSTONE_ = NULLVAL_>
const Table& CxxUtils::detail::ConcurrentHashmapImpl< UPDATER_, HASHER_, MATCHER_, NULLVAL_, TOMBSTONE_ >::const_iterator::m_table
private

The table over which we're iterating.

Definition at line 486 of file ConcurrentHashmapImpl.h.


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