Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::Reverse< T > Class Template Reference

A wrapper class to easily iterate through a container in reverse. More...

#include <ogdf/basic/Reverse.h>

Public Types

using iterator = typename std::conditional< std::is_const< T >::value, typename T::const_reverse_iterator, typename T::reverse_iterator >::type
 Provides a reverse iterator disguised a normal iterator. More...
 

Public Member Functions

 Reverse (T &container)
 Creates a reverse iteration wrapper for container. More...
 
iterator begin ()
 Returns a reverse iterator to the last element of m_container. More...
 
iterator end ()
 Returns a reverse iterator to the one-before-first element of m_container. More...
 

Private Attributes

T & m_container
 The container for which reverse iterators should be provided. More...
 

Detailed Description

template<typename T>
class ogdf::Reverse< T >

A wrapper class to easily iterate through a container in reverse.

Template Parameters
Tdenotes the container type.

Definition at line 46 of file Reverse.h.

Member Typedef Documentation

◆ iterator

template<typename T >
using ogdf::Reverse< T >::iterator = typename std::conditional<std::is_const<T>::value, typename T::const_reverse_iterator, typename T::reverse_iterator>::type

Provides a reverse iterator disguised a normal iterator.

Definition at line 57 of file Reverse.h.

Constructor & Destructor Documentation

◆ Reverse()

template<typename T >
ogdf::Reverse< T >::Reverse ( T &  container)
inlineexplicit

Creates a reverse iteration wrapper for container.

Definition at line 52 of file Reverse.h.

Member Function Documentation

◆ begin()

template<typename T >
iterator ogdf::Reverse< T >::begin ( )
inline

Returns a reverse iterator to the last element of m_container.

Definition at line 60 of file Reverse.h.

◆ end()

template<typename T >
iterator ogdf::Reverse< T >::end ( )
inline

Returns a reverse iterator to the one-before-first element of m_container.

Definition at line 63 of file Reverse.h.

Member Data Documentation

◆ m_container

template<typename T >
T& ogdf::Reverse< T >::m_container
private

The container for which reverse iterators should be provided.

Definition at line 48 of file Reverse.h.


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