SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWHashDictionaryConstIterator Class Reference

Allows sequential access to all the elements of RWHashDictionary and, as a const iterator, does not change anything in the underlying data structure. More...

#include <rw/hashdict.h>

Inheritance diagram for RWHashDictionaryConstIterator:
RWSetConstIterator RWHashTableConstIterator RWConstIterator

Public Member Functions

 RWHashDictionaryConstIterator (const RWHashDictionary &hd)
 
 RWHashDictionaryConstIterator (const RWHashDictionaryIterator &it)
 
const RWCollectablefindNext (const RWCollectable *target)
 
const RWCollectablekey () const
 
const RWCollectableoperator() ()
 
virtual void reset ()
 
const RWCollectablevalue () const
 
- Public Member Functions inherited from RWSetConstIterator
 RWSetConstIterator (const RWSet &h)
 
 RWSetConstIterator (const RWSetIterator &it)
 
void reset ()
 
- Public Member Functions inherited from RWHashTableConstIterator
 RWHashTableConstIterator (const RWHashTable &h)
 
 RWHashTableConstIterator (const RWHashTableConstIterator &)
 
 RWHashTableConstIterator (const RWHashTableIterator &it)
 

Detailed Description

One of two iterators for class RWHashDictionary. This iterator allows sequential access to all the elements of RWHashDictionary, and, as a const iterator, does not change anything in the underlying data structure. Since RWHashDictionary is unordered, elements are not accessed in any particular order.

Like all Rogue Wave iterators, the "current item" is undefined immediately after construction – you must define it by using operator()() or some other (valid) operation.

Once the iterator has advanced beyond the end of the collection it is no longer valid – continuing to use it brings undefined results.

Synopsis
#include <rw/hashdict.h>
Persistence
None

Constructor & Destructor Documentation

RWHashDictionaryConstIterator::RWHashDictionaryConstIterator ( const RWHashDictionary hd)
inline

Constructs a const iterator for an RWHashDictionary collection. Immediately after construction, the position of the iterator is undefined.

RWHashDictionaryConstIterator::RWHashDictionaryConstIterator ( const RWHashDictionaryIterator it)
inline

Constructs a const iterator for an RWHashDictionary collection from an iterator. Immediately after construction, the position of the const iterator is undefined.

Member Function Documentation

const RWCollectable* RWHashDictionaryConstIterator::findNext ( const RWCollectable target)
virtual

Moves the iterator to the next key-value pair where the key isEqual() to the object pointed to by target. Returns the key or rwnil if no key was found.

Reimplemented from RWHashTableConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::key ( ) const
virtual

Returns the key at the current iterator position.

Reimplemented from RWHashTableConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::operator() ( )
virtual

Advances the iterator to the next key-value pair and returns the key. Returns rwnil if the cursor is at the end of the collection. Use member function value() to recover the value.

Reimplemented from RWHashTableConstIterator.

virtual void RWHashDictionaryConstIterator::reset ( )
inlinevirtual

Resets the iterator to the state it had immediately after construction.

Reimplemented from RWHashTableConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::value ( ) const

Returns the value at the current iterator position.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.