BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE > Class Template Reference

#include <bslstl_hashtableiterator.h>

Public Types

typedef NcType value_type
 
typedef DIFFERENCE_TYPE difference_type
 
typedef VALUE_TYPE * pointer
 
typedef VALUE_TYPE & reference
 
typedef bsl::forward_iterator_tag iterator_category
 Standard iterator defined types [24.4.2].
 

Public Member Functions

 HashTableIterator ()
 
 HashTableIterator (bslalg::BidirectionalLink *node)
 
 HashTableIterator (const NcIter &original)
 
 HashTableIterator (const HashTableIterator &original)=default
 
HashTableIteratoroperator++ ()
 
reference operator* () const
 
pointer operator-> () const
 
bslalg::BidirectionalLinknode () const
 

Detailed Description

template<class VALUE_TYPE, class DIFFERENCE_TYPE>
class bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >

This class template implements an in-core value-semantic type that is an standard-conforming forward iterator (see section 24.2.5 [forward.iterators] of the C++11 standard) over a list of bslalg::BidirectionalLink objects. A HashTableIterator object provides access to values of the (template parameter) VALUE_TYPE, stored in a hash table composed of bslalg::BidirectionalLink nodes. The (template parameter) DIFFERENCE_TYPE determines the standard mandated difference_type of the iterator, without requiring access to the allocator-traits for the node.

Member Typedef Documentation

◆ difference_type

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef DIFFERENCE_TYPE bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::difference_type

◆ iterator_category

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef bsl::forward_iterator_tag bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::iterator_category

◆ pointer

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef VALUE_TYPE* bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::pointer

◆ reference

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef VALUE_TYPE& bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::reference

◆ value_type

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef NcType bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::value_type

Constructor & Destructor Documentation

◆ HashTableIterator() [1/4]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableIterator ( )
inline

Create a default-constructed iterator referring to an empty list of nodes. All default-constructed iterators are non-dereferenceable and refer to the same empty list.

◆ HashTableIterator() [2/4]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableIterator ( bslalg::BidirectionalLink node)
inlineexplicit

Create an iterator referring to the specified node. The behavior is undefined unless node is of the type bslalg::BidirectionalNode<VALUE_TYPE>, which is derived from bslalg::BidirectionalLink. Note that this constructor is an implementation detail and is not part of the C++ standard.

◆ HashTableIterator() [3/4]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableIterator ( const NcIter original)
inline

Create an iterator at the same position as the specified original iterator. Note that this constructor enables converting from modifiable to const iterator types.

◆ HashTableIterator() [4/4]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableIterator ( const HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE > &  original)
default

Create an iterator having the same value as the specified original. Note that this operation is either defined by the constructor taking NcIter (if NcType is the same as VALUE_TYPE), or generated automatically by the compiler. Also note that this constructor cannot be defined explicitly (without using bsls::enableif) to avoid a duplicate declaration when NcType is the same as VALUE_TYPE.

Member Function Documentation

◆ node()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslalg::BidirectionalLink * bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::node ( ) const
inline

Return the address of the node at which this iterator is positioned in the list, or 0 if this iterator is positioned after the end of a list. Note that this method is an implementation detail and is not part of the C++ standard.

◆ operator*()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::reference bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::operator* ( ) const
inline

Return a reference providing modifiable access to the value (of the template parameter VALUE_TYPE) of the node at which this iterator is positioned. The behavior is undefined unless the iterator refers to a valid (not yet erased) node the list.

◆ operator++()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE > & bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::operator++ ( )
inline

Move this iterator to the next node in the list and return a reference providing modifiable access to this iterator. The behavior is undefined unless the iterator refers to a valid (not yet erased) node in the list.

◆ operator->()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::pointer bslstl::HashTableIterator< VALUE_TYPE, DIFFERENCE_TYPE >::operator-> ( ) const
inline

Return the address of the value (of the template parameter VALUE_TYPE) of the element at which this iterator is positioned. The behavior is undefined unless the iterator refers to a valid (not yet erased) node the list.


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