faudes::TBaseSet< T, Cmp >::Iterator Class Reference

Detailed Description

template<class T, class Cmp = std::less<T>>
class faudes::TBaseSet< T, Cmp >::Iterator

Iterator class for high-level api to TBaseSet.

This class is derived from STL iterators to additionally provide a reference of the container to iterate on. This feature is used to adjust iterators when the actual set gets reallocated due to a Detach() operation. Inheritance is private to ensure that all high-level api functions maintain iteretor refernces consistently. Currently, high-level api iterators support the operators -> ,*, =, ++, –, ==, !=.

Technical detail: the private inheritance prohibits the direct use of stl algorithms on faudes Iterators. If you need direct access to stl algorithms from outside the faudes set class, you may turn to public inheritance. Make sure to Lock the relevant sets befor applying any stl algorithms.

Definition at line 387 of file cfl_baseset.h.

#include <cfl_baseset.h>

Public Member Functions

 Iterator ()
 Default constructor, container unknown. More...
 
 Iterator (const TBaseSet< T, Cmp > *pBaseSet, const typename std::set< T, Cmp >::const_iterator &sit, bool att=false)
 Construct by members (used by TBaseSet to create temporary iterators) More...
 
 Iterator (const Iterator &fit)
 Copy constructor, copies container reference, incl attach. More...
 
 ~Iterator (void)
 Destructor. More...
 
std::string DStr (void) const
 report (debugging) More...
 
const Iteratoroperator= (const Iterator &rSrc)
 Assigment, tracks container. More...
 
void StlIterator (const typename std::set< T, Cmp >::const_iterator &sit)
 Assign STL iterator only. More...
 
const std::set< T, Cmp >::const_iteratorStlIterator (void) const
 Get STL iterator only. More...
 
void Invalidate (void)
 Invalidate. More...
 
void Detach (void)
 Detach. More...
 
void DValid (void) const
 Check validity (provoke abort error) More...
 
const T * operator-> (void) const
 Reimplement dereference. More...
 
const T & operator* (void) const
 Reimplement derefernce. More...
 
bool operator== (const Iterator &rOther) const
 Reimplement ==. More...
 
bool operator!= (const Iterator &rOther) const
 Reimplement !=. More...
 
Iterator operator++ (int step)
 Reimplement postfix ++. More...
 
const Iteratoroperator++ (void)
 Reimplement prefix ++. More...
 
Iterator operator-- (int step)
 Reimplement postfix –. More...
 
const Iteratoroperator-- (void)
 Reimplement prefix –. More...
 

Public Attributes

const TBaseSet< T, Cmp > * pBaseSet
 Order by reference for containers of Iterators <. More...
 
bool mAttached
 Indicate that this iterator is attached to some baseset. More...
 

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<class T , class Cmp = std::less<T>>
faudes::TBaseSet< T, Cmp >::Iterator::Iterator ( )
inline

Default constructor, container unknown.

Definition at line 390 of file cfl_baseset.h.

◆ Iterator() [2/3]

template<class T , class Cmp = std::less<T>>
faudes::TBaseSet< T, Cmp >::Iterator::Iterator ( const TBaseSet< T, Cmp > *  pBaseSet,
const typename std::set< T, Cmp >::const_iterator sit,
bool  att = false 
)
inline

Construct by members (used by TBaseSet to create temporary iterators)

Definition at line 397 of file cfl_baseset.h.

◆ Iterator() [3/3]

template<class T , class Cmp = std::less<T>>
faudes::TBaseSet< T, Cmp >::Iterator::Iterator ( const Iterator fit)
inline

Copy constructor, copies container reference, incl attach.

Definition at line 412 of file cfl_baseset.h.

◆ ~Iterator()

template<class T , class Cmp = std::less<T>>
faudes::TBaseSet< T, Cmp >::Iterator::~Iterator ( void  )
inline

Destructor.

Definition at line 424 of file cfl_baseset.h.

Member Function Documentation

◆ Detach()

template<class T , class Cmp = std::less<T>>
void faudes::TBaseSet< T, Cmp >::Iterator::Detach ( void  )
inline

Detach.

Definition at line 480 of file cfl_baseset.h.

◆ DStr()

template<class T , class Cmp = std::less<T>>
std::string faudes::TBaseSet< T, Cmp >::Iterator::DStr ( void  ) const
inline

report (debugging)

Definition at line 429 of file cfl_baseset.h.

◆ DValid()

template<class T , class Cmp = std::less<T>>
void faudes::TBaseSet< T, Cmp >::Iterator::DValid ( void  ) const
inline

Check validity (provoke abort error)

Definition at line 486 of file cfl_baseset.h.

◆ Invalidate()

template<class T , class Cmp = std::less<T>>
void faudes::TBaseSet< T, Cmp >::Iterator::Invalidate ( void  )
inline

Invalidate.

Definition at line 474 of file cfl_baseset.h.

◆ operator!=()

template<class T , class Cmp = std::less<T>>
bool faudes::TBaseSet< T, Cmp >::Iterator::operator!= ( const Iterator rOther) const
inline

Reimplement !=.

Definition at line 528 of file cfl_baseset.h.

◆ operator*()

template<class T , class Cmp = std::less<T>>
const T& faudes::TBaseSet< T, Cmp >::Iterator::operator* ( void  ) const
inline

Reimplement derefernce.

Definition at line 506 of file cfl_baseset.h.

◆ operator++() [1/2]

template<class T , class Cmp = std::less<T>>
Iterator faudes::TBaseSet< T, Cmp >::Iterator::operator++ ( int  step)
inline

Reimplement postfix ++.

Definition at line 539 of file cfl_baseset.h.

◆ operator++() [2/2]

template<class T , class Cmp = std::less<T>>
const Iterator& faudes::TBaseSet< T, Cmp >::Iterator::operator++ ( void  )
inline

Reimplement prefix ++.

Definition at line 552 of file cfl_baseset.h.

◆ operator--() [1/2]

template<class T , class Cmp = std::less<T>>
Iterator faudes::TBaseSet< T, Cmp >::Iterator::operator-- ( int  step)
inline

Reimplement postfix –.

Definition at line 564 of file cfl_baseset.h.

◆ operator--() [2/2]

template<class T , class Cmp = std::less<T>>
const Iterator& faudes::TBaseSet< T, Cmp >::Iterator::operator-- ( void  )
inline

Reimplement prefix –.

Definition at line 577 of file cfl_baseset.h.

◆ operator->()

template<class T , class Cmp = std::less<T>>
const T* faudes::TBaseSet< T, Cmp >::Iterator::operator-> ( void  ) const
inline

Reimplement dereference.

Definition at line 495 of file cfl_baseset.h.

◆ operator=()

template<class T , class Cmp = std::less<T>>
const Iterator& faudes::TBaseSet< T, Cmp >::Iterator::operator= ( const Iterator rSrc)
inline

Assigment, tracks container.

Definition at line 438 of file cfl_baseset.h.

◆ operator==()

template<class T , class Cmp = std::less<T>>
bool faudes::TBaseSet< T, Cmp >::Iterator::operator== ( const Iterator rOther) const
inline

Reimplement ==.

Definition at line 517 of file cfl_baseset.h.

◆ StlIterator() [1/2]

template<class T , class Cmp = std::less<T>>
void faudes::TBaseSet< T, Cmp >::Iterator::StlIterator ( const typename std::set< T, Cmp >::const_iterator sit)
inline

Assign STL iterator only.

Definition at line 464 of file cfl_baseset.h.

◆ StlIterator() [2/2]

template<class T , class Cmp = std::less<T>>
const std::set<T,Cmp>::const_iterator& faudes::TBaseSet< T, Cmp >::Iterator::StlIterator ( void  ) const
inline

Get STL iterator only.

Definition at line 469 of file cfl_baseset.h.

Member Data Documentation

◆ mAttached

template<class T , class Cmp = std::less<T>>
bool faudes::TBaseSet< T, Cmp >::Iterator::mAttached

Indicate that this iterator is attached to some baseset.

Definition at line 600 of file cfl_baseset.h.

◆ pBaseSet

template<class T , class Cmp = std::less<T>>
const TBaseSet<T,Cmp>* faudes::TBaseSet< T, Cmp >::Iterator::pBaseSet

Order by reference for containers of Iterators <.

Maintaine container reference

Definition at line 597 of file cfl_baseset.h.


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

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen