CppCommon  1.0.4.1
C++ Common Library
Public Types | Public Member Functions | Friends | List of all members
CppCommon::BinTreeIterator< TContainer, T > Class Template Reference

Intrusive binary tree iterator. More...

#include <bintree.h>

Public Types

typedef T value_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef ptrdiff_t difference_type
 
typedef size_t size_type
 
typedef std::bidirectional_iterator_tag iterator_category
 

Public Member Functions

 BinTreeIterator () noexcept
 
 BinTreeIterator (TContainer *container, T *node) noexcept
 
 BinTreeIterator (const BinTreeIterator &it) noexcept=default
 
 BinTreeIterator (BinTreeIterator &&it) noexcept=default
 
 ~BinTreeIterator () noexcept=default
 
BinTreeIteratoroperator= (const BinTreeIterator &it) noexcept=default
 
BinTreeIteratoroperator= (BinTreeIterator &&it) noexcept=default
 
BinTreeIteratoroperator++ () noexcept
 
BinTreeIterator operator++ (int) noexcept
 
reference operator* () noexcept
 
pointer operator-> () noexcept
 
 operator bool () const noexcept
 Check if the iterator is valid. More...
 
bool compare (const T &item1, const T &item2) const noexcept
 Compare two items: if the first item is less than the second one? More...
 
void swap (BinTreeIterator &it) noexcept
 Swap two instances. More...
 

Friends

bool operator== (const BinTreeIterator &it1, const BinTreeIterator &it2) noexcept
 
bool operator!= (const BinTreeIterator &it1, const BinTreeIterator &it2) noexcept
 
template<class UContainer , typename U >
void swap (BinTreeIterator< UContainer, U > &it1, BinTreeIterator< UContainer, U > &it2) noexcept
 

Detailed Description

template<class TContainer, typename T>
class CppCommon::BinTreeIterator< TContainer, T >

Intrusive binary tree iterator.

Not thread-safe.

Definition at line 278 of file bintree.h.

Member Typedef Documentation

◆ const_pointer

template<class TContainer , typename T >
typedef const value_type* CppCommon::BinTreeIterator< TContainer, T >::const_pointer

Definition at line 288 of file bintree.h.

◆ const_reference

template<class TContainer , typename T >
typedef const value_type& CppCommon::BinTreeIterator< TContainer, T >::const_reference

Definition at line 286 of file bintree.h.

◆ difference_type

template<class TContainer , typename T >
typedef ptrdiff_t CppCommon::BinTreeIterator< TContainer, T >::difference_type

Definition at line 289 of file bintree.h.

◆ iterator_category

template<class TContainer , typename T >
typedef std::bidirectional_iterator_tag CppCommon::BinTreeIterator< TContainer, T >::iterator_category

Definition at line 291 of file bintree.h.

◆ pointer

template<class TContainer , typename T >
typedef value_type* CppCommon::BinTreeIterator< TContainer, T >::pointer

Definition at line 287 of file bintree.h.

◆ reference

template<class TContainer , typename T >
typedef value_type& CppCommon::BinTreeIterator< TContainer, T >::reference

Definition at line 285 of file bintree.h.

◆ size_type

template<class TContainer , typename T >
typedef size_t CppCommon::BinTreeIterator< TContainer, T >::size_type

Definition at line 290 of file bintree.h.

◆ value_type

template<class TContainer , typename T >
typedef T CppCommon::BinTreeIterator< TContainer, T >::value_type

Definition at line 284 of file bintree.h.

Constructor & Destructor Documentation

◆ BinTreeIterator() [1/4]

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::BinTreeIterator ( )
inlinenoexcept

Definition at line 293 of file bintree.h.

◆ BinTreeIterator() [2/4]

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::BinTreeIterator ( TContainer *  container,
T *  node 
)
inlineexplicitnoexcept

Definition at line 294 of file bintree.h.

◆ BinTreeIterator() [3/4]

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::BinTreeIterator ( const BinTreeIterator< TContainer, T > &  it)
defaultnoexcept

◆ BinTreeIterator() [4/4]

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::BinTreeIterator ( BinTreeIterator< TContainer, T > &&  it)
defaultnoexcept

◆ ~BinTreeIterator()

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::~BinTreeIterator ( )
defaultnoexcept

Member Function Documentation

◆ compare()

template<class TContainer , typename T >
bool CppCommon::BinTreeIterator< TContainer, T >::compare ( const T &  item1,
const T &  item2 
) const
inlinenoexcept

Compare two items: if the first item is less than the second one?

Definition at line 317 of file bintree.h.

◆ operator bool()

template<class TContainer , typename T >
CppCommon::BinTreeIterator< TContainer, T >::operator bool ( ) const
inlineexplicitnoexcept

Check if the iterator is valid.

Definition at line 314 of file bintree.h.

◆ operator*()

template<class TContainer , typename T >
BinTreeIterator< TContainer, T >::reference CppCommon::BinTreeIterator< TContainer, T >::operator*
noexcept

Definition at line 450 of file bintree.inl.

◆ operator++() [1/2]

template<class TContainer , typename T >
BinTreeIterator< TContainer, T > & CppCommon::BinTreeIterator< TContainer, T >::operator++
noexcept

Definition at line 421 of file bintree.inl.

◆ operator++() [2/2]

template<class TContainer , typename T >
BinTreeIterator< TContainer, T > CppCommon::BinTreeIterator< TContainer, T >::operator++ ( int  )
inlinenoexcept

Definition at line 442 of file bintree.inl.

◆ operator->()

template<class TContainer , typename T >
BinTreeIterator< TContainer, T >::pointer CppCommon::BinTreeIterator< TContainer, T >::operator->
noexcept

Definition at line 458 of file bintree.inl.

◆ operator=() [1/2]

template<class TContainer , typename T >
BinTreeIterator& CppCommon::BinTreeIterator< TContainer, T >::operator= ( BinTreeIterator< TContainer, T > &&  it)
defaultnoexcept

◆ operator=() [2/2]

template<class TContainer , typename T >
BinTreeIterator& CppCommon::BinTreeIterator< TContainer, T >::operator= ( const BinTreeIterator< TContainer, T > &  it)
defaultnoexcept

◆ swap()

template<class TContainer , typename T >
void CppCommon::BinTreeIterator< TContainer, T >::swap ( BinTreeIterator< TContainer, T > &  it)
noexcept

Swap two instances.

Definition at line 464 of file bintree.inl.

Friends And Related Function Documentation

◆ operator!=

template<class TContainer , typename T >
bool operator!= ( const BinTreeIterator< TContainer, T > &  it1,
const BinTreeIterator< TContainer, T > &  it2 
)
friend

Definition at line 304 of file bintree.h.

◆ operator==

template<class TContainer , typename T >
bool operator== ( const BinTreeIterator< TContainer, T > &  it1,
const BinTreeIterator< TContainer, T > &  it2 
)
friend

Definition at line 302 of file bintree.h.

◆ swap

template<class TContainer , typename T >
template<class UContainer , typename U >
void swap ( BinTreeIterator< UContainer, U > &  it1,
BinTreeIterator< UContainer, U > &  it2 
)
friend

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