LLVM 22.0.0git
llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator Class Reference

#include "llvm/ADT/IntervalMap.h"

Public Types

using iterator_category = std::bidirectional_iterator_tag
using value_type = ValT
using difference_type = std::ptrdiff_t
using pointer = value_type *
using reference = value_type &

Public Member Functions

 const_iterator ()=default
 const_iterator - Create an iterator that isn't pointing anywhere.
void setMap (const IntervalMap &m)
 setMap - Change the map iterated over.
bool valid () const
 valid - Return true if the current position is valid, false for end().
bool atBegin () const
 atBegin - Return true if the current position is the first map entry.
const KeyTstart () const
 start - Return the beginning of the current interval.
const KeyTstop () const
 stop - Return the end of the current interval.
const ValTvalue () const
 value - Return the mapped value at the current interval.
const ValToperator* () const
bool operator== (const const_iterator &RHS) const
bool operator!= (const const_iterator &RHS) const
void goToBegin ()
 goToBegin - Move to the first interval in map.
void goToEnd ()
 goToEnd - Move beyond the last interval in map.
const_iteratoroperator++ ()
 preincrement - Move to the next interval.
const_iterator operator++ (int)
 postincrement - Don't do that!
const_iteratoroperator-- ()
 predecrement - Move to the previous interval.
const_iterator operator-- (int)
 postdecrement - Don't do that!
void find (KeyT x)
 find - Move to the first interval with stop >= x, or end().
void advanceTo (KeyT x)
 advanceTo - Move to the first interval with stop >= x, or end().

Protected Member Functions

 const_iterator (const IntervalMap &map)
bool branched () const
void setRoot (unsigned Offset)
void pathFillFind (KeyT x)
 pathFillFind - Complete path by searching for x.
void treeFind (KeyT x)
 treeFind - Find in a branched tree.
void treeAdvanceTo (KeyT x)
 treeAdvanceTo - Find position after the current one.
KeyTunsafeStart () const
 unsafeStart - Writable access to start() for iterator.
KeyTunsafeStop () const
 unsafeStop - Writable access to stop() for iterator.
ValTunsafeValue () const
 unsafeValue - Writable access to value() for iterator.

Protected Attributes

IntervalMapmap = nullptr
IntervalMapImpl::Path path

Friends

class IntervalMap

Detailed Description

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
class llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator

Definition at line 1344 of file IntervalMap.h.

Member Typedef Documentation

◆ difference_type

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
using llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::difference_type = std::ptrdiff_t

Definition at line 1350 of file IntervalMap.h.

◆ iterator_category

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
using llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::iterator_category = std::bidirectional_iterator_tag

Definition at line 1348 of file IntervalMap.h.

◆ pointer

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
using llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::pointer = value_type *

Definition at line 1351 of file IntervalMap.h.

◆ reference

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
using llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::reference = value_type &

Definition at line 1352 of file IntervalMap.h.

◆ value_type

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
using llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::value_type = ValT

Definition at line 1349 of file IntervalMap.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::const_iterator ( const IntervalMap & map)
inlineexplicitprotected

Definition at line 1362 of file IntervalMap.h.

References IntervalMap, and map.

Referenced by operator!=(), operator++(), operator++(), operator--(), operator--(), and operator==().

◆ const_iterator() [2/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::const_iterator ( )
default

const_iterator - Create an iterator that isn't pointing anywhere.

Member Function Documentation

◆ advanceTo()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::advanceTo ( KeyT x)
inline

advanceTo - Move to the first interval with stop >= x, or end().

The search is started from the current position, and no earlier positions can be found. This is much faster than find() for small moves.

Definition at line 1495 of file IntervalMap.h.

References branched(), map, path, treeAdvanceTo(), and valid().

◆ atBegin()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
bool llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::atBegin ( ) const
inline

atBegin - Return true if the current position is the first map entry.

Definition at line 1414 of file IntervalMap.h.

References path.

◆ branched()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
bool llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::branched ( ) const
inlineprotected

Definition at line 1365 of file IntervalMap.h.

References assert(), and map.

Referenced by advanceTo(), find(), goToBegin(), operator++(), operator--(), setRoot(), unsafeStart(), unsafeStop(), and unsafeValue().

◆ find()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::find ( KeyT x)
inline

find - Move to the first interval with stop >= x, or end().

This is a full search from the root, the current position is ignored.

Definition at line 1485 of file IntervalMap.h.

References branched(), map, setRoot(), and treeFind().

◆ goToBegin()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::goToBegin ( )
inline

goToBegin - Move to the first interval in map.

Definition at line 1441 of file IntervalMap.h.

References branched(), map, path, and setRoot().

◆ goToEnd()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::goToEnd ( )
inline

goToEnd - Move beyond the last interval in map.

Definition at line 1448 of file IntervalMap.h.

References map, and setRoot().

◆ operator!=()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
bool llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator!= ( const const_iterator & RHS) const
inline

Definition at line 1436 of file IntervalMap.h.

References const_iterator(), operator==(), and RHS.

◆ operator*()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const ValT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator* ( ) const
inline

Definition at line 1425 of file IntervalMap.h.

References value().

◆ operator++() [1/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const_iterator & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator++ ( )
inline

preincrement - Move to the next interval.

Definition at line 1453 of file IntervalMap.h.

References assert(), branched(), const_iterator(), map, path, and valid().

Referenced by operator++(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::operator++().

◆ operator++() [2/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const_iterator llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator++ ( int )
inline

postincrement - Don't do that!

Definition at line 1461 of file IntervalMap.h.

References const_iterator(), and operator++().

◆ operator--() [1/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const_iterator & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator-- ( )
inline

predecrement - Move to the previous interval.

Definition at line 1468 of file IntervalMap.h.

References branched(), const_iterator(), map, path, and valid().

Referenced by operator--(), and llvm::IntervalMap< KeyT, ValT, N, Traits >::iterator::operator--().

◆ operator--() [2/2]

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const_iterator llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator-- ( int )
inline

postdecrement - Don't do that!

Definition at line 1477 of file IntervalMap.h.

References const_iterator(), and operator--().

◆ operator==()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
bool llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::operator== ( const const_iterator & RHS) const
inline

◆ pathFillFind()

template<typename KeyT, typename ValT, unsigned N, typename Traits>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::pathFillFind ( KeyT x)
protected

pathFillFind - Complete path by searching for x.

Parameters
xKey to search for.

Definition at line 1509 of file IntervalMap.h.

References llvm::IntervalMapImpl::NodeRef::get(), map, path, and llvm::IntervalMapImpl::NodeRef::subtree().

Referenced by treeAdvanceTo(), and treeFind().

◆ setMap()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::setMap ( const IntervalMap & m)
inline

setMap - Change the map iterated over.

This call must be followed by a call to goToBegin(), goToEnd(), or find()

Definition at line 1408 of file IntervalMap.h.

References IntervalMap, and map.

◆ setRoot()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::setRoot ( unsigned Offset)
inlineprotected

Definition at line 1370 of file IntervalMap.h.

References branched(), map, llvm::Offset, and path.

Referenced by find(), goToBegin(), goToEnd(), treeAdvanceTo(), and treeFind().

◆ start()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const KeyT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::start ( ) const
inline

start - Return the beginning of the current interval.

Definition at line 1417 of file IntervalMap.h.

References unsafeStart().

Referenced by unsafeStart().

◆ stop()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const KeyT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::stop ( ) const
inline

stop - Return the end of the current interval.

Definition at line 1420 of file IntervalMap.h.

References unsafeStop().

Referenced by unsafeStop().

◆ treeAdvanceTo()

template<typename KeyT, typename ValT, unsigned N, typename Traits>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::treeAdvanceTo ( KeyT x)
protected

treeAdvanceTo - Find position after the current one.

Parameters
xKey to search for.

Definition at line 1533 of file IntervalMap.h.

References map, path, pathFillFind(), setRoot(), and valid().

Referenced by advanceTo().

◆ treeFind()

template<typename KeyT, typename ValT, unsigned N, typename Traits>
void llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::treeFind ( KeyT x)
protected

treeFind - Find in a branched tree.

Parameters
xKey to search for.

Definition at line 1523 of file IntervalMap.h.

References map, pathFillFind(), setRoot(), and valid().

Referenced by find().

◆ unsafeStart()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
KeyT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::unsafeStart ( ) const
inlineprotected

unsafeStart - Writable access to start() for iterator.

Definition at line 1382 of file IntervalMap.h.

References assert(), branched(), path, start(), and valid().

Referenced by start().

◆ unsafeStop()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
KeyT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::unsafeStop ( ) const
inlineprotected

unsafeStop - Writable access to stop() for iterator.

Definition at line 1389 of file IntervalMap.h.

References assert(), branched(), path, stop(), and valid().

Referenced by stop().

◆ unsafeValue()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
ValT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::unsafeValue ( ) const
inlineprotected

unsafeValue - Writable access to value() for iterator.

Definition at line 1396 of file IntervalMap.h.

References assert(), branched(), path, valid(), and value().

Referenced by value().

◆ valid()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
bool llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::valid ( ) const
inline

valid - Return true if the current position is valid, false for end().

Definition at line 1411 of file IntervalMap.h.

References path.

Referenced by advanceTo(), operator++(), operator--(), operator==(), treeAdvanceTo(), treeFind(), unsafeStart(), unsafeStop(), and unsafeValue().

◆ value()

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
const ValT & llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::value ( ) const
inline

value - Return the mapped value at the current interval.

Definition at line 1423 of file IntervalMap.h.

References unsafeValue().

Referenced by operator*(), and unsafeValue().

◆ IntervalMap

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
friend class IntervalMap
friend

Definition at line 1345 of file IntervalMap.h.

References IntervalMap.

Referenced by const_iterator(), IntervalMap, and setMap().

Member Data Documentation

◆ map

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
IntervalMap* llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::map = nullptr
protected

◆ path

template<typename KeyT, typename ValT, unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize, typename Traits = IntervalMapInfo<KeyT>>
IntervalMapImpl::Path llvm::IntervalMap< KeyT, ValT, N, Traits >::const_iterator::path
protected

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