35 Warning(
"TOrdCollection",
"capacity (%d) < 0", capacity);
37 }
else if (capacity == 0)
115 Error(
"AddBefore",
"before not found, object not added");
136 Error(
"AddAfter",
"after not found, object not added");
149 if (!obj)
return nullptr;
152 if (idx == -1 || idx ==
fSize-1)
return nullptr;
172 if (!obj)
return nullptr;
175 if (idx == -1 || idx == 0)
return nullptr;
244 if (idx < 0 || idx >=
fSize) {
245 Error(method,
"index error (= %d) < 0 or > Size() (= %d)", idx,
fSize);
349 fCont[physIdx] =
nullptr;
367 if (!obj)
return nullptr;
370 if (idx == -1)
return nullptr;
401 Error(
"Sort",
"objects in collection are not sortable");
422 Error(
"BinarySearch",
"collection must first be sorted");
430 while (last >= base) {
431 Int_t position = (base + last) / 2;
506 if (fCursor < fCol->GetSize())
553 return (((
fCurCursor >= 0) && (fCurCursor < fCol->GetSize())) ?
const Bool_t kIterForward
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
virtual Int_t GrowBy(Int_t delta) const
Increase the collection's capacity by delta slots.
static void GarbageCollect(TObject *obj)
Add to the list of things to be cleaned up.
Bool_t IsSortable() const override
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Iterator abstract base class.
virtual TClass * IsA() const
Mother of all ROOT objects.
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
R__ALWAYS_INLINE Bool_t IsOnHeap() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Iterator of ordered collection.
TIterator & operator=(const TIterator &rhs) override
Overridden assignment operator.
TObject * operator*() const override
Return current object or nullptr.
void Reset() override
Reset collection iterator.
const TOrdCollection * fCol
TObject * Next() override
Return next object in collection.
Bool_t operator!=(const TIterator &aIter) const override
This operator compares two TIterator objects.
void AddFirst(TObject *obj) override
Insert object at beginning of collection.
TObject * After(const TObject *obj) const override
Return the object after object obj.
TObject * First() const override
Return the first object in the collection.
Bool_t LowWaterMark() const
TOrdCollection(const TOrdCollection &)=delete
void PutAt(TObject *obj, Int_t idx)
Put object at index idx. Overwrites what was at idx before.
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the collection.
void AddLast(TObject *obj) override
Add object at the end of the collection.
void Clear(Option_t *option="") override
Remove all objects from the collection.
void AddAfter(const TObject *after, TObject *obj) override
Insert object after object after in the collection.
~TOrdCollection()
Delete the collection.
Int_t PhysIndex(Int_t idx) const
void Sort()
If objects in collection are sortable (i.e.
Int_t IndexOf(const TObject *obj) const override
Return index of object in collection.
TObject * Last() const override
Return the last object in the collection.
Int_t LogIndex(Int_t idx) const
TObject * Remove(TObject *obj) override
Remove object from collection.
friend class TOrdCollectionIter
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
void AddAt(TObject *obj, Int_t idx) override
Insert object at position idx in the collection.
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
void Init(Int_t capacity)
Initialize ordered collection.
void Delete(Option_t *option="") override
Remove all objects from the collection AND delete all heap based objects.
Bool_t IllegalIndex(const char *method, Int_t idx) const
Return true when index out of bounds and print error.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
TObject ** GetObjectRef(const TObject *obj) const override
return address of pointer obj
void MoveGapTo(Int_t newGapStart)
Move gap to new position.
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Return an ordered collection iterator.
Int_t BinarySearch(TObject *obj)
Find object using a binary search.
void SetCapacity(Int_t newCapacity)
Set/change ordered collection capacity.
static void QSort(TObject **a, Int_t first, Int_t last)
Sort array of TObject pointers using a quicksort algorithm.
static void * Alloc(size_t size)
Allocate a block of memory, that later can be resized using TStorage::ReAlloc().
static void Dealloc(void *ptr)
De-allocate block of memory, that was allocated via TStorage::Alloc().
static void * ReAlloc(void *vp, size_t size, size_t oldsize)
Reallocate (i.e.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.