#ifndef ROO_LINKED_LIST_ITER
#define ROO_LINKED_LIST_ITER
#include "Rtypes.h"
#include "TIterator.h"
#include "RooAbsArg.h"
#include "RooLinkedList.h"
class RooLinkedListIter : public TIterator {
public:
  RooLinkedListIter(const RooLinkedList* list, Bool_t forward) : 
    TIterator(), _forward(forward), _list(list)
  {
    _ptr = _list->_first ;
  }
  RooLinkedListIter(const RooLinkedListIter& other) :
    TIterator(other),
    _forward(other._forward),
    _ptr(other._ptr), 
    _list(other._list)
  {
  }
  
  virtual ~RooLinkedListIter() { ; }
  
  TIterator& operator=(const TIterator& other) {
    if (&other==this) return *this ;
    const RooLinkedListIter* iter = dynamic_cast<const RooLinkedListIter*>(&other) ;
    if (iter) {
      _list = iter->_list ;
      _ptr = iter->_ptr ;
      _forward = iter->_forward ;
    }
    return *this ;
  }
    
  virtual const TCollection *GetCollection() const { 
    return 0 ; 
  }
  virtual TObject *Next() { 
    if (!_ptr) return 0 ;
    TObject* arg = _ptr->_arg ;      
      _ptr = _forward ? _ptr->_next : _ptr->_prev ;
      return arg ;
  }
  virtual void Reset() { 
    _ptr = _forward ? _list->_first : _list->_last ;
  }
protected:
  Bool_t _forward ;                
  const RooLinkedListElem* _ptr ;  
  const RooLinkedList* _list ;     
  ClassDef(RooLinkedListIter,0) 
} ;
#endif
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.