ROOT 6.18/05 Reference Guide |
TIterator and GenericRooFIter front end with STL back end.
By default, this iterators counts, at which position the current element should be. On request, it does an index access to the underlying collection, and returns the element. This happens because the RooLinkedList, which used to be the default collection in RooFit, will not invalidate iterators when inserting elements. Since the default is now an STL collection, reallocations might invalidate the iterator.
With an iterator that counts, only inserting before or at the iterator position will create problems. deal with reallocations while iterating. Therefore, this iterator will also check that the last element it was pointing to is the the current element when it is invoked again. This ensures that inserting or removing before this iterator does not happen, which was possible with the linked list iterators of RooFit. When NDEBUG is defined, these checks will disappear.
Definition at line 97 of file RooLinkedListIter.h.
Public Member Functions | |
TIteratorToSTLInterface (const STLContainer &container) | |
const TCollection * | GetCollection () const override |
RooAbsArg * | next () override |
Return next element or nullptr if at end. More... | |
TObject * | Next () override |
Bool_t | operator!= (const TIterator &other) const override |
Compare two iterator objects. More... | |
TObject * | operator* () const override |
Return current object or nullptr. More... | |
TIterator & | operator= (const TIterator &) override |
void | Reset () override |
Public Member Functions inherited from TIterator | |
virtual | ~TIterator () |
virtual const TCollection * | GetCollection () const =0 |
virtual Option_t * | GetOption () const |
virtual TObject * | Next ()=0 |
virtual Bool_t | operator!= (const TIterator &) const |
Compare two iterator objects. More... | |
TObject * | operator() () |
virtual TObject * | operator* () const |
Return current object or nullptr. More... | |
virtual TIterator & | operator= (const TIterator &) |
Bool_t | operator== (const TIterator &other) const |
virtual void | Reset ()=0 |
Public Member Functions inherited from GenericRooFIter | |
virtual | ~GenericRooFIter () |
virtual RooAbsArg * | next ()=0 |
Return next element or nullptr if at end. More... | |
Private Member Functions | |
bool | atEnd () const |
RooAbsArg * | nextChecked () |
Private Attributes | |
const RooAbsArg * | fCurrentElem |
std::size_t | fIndex |
const STLContainer & | fSTLContainer |
Additional Inherited Members | |
Protected Member Functions inherited from TIterator | |
TIterator () | |
TIterator (const TIterator &) | |
#include <RooLinkedListIter.h>
|
inline |
Definition at line 100 of file RooLinkedListIter.h.
|
inlineprivate |
Definition at line 165 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 118 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Return next element or nullptr if at end.
Implements GenericRooFIter.
Definition at line 122 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 133 of file RooLinkedListIter.h.
|
inlineprivate |
Definition at line 171 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Compare two iterator objects.
For backward compatibility reasons we have to provide this default implementation.
Reimplemented from TIterator.
Definition at line 145 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Return current object or nullptr.
For backward compatibility reasons we have to provide this default implementation.
Reimplemented from TIterator.
Definition at line 152 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Reimplemented from TIterator.
Definition at line 114 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 137 of file RooLinkedListIter.h.
|
private |
Definition at line 185 of file RooLinkedListIter.h.
|
private |
Definition at line 184 of file RooLinkedListIter.h.
|
private |
Definition at line 183 of file RooLinkedListIter.h.