16 #ifndef ROO_LINKED_LIST_ELEM
17 #define ROO_LINKED_LIST_ELEM
22 class RooLinkedListElem ;
25 namespace RooLinkedListImplDetails {
30 class RooLinkedListElem {
34 _prev(0), _next(0), _arg(0), _refCount(0) {
37 void init(TObject* arg, RooLinkedListElem* after=0) {
43 _next = after->_next ;
52 if (_prev) _prev->_next = _next ;
53 if (_next) _next->_prev = _prev ;
58 RooLinkedListElem(TObject* arg) :
60 _prev(0), _next(0), _arg(arg), _refCount(1) {
63 RooLinkedListElem(TObject* arg, RooLinkedListElem* after) :
65 _prev(after), _next(after->_next), _arg(arg), _refCount(1) {
69 if (_next) _next->_prev = this ;
73 virtual ~RooLinkedListElem() {
75 if (_prev) _prev->_next = _next ;
76 if (_next) _next->_prev = _prev ;
79 Int_t refCount()
const {
return _refCount ; }
80 Int_t incRefCount() {
return ++_refCount ; }
81 Int_t decRefCount() {
return --_refCount ; }
84 friend class RooHashTable ;
85 friend class RooLinkedList ;
86 friend class RooLinkedListImplDetails::Pool;
87 friend class RooLinkedListImplDetails::Chunk;
88 friend class RooLinkedListIterImpl ;
89 friend class RooFIterForLinkedList ;
90 RooLinkedListElem* _prev ;
91 RooLinkedListElem* _next ;
98 RooLinkedListElem(
const RooLinkedListElem&) ;
100 ClassDef(RooLinkedListElem,1)