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 98 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. | |
TObject * | Next () override |
bool | operator!= (const TIterator &other) const override |
Compare two iterator objects. | |
TObject * | operator* () const override |
Return current object or nullptr. | |
TIterator & | operator= (const TIterator &) override |
void | Reset () override |
Public Member Functions inherited from TIterator | |
virtual | ~TIterator () |
virtual Option_t * | GetOption () const |
TObject * | operator() () |
Bool_t | operator== (const TIterator &other) const |
Public Member Functions inherited from GenericRooFIter | |
virtual | ~GenericRooFIter () |
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 101 of file RooLinkedListIter.h.
|
inlineprivate |
Definition at line 166 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 119 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Return next element or nullptr if at end.
Implements GenericRooFIter.
Definition at line 123 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 134 of file RooLinkedListIter.h.
|
inlineprivate |
Definition at line 172 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 146 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 153 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 115 of file RooLinkedListIter.h.
|
inlineoverridevirtual |
Implements TIterator.
Definition at line 138 of file RooLinkedListIter.h.
|
private |
Definition at line 186 of file RooLinkedListIter.h.
|
private |
Definition at line 185 of file RooLinkedListIter.h.
|
private |
Definition at line 184 of file RooLinkedListIter.h.