Warning, file /include/root/RooLinkedListElem.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_LINKED_LIST_ELEM
0017 #define ROO_LINKED_LIST_ELEM
0018
0019 #include "Rtypes.h"
0020
0021 class TObject ;
0022 class RooLinkedListElem ;
0023 class TBuffer ;
0024
0025
0026
0027 namespace RooLinkedListImplDetails {
0028 class Chunk;
0029 class Pool;
0030 }
0031
0032
0033
0034 class RooLinkedListElem {
0035 public:
0036
0037 RooLinkedListElem() = default;
0038
0039 void init(TObject* arg, RooLinkedListElem* after=nullptr) {
0040 _arg = arg ;
0041 _refCount = 1 ;
0042
0043 if (after) {
0044 _prev = after ;
0045 _next = after->_next ;
0046 after->_next = this ;
0047 if (_next) {
0048 _next->_prev = this ;
0049 }
0050 }
0051 }
0052
0053 void release() {
0054 if (_prev) _prev->_next = _next ;
0055 if (_next) _next->_prev = _prev ;
0056 _prev = nullptr ;
0057 _next = nullptr ;
0058 }
0059
0060
0061 RooLinkedListElem(TObject *arg) : _arg(arg), _refCount(1) {}
0062
0063 RooLinkedListElem(TObject* arg, RooLinkedListElem* after) :
0064
0065 _prev(after), _next(after->_next), _arg(arg), _refCount(1) {
0066
0067
0068 after->_next = this ;
0069 if (_next) _next->_prev = this ;
0070 }
0071
0072
0073 virtual ~RooLinkedListElem() {
0074
0075 if (_prev) _prev->_next = _next ;
0076 if (_next) _next->_prev = _prev ;
0077 }
0078
0079 Int_t refCount() const { return _refCount ; }
0080 Int_t incRefCount() { return ++_refCount ; }
0081 Int_t decRefCount() { return --_refCount ; }
0082
0083 protected:
0084 friend class RooLinkedList ;
0085 friend class RooLinkedListImplDetails::Pool;
0086 friend class RooLinkedListImplDetails::Chunk;
0087 friend class RooLinkedListIterImpl ;
0088 friend class RooFIterForLinkedList ;
0089 RooLinkedListElem* _prev = nullptr;
0090 RooLinkedListElem* _next = nullptr;
0091 TObject* _arg = nullptr;
0092 Int_t _refCount = 0;
0093
0094 protected:
0095
0096
0097 RooLinkedListElem(const RooLinkedListElem&) ;
0098
0099 ClassDef(RooLinkedListElem,1)
0100 } ;
0101
0102
0103
0104 #endif