Storage Engine API
mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType > Class Template Reference

Forward-only iterator. More...

Detailed Description

template<class KeyType, class ValueType>
template<class MapType, class IteratorValueType, class IteratorType>
class mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >

Forward-only iterator.

Does not synchronize with the underlying collection in any way. In other words, do not modify the collection while there is an open iterator on it.

Public Member Functions

 operator bool () const
 
IteratorValueType & operator* () const
 
IteratorValueType * operator-> () const
 
bool finished () const
 Returns whether the iterator has been exhausted through calls to next. More...
 
IteratorValueType * objAddr () const
 Returns the address of the object at the current position. More...
 
const KeyType & key () const
 Returns the key of the value at the current position. More...
 
void next ()
 Advances the iterator to the next entry. More...
 
void remove ()
 Removes the element at the current position and moves the iterator to the next, which might be the last entry on the map. More...
 

Private Member Functions

 IteratorImpl (MapType &map)
 
 IteratorImpl (MapType &map, IteratorType it)
 
 IteratorImpl (MapType &map, const KeyType &key)
 

Private Attributes

MapType & _map
 
IteratorType _it
 

Friends

class FastMapNoAlloc< KeyType, ValueType >
 

Constructor & Destructor Documentation

◆ IteratorImpl() [1/3]

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::IteratorImpl ( MapType &  map)
inlineprivate

◆ IteratorImpl() [2/3]

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::IteratorImpl ( MapType &  map,
IteratorType  it 
)
inlineprivate

◆ IteratorImpl() [3/3]

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::IteratorImpl ( MapType &  map,
const KeyType &  key 
)
inlineprivate

Member Function Documentation

◆ finished()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
bool mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::finished ( ) const
inline

Returns whether the iterator has been exhausted through calls to next.

This value can be used to determine whether a previous call to find has found something.

◆ key()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
const KeyType& mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::key ( ) const
inline

Returns the key of the value at the current position.

Cannot be called with an uninitialized iterator or iterator which has reached the end.

◆ next()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
void mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::next ( )
inline

Advances the iterator to the next entry.

No particular order of iteration is guaranteed.

◆ objAddr()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
IteratorValueType* mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::objAddr ( ) const
inline

Returns the address of the object at the current position.

Cannot be called with an uninitialized iterator, or iterator which has reached the end.

◆ operator bool()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::operator bool ( ) const
inline

◆ operator*()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
IteratorValueType& mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::operator* ( ) const
inline

◆ operator->()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
IteratorValueType* mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::operator-> ( ) const
inline

◆ remove()

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
void mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::remove ( )
inline

Removes the element at the current position and moves the iterator to the next, which might be the last entry on the map.

Friends And Related Function Documentation

◆ FastMapNoAlloc< KeyType, ValueType >

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
friend class FastMapNoAlloc< KeyType, ValueType >
friend

Member Data Documentation

◆ _it

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
IteratorType mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::_it
private

◆ _map

template<class KeyType, class ValueType>
template<class MapType , class IteratorValueType , class IteratorType >
MapType& mongo::FastMapNoAlloc< KeyType, ValueType >::IteratorImpl< MapType, IteratorValueType, IteratorType >::_map
private

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