Ogre::MapIteratorWrapper< T, IteratorType > Class Template Reference

Prepared IteratorWrapper for key-value container. More...

`#include <OgreIteratorWrapper.h>`

Inheritance diagram for Ogre::MapIteratorWrapper< T, IteratorType >:
[legend]

## Public Types

typedef IteratorType | const_iterator
| Typedef to fulfill container interface. More...
typedef IteratorType | iterator
| Typedef to fulfill container interface. More...
typedef T::key_type | KeyType
| Type you expect to get by funktions like peekNextKey. More...
typedef T::value_type | PairType
| Unused, just to make it clear that map/set::value_type is not a ValueType. More...
typedef IteratorWrapper< T, IteratorType, typename T::mapped_type >::PointerType | PointerType
| Redefined PointerType for a map/set. More...
typedef IteratorWrapper< T, IteratorType, typename T::mapped_type >::ValueType | ValueType
| Redefined ValueType for a map/set. More...

## Public Member Functions

| MapIteratorWrapper (IteratorType start, IteratorType last)
| Constructor. More...
const IteratorType & | begin ()
| Bookmark to the begin of the underlying collection. More...
IteratorType & | current ()
| Full access to the current iterator. More...
const IteratorType & | end ()
| Bookmark to the end (one behind the last element) of the underlying collection. More...
ValueType | getNext ()
| Returns the next(=current) value element in the collection, and advances to the next. More...
bool | hasMoreElements () const
| Returns true if there are more items in the collection. More...
void | moveNext ()
| Moves the iterator on one element. More...
KeyType | peekNextKey (void) const
| Returns the next(=current) key element in the collection, without advancing to the next. More...
ValueType | peekNextValue () const
| Returns the next(=current) value element in the collection, without advancing to the next. More...
const PointerType | peekNextValuePtr () const
| Returns a pointer to the next/current value element in the collection, without advancing to the next afterwards. More...

## Protected Attributes

IteratorType | mBegin
IteratorType | mCurrent
IteratorType | mEnd

## Detailed Description

### template<typename T, typename IteratorType>
class Ogre::MapIteratorWrapper< T, IteratorType >

Prepared IteratorWrapper for key-value container.

Template Parameters

  T | Container (map - or also set )
  IteratorType | T::iterator or T::const_iterator

Have a look at MapIterator and ConstMapIterator for a concrete usage

Definition at line 253 of file OgreIteratorWrapper.h.

## Member Typedef Documentation

## const_iterator

typedef IteratorType Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::const_iterator

inherited

Typedef to fulfill container interface.

Useful if you want to use BOOST_FOREACH

Note
  there is no distinction between const_iterator and iterator.
  keep this in mind if you want to derivate from this class.

Definition at line 83 of file OgreIteratorWrapper.h.

## iterator

typedef IteratorType Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::iterator

inherited

Typedef to fulfill container interface.

Useful if you want to use BOOST_FOREACH

Note
  there is no distinction between const_iterator and iterator.
  keep this in mind if you want to derivate from this class.

Definition at line 74 of file OgreIteratorWrapper.h.

## KeyType

template<typename T, typename IteratorType>

typedef T::key_type Ogre::MapIteratorWrapper< T, IteratorType >::KeyType

Type you expect to get by funktions like peekNextKey.

Definition at line 265 of file OgreIteratorWrapper.h.

## PairType

template<typename T, typename IteratorType>

typedef T::value_type Ogre::MapIteratorWrapper< T, IteratorType >::PairType

Unused, just to make it clear that map/set::value_type is not a ValueType.

Definition at line 263 of file OgreIteratorWrapper.h.

## PointerType

template<typename T, typename IteratorType>

typedef IteratorWrapper<T, IteratorType, typename T::mapped_type>::PointerType Ogre::MapIteratorWrapper< T, IteratorType >::PointerType

Redefined PointerType for a map/set.

Definition at line 260 of file OgreIteratorWrapper.h.

## ValueType

template<typename T, typename IteratorType>

typedef IteratorWrapper<T, IteratorType, typename T::mapped_type>::ValueType Ogre::MapIteratorWrapper< T, IteratorType >::ValueType

Redefined ValueType for a map/set.

Definition at line 258 of file OgreIteratorWrapper.h.

## Constructor & Destructor Documentation

## MapIteratorWrapper()

template<typename T, typename IteratorType>

Ogre::MapIteratorWrapper< T, IteratorType >::MapIteratorWrapper | ( | IteratorType | start,
|  | IteratorType | last
| ) |  |

Constructor.

Remarks
  Provide a start and end iterator to initialise.

Definition at line 271 of file OgreIteratorWrapper.h.

## Member Function Documentation

## begin()

const IteratorType& Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::begin | ( |  | ) |

inherited

Bookmark to the begin of the underlying collection.

Definition at line 110 of file OgreIteratorWrapper.h.

References Ogre::IteratorWrapper< T, IteratorType, ValType >::mBegin.

## current()

IteratorType& Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::current | ( |  | ) |

inherited

Full access to the current iterator.

Definition at line 114 of file OgreIteratorWrapper.h.

References Ogre::IteratorWrapper< T, IteratorType, ValType >::mCurrent.

## end()

const IteratorType& Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::end | ( | void |  | ) |

inherited

Bookmark to the end (one behind the last element) of the underlying collection.

Definition at line 117 of file OgreIteratorWrapper.h.

References Ogre::IteratorWrapper< T, IteratorType, ValType >::mEnd.

## getNext()

template<typename T, typename IteratorType>

ValueType Ogre::MapIteratorWrapper< T, IteratorType >::getNext | ( |  | ) |

Returns the next(=current) value element in the collection, and advances to the next.

Definition at line 299 of file OgreIteratorWrapper.h.

Referenced by Ogre::RenderQueueGroup::merge().

## hasMoreElements()

bool Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::hasMoreElements | ( |  | ) | const

inherited

Returns true if there are more items in the collection.

Definition at line 97 of file OgreIteratorWrapper.h.

References Ogre::IteratorWrapper< T, IteratorType, ValType >::mEnd.

## moveNext()

void Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::moveNext | ( |  | ) |

inherited

Moves the iterator on one element.

Definition at line 104 of file OgreIteratorWrapper.h.

References Ogre::IteratorWrapper< T, IteratorType, ValType >::mCurrent.

## peekNextKey()

template<typename T, typename IteratorType>

KeyType Ogre::MapIteratorWrapper< T, IteratorType >::peekNextKey | ( | void |  | ) | const

Returns the next(=current) key element in the collection, without advancing to the next.

Definition at line 277 of file OgreIteratorWrapper.h.

Referenced by Ogre::RenderQueueGroup::merge().

## peekNextValue()

template<typename T, typename IteratorType>

ValueType Ogre::MapIteratorWrapper< T, IteratorType >::peekNextValue | ( |  | ) | const

Returns the next(=current) value element in the collection, without advancing to the next.

Definition at line 284 of file OgreIteratorWrapper.h.

## peekNextValuePtr()

template<typename T, typename IteratorType>

const PointerType Ogre::MapIteratorWrapper< T, IteratorType >::peekNextValuePtr | ( |  | ) | const

Returns a pointer to the next/current value element in the collection, without advancing to the next afterwards.

Definition at line 292 of file OgreIteratorWrapper.h.

## Member Data Documentation

## mBegin

IteratorType Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::mBegin

protected inherited

Definition at line 55 of file OgreIteratorWrapper.h.

## mCurrent

IteratorType Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::mCurrent

protected inherited

Definition at line 56 of file OgreIteratorWrapper.h.

## mEnd

IteratorType Ogre::IteratorWrapper< T, IteratorType, T::mapped_type >::mEnd

protected inherited

Definition at line 57 of file OgreIteratorWrapper.h.

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

- OgreIteratorWrapper.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.