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

#include <bslstl_hashtablebucketiterator.h>

Public Types

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

Public Member Functions

 HashTableBucketIterator ()
 
 HashTableBucketIterator (const bslalg::HashTableBucket *bucket)
 
 HashTableBucketIterator (bslalg::BidirectionalLink *node, const bslalg::HashTableBucket *bucket)
 
 HashTableBucketIterator (const NonConstIter &original)
 
 HashTableBucketIterator (const HashTableBucketIterator &original)=default
 
 ~HashTableBucketIterator ()=default
 
HashTableBucketIteratoroperator= (const HashTableBucketIterator &) HashTableBucketIterator &operator
 
HashTableBucketIteratoroperator++ ()
 
reference operator* () const
 
pointer operator-> () const
 
bslalg::BidirectionalLinknode () const
 
const bslalg::HashTableBucketbucket () const
 

Detailed Description

template<class VALUE_TYPE, class DIFFERENCE_TYPE>
class bslstl::HashTableBucketIterator< 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 referred to by a single bslalg::HashTableBucket object. A HashTableBucketIterator object provides access to values of the (template parameter) VALUE_TYPE, stored in a bucket of a hash table. 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::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::difference_type

◆ iterator_category

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef std::forward_iterator_tag bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::iterator_category

◆ pointer

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

◆ reference

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

◆ value_type

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
typedef NonConstType bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::value_type

Constructor & Destructor Documentation

◆ HashTableBucketIterator() [1/5]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableBucketIterator ( )
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.

◆ HashTableBucketIterator() [2/5]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableBucketIterator ( const bslalg::HashTableBucket bucket)
inlineexplicit

Create an iterator referring to the specified bucket, initially pointing to the first node in that bucket, or a past-the-end value if the bucket is empty. Note that this constructor is an implementation detail and is not part of the C++ standard.

◆ HashTableBucketIterator() [3/5]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableBucketIterator ( bslalg::BidirectionalLink node,
const bslalg::HashTableBucket bucket 
)
inlineexplicit

Create an iterator referring to the specified bucket, initially pointing to the specified node in that bucket. The behavior is undefined unless node is part of bucket, or node is 0. Note that this constructor is an implementation detail and is not part of the C++ standard.

◆ HashTableBucketIterator() [4/5]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableBucketIterator ( const NonConstIter 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.

◆ HashTableBucketIterator() [5/5]

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::HashTableBucketIterator ( const HashTableBucketIterator< 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 NonConstIter (if NonConstType 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 NonConstType is the same as VALUE_TYPE.

◆ ~HashTableBucketIterator()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::~HashTableBucketIterator ( )
default

Member Function Documentation

◆ bucket()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
const bslalg::HashTableBucket * bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::bucket ( ) const
inline

Return the address of the hash table bucket referred to by this iterator. Note that this method is an implementation detail intended for debugging purposes only, and is not part of the C++ standard.

◆ node()

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

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

◆ operator*()

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

Return a reference providing modifiable access to the element (of the template parameter VALUE_TYPE) at which this iterator is positioned. The behavior is undefined unless the iterator refers to a valid (not yet erased) element in a hash table bucket. Note that this iterator is invalidated when the underlying hash table is rehashed.

◆ operator++()

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

Move this iterator to the next element in the hash table bucket and return a reference providing modifiable access to this iterator. The behavior is undefined unless the iterator refers to a valid (not yet erased) element in a bucket. Note that this iterator is invalidated when the underlying hash table is rehashed.

◆ operator->()

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

Return the address of the element (of the template parameter VALUE_TYPE) at which this iterator is positioned. The behavior is undefined unless the iterator refers to a valid (not yet erased) element a hash table bucket. Note that this iterator is invalidated when the underlying hash table is rehashed.

◆ operator=()

template<class VALUE_TYPE , class DIFFERENCE_TYPE >
HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE > & bslstl::HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE >::operator= ( const HashTableBucketIterator< VALUE_TYPE, DIFFERENCE_TYPE > &  ) &
inline

Copy the value of the specified rhs of another (compatible) HashTableBucketIterator type, (e.g., a mutable iterator of the same type) to this iterator. Return a reference to this modifiable object. Note that this method may be the copy-assignment operator (inhibiting the implicit declaration of a copy-assignment operator above), or may be an additional overload.


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