ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::detail::const_iterator Class Reference

Bidirectional iterator over occupied table entries. More...

#include <ConcurrentHashmapImpl.h>

Collaboration diagram for CxxUtils::detail::const_iterator:

Public Member Functions

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

Private Attributes

*The table over which we re iterating const Tablem_table
*The current position in the table *Set to for an end iterator size_t m_offset

Detailed Description

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 417 of file ConcurrentHashmapImpl.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

CxxUtils::detail::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]

CxxUtils::detail::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()

val_t CxxUtils::detail::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()

void CxxUtils::detail::const_iterator::next ( )

Advance the iterator to the next occupied entry.

◆ operator!=()

bool CxxUtils::detail::const_iterator::operator!= ( const const_iterator & other) const

Compare two iterators.

◆ prev()

void CxxUtils::detail::const_iterator::prev ( )

Move the iterator back to the previous occupied entry.

◆ valid()

bool CxxUtils::detail::const_iterator::valid ( ) const

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

◆ value()

val_t CxxUtils::detail::const_iterator::value ( ) const

Return the value for this iterator.

Member Data Documentation

◆ m_offset

* The current position in the table* Set to for an end iterator size_t CxxUtils::detail::const_iterator::m_offset
private

Definition at line 481 of file ConcurrentHashmapImpl.h.

◆ m_table

* The table over which we re iterating const Table& CxxUtils::detail::const_iterator::m_table
private

Definition at line 478 of file ConcurrentHashmapImpl.h.


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